Register and Login Pages

Apt is the preferred package manager for Ubuntu. The main commands should bevery similar to Apt-Get.

This table explains some common commands between Apt and Apt-Get. It is comprehensive yet incomplete.

 

 

Apt

Apt-Get Equivalent

Description

apt updateapt-get updateUpdate source lists and package cache
   
 apt-get -y –force-yes COMMANDForce yes
 sudo DEBIAN_FRONTEND=noninteractive apt-get -y COMMANDForce yes
   
apt upgradeapt-get upgradeUpgrade packages
   
apt full-upgradeapt-get dist-upgradeUpgrade system OS
apt install package XXXapt-get install package XXXInstall package
apt remove package XXXapt-get remove package XXXRemove package (leaves configuration files)
apt purge package XXXapt-get purge package XXXRemove package and configuration files
apt autoremove XXXapt-get autoremove XXXRemove package and unnecessary dependencies
apt autoremove –purgeapt-get autoremove –purgeRemove packages, configurations, and unnecessary dependencies
apt –reinstall install XXXapt-get install –reinstall         XXXReinstall packages
 apt-get checkCheck for broken dependencies
 apt-get -f installFix broken dependencies
apt cleanapt-get cleanRemove all packages from package cache
apt autocleanapt-get autocleanRemove packages for uninstalled programs from package cache
   
apt search XXXapt-cache search XXXSearch package cache for XXX
apt show XXXapt-cache show XXX 
apt list –installeddpkg –get-selections | grep -v deinstallList installed packages
apt list –installeddpkg -lList installed packages
apt edit-sourcesecho ‘new line of text’ | sudo tee -a /etc/apt/sources.listAdd a new package source
apt edit-sourcessudo nano /etc/apt/sources.listAdd a new package source
   
apt depends XXXapt-cache XXXFind package dependencies (packages that XXX needs)
apt rdepends XXXapt-rdepends XXXFind reverse dependencies (packages that need XXX)
apt policy XXX apt-cache policy XXXSet package update policy
apt held dpkg –get-selections | grep holdList packages with prevented ugprades
apt hold XXXecho XXX hold | sudo dpkg –set-selectionsPrevent upgrade of package
apt unhold XXXecho XXX install | sudo dpkg –set-selectionsRemove hold on package upgrade
   
apt list –upgradable (sudo not required)apt-get -u upgrade –assume-no (sudo required)List upgradeable packages
   
 aptitude show XXX Get package description
 apt-cache show XXX 
 dpkg -p XXX Get package description
 aptitude why XXXDetail packages dependent on XXX
 dpkg -S <XXX>

 

Searches for package dependent containing XXX filename

 

Resources: 1, 2, 3, 4, 5, 6

 

Scroll to top