Skip to content

Instantly share code, notes, and snippets.

@apolloclark
Last active November 19, 2023 13:13
Show Gist options
  • Save apolloclark/4c607fd09f52b7c02820 to your computer and use it in GitHub Desktop.
Save apolloclark/4c607fd09f52b7c02820 to your computer and use it in GitHub Desktop.
APT cheatsheet
# list repos
sudo apt-cache policy
# add repo
sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ saucy universe multiverse"
# remove repo
sudo add-apt-repository --remove <ppa:whatever/ppa>
# list packages
dpkg --get-selections | grep -v deinstall
# list packages versions
sudo apt-cache policy <package_name>
# list packages, with updates
sudo apt-get -u upgrade
# upgrade, system
sudo apt-get dist-upgrade
# upgrade, all packages
sudo apt-get upgrade -y
# upgrade, one package
sudo apt-get install -y --only-upgrade <packagename>
# install package
sudo apt-get install -y <package_name>
# remove package
sudo apt-get purge -y <package_name>
# remove stale packages
sudo apt-get autoremove -y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment