Tips for working with package-managers like apt-get
- A Typical Workflow
- apt / apt-get (Ubuntu, Debian)
- Refresh the list of available packages
- List packages to find the one we need
- List available revisions of a package
- Install or upgrade a package
Locate the package that a file belongs to
(see also ask-ubuntu: How do I find the package that provides a file?)
- scans the content of installed packages only
dpkg -S <full/path/and/filename>
or
dpkg --search $(which <command>)
- may need to install/refresh this tool
- may list packages that are not installed
sudo apt install apt-file
sudo apt-file update
apt-file find <filename>
sudo apt install <package>
sudo apt install <package>=<revision>
sudo apt-cache policy <package>
apt list
apt list --installed
apt list --upgradable
- Run this to resolve errors like:
GPG error: ... The following signatures were invalid: EXPKEYSIG ... - Can point to a different key-server, as long it is a server you trust
- This format should work over firewalls/VPN as well
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys <KEY>
(does not change the configuration of the host -
nothing is installed or upgraded except the packages-DB)
sudo apt update