I'm trying to automate my setup as much as possible.
To do this I have lists of packages that I want to install, for example: banshee wireshark audacity thunderbird thunderbird-lightning calibre deluge unison-gtk usb-creator-kde ding digikam chromium-browser bleachbit soundconverter kdenlive firefox-kde-support vlc kwrite openjdk-6-jre icedtea6-plugin virtualbox virtualbox-guest-additions-iso.
I want to write a small bash script to call apt-get to install these packages only if they're not already installed.
Currently I have this but it doesn't work:
dpkg -s "$1" > /dev/null 2>&1 || apt-get -y install "$1"
, (where $1 is the list)
apt-get -y install
with already-installed package names is apt-get will change the status of auto-installed packages to "manually installed" in this case. See https://askubuntu.com/q/831/550780 for details. – CODE-REaD Jan 23 '20 at 19:40