Installing and Reinstalling Packages
apt-get and dpkg
Installing, Uninstalling, and Updating
- Update package list:
sudo apt-get update
- Upgrade packages:
sudo apt-get upgrade
- Clean package list caches:
sudo apt-get autoclean
- Install package:
sudo apt-get install XXX
ordpkg - i XXX
- Install and fix dependencies:
sudo apt-get -f install XXX
- Remove/delete package:
sudo apt-get remove XXX
ordpkg -r XXX
- Remove package and dependencies:
sudo apt-get autoremove
- Remove package and delete all configurations:
sudo apt-get remove XXX --purge
ordpkg -P XXX
- Reinstall package:
sudo apt-get install XXX --reinstall
Adding Package Keys
sudo apt-key adv --keyserver hkp://KEYSERVER_URL --recv KEY_ID
Removing Package Keys
- List all the packages:
sudo apt-key list
- Identify the desired package key to delete, in format such as:
pub 1024R/B455BEF0 2010-07-29 uid Launchpad clicompanion-nightlies
- Delete the key:
sudo apt-key del KEYID
- Recheck package list:
sudo apt-key list
Add / Remove Packages to apt-get
echo "deb http://REPOSITORY/apt/ubuntu VERSION/PACKAGE" | sudo tee /etc/apt/sources.list.d/PACKAGE_LIST
sudo rm /etc/apt/sources.list.d/PACKAGE_LIST