How can I create a bash script that checks if a program is already installed, and if it isn't, installs it?
Thanks for your help.
Here's the code I have so far:
#/bin/bash
PS3="choose an option"
select opcion in "Installing_Youtube" "exit"
do
case $opcion in
"Installing_Youtube")
youtube-dl > /usr/bin
if [ $? -eq 127 ] ; then
echo "installing youtube"
apt-get update
apt-get install youtube-dl
mkdir Videos
else
echo "Youtube already installed"
fi
;;
"exit")
exit
/usr/bin
? – D. Ben Knoble Dec 23 '18 at 00:51apt-mark showmanual
then installing with something likeapt-get install "$(< package.list)"
. – Braiam Dec 27 '18 at 13:02apt-mark showmanual | wc -l
on my current system and it returned 2033 packages, many of which I am sure I never intentionally installed manually including things like apparmor and apport which I'm sure would have been installed by default.dpkg -l | wc -l
only found 3844 total and I don't modify half of my system. Maybe this should be a separate question. – Joe Dec 28 '18 at 01:02