How do you get a list of all installed packages? How do you get a list of all available packages in the repos? How do you know what package a file belongs to? How do you list the files in a package?
apt-get update will update the package database on your system. This is pretty much a prerequisite before doing anything else with apt.
apt-get install package installs the specified package.
apt-get upgrade package upgrades the specified package.
apt-get remove package remove the specified package.
The "-s" switch is for "simulate" and will show you what is going to be done without actually doing anything. The "-y" switch says to answer yes to any subsequent questions. The "-d" switch says to download a package (to /var/cache/apt/archives) without actually installing it.
apt-cache search something
apt-cache show package
apt-cache policy package
How do you get a list of all installed packages? How do you get a list of all available packages in the repos? How do you know what package a file belongs to? How do you list the files in a package?
dpkg -l > pkg.list apt list --installed > pkg.list apt list | grep -v "installed" apt list --all-versions package
dpkg-query -L
To see the files a .deb file will install
dpkg-deb -c
To see the files contained in a package NOT installed, use apt-file (which you may need to install).
apt-file listIf you need to install apt-file:
su apt-get install apt-file apt-file update
dpkg -S /bin/ls dpkg-query -S '/bin/ls' apt-file search date
Adventures in Computing / [email protected]