APT-GET Commands Cheat Sheet

Here is a cli commands cheat sheet for APT-GET command, you can use this as a quick reminder for basic commands with a brief description for each of the commands.

What is APT-GET command?

Add some data here

        ---
tags: [ packaging ]
---
# To fetch package list:
apt-get update

# To download and install package updates:
apt-get upgrade

# To download and install the updates AND install new necessary packages
# AND remove any packages that stand in the way of the upgrade:
apt-get dist-upgrade

# Full command:
apt-get update && apt-get dist-upgrade

# To install a new package(s):
apt-get install ...

# To download a package without installing it. (The package will be downloaded in your current working dir)
apt-get download 

# To change cache dir and archive dir (where .deb are stored):
apt-get -o Dir::Cache="/path/to/destination/dir/" -o Dir::Cache::archives="./" install ...

# To show apt-get installed packages:
grep 'install ' /var/log/dpkg.log

# To silently keep old configuration during batch updates:
apt-get update -o DPkg::Options::='--force-confold' ...
    

Check out the APT-GET command documentation .


You can also check our MegaSh cheatsheet tool, that has 150+ searchable linux cheat sheets in one page, so you never forget a command as you work again

Check Also

Best AI tools list