Handy script to search for and install Debian packages
I often find myself searching for a package with
apt-cache search and then installing interesting matches with
apt-get install. Whenever I find myself doing something over and over again, I want to automate it, to make it easier, faster, repeatable. To this end, I have come up with search_and_install.sh.
Some may say that I should just use synaptic or a similar tool. I find doing this is much quicker and easier to use for this use case.
To use, just run
search_and_install.sh <search terms>. If you leave off the search terms, a dialog box will prompt you for the search terms. If there are matches, a dialog box will come up listing the matching packages with their name and the short description returned by
apt-cache search. Each will have a checkbox beside it. Check the packages you want to install and then hit OK. You will then be prompted for your password (or your root password, if you are on a non-Ubuntu system), and synaptic will run, downloading and installing the selected packages.
Currently, packages you already have installed are shown in the list. In future versions, I'd like to filter those out.
bash, zenity, apt, synaptic, gksu
A standard Ubuntu install should have these, and these are easily installable on any other Debian-derived distro.
This and other scripts will be linked from my Random Code page. Hopefully something there will be useful.