Debian/Ubuntu apt-get tricks.
Basics
Install software
apt-get install foobar
Search software
apt-cache search foobar
You can query files to see which packages own them, or query packages to see which files own them.
Installing apt-file
apt-get install apt-file
Build apt-get file information cache
apt-file update
Query through the packages to determine which package contains the file
apt-file search mysqld
Query the other way around, you know the package name and would like info about all the files which are provided by a given pacage:
apt-file list mysqld
List all installed software/packages
dpkg --get-selections > software.txt
That will save your installed list to a file called software.txt. That list is every piece of software required to reproduce the state your PC is currently in.
Another way to get a full list of installed software is to run the command
dpkg --list
To restore a PC the list above
# dpkg --set-selections < software.txt # apt-get dselect-upgrade
Clearing up space
Delete archived packages that are considered old.
# apt-get autoclean
Delete all archieved packages
# apt-get clean
Remove every file from a package
apt-get remove foobar --purge
Tags: apt-cache, apt-file, apt-get, Debian, dpkg, Ubuntu
Posted by Hans-Henry Jakobsen
There are times when you’re looking for a particular library, or file, which you know is available to Debian/Ubuntu but you cannot find the package which contains it. This is the kind of job that the Debian packages site helped with in the past, but given its current unavailability we’ll look at another approach. (more…)
Tags: apt-file, apt-get, Debian, dpkg, Ubuntu
Posted by Hans-Henry Jakobsen