apt

Updated: April 28, 2024

Display network information such as open connections, sockets and ports. For Macs us lsof instead.


Table of Contents

tldr

# update and upgrade machine
sudo apt update && sudo apt upgrade -y

# check if package is installed
apt -qq list <package>

# list all installed packages
apt list --installed

# install a specific version
apt install go=1.13.27

ARGUMENTS

apt update                      # update package database 
    upgrade                     # patch packages to latest stable versions
    full-upgrade                # upgrade distro
    install                     # install a package
      --only-upgrade            # upgrade without installing
      --no-upgrade              # install without upgrading
    reinstall                   # reinstall a package
    remove                      # uninstall a package but leaves configs behind
    purge                       # uninstall a package completely
    autoremove                  # removes dependencies no longer needed
    satisfy                     # handle conflicts for dependency strings
    search                      # search for packages and display matches
    show                        # get information about a package
    list                        # list packages for a criteria
        --installed             # list installed
        --upgradeable           # list upgradeable packages
        --all-versions          # list all available versions

aptitude search <package> -F "%c %p %d %V"  #find package informaton in apt-get
    %c   #status (package installed or not)
    %p   #package's name
    %d   #package's description
    %V   #available package's version
apt-cache search *search term*
apt-cache show *packagename*