Open Source software packages are maintained in repositories. Each release has a version number, and package dependencies are recorded so that matching versions of packages can be installed together. Occasionally software updates are not aligned perfectly, and an update to one program and its dependencies will break other installed programs.
This article explains how to manage installed and upgraded packages in an Ubuntu system using utility programs synaptic, dpkg, and apt-{anything}.
Hint
Display all the apt- programs at the console by typing apt-<Tab><Tab>.
Use the synaptics menu option File ‣ History to review package changes.
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install {package}={version}
sudo apt-get -f install
sudo apt-cache policy {package}
sudo apt-mark hold {package} --version {version}
apt-show-versions {package}
sudo dpkg --configure -a
Show all packages installed or upgraded in the past 3 days:
find /var/lib/dpkg/info/ -name \*.list -mtime -3 | sed `s#.list$##; s#.*/##`
Place a package on hold using a pin file:
sed -i 'Package: {program}\nPin: {version}\nPin-Priority: 1000' /etc/apt/preferences/{program/