Package
apt (Debian / Ubuntu)
Repo Cache
bash
apt updateSearch
bash
apt search dig | grep bin
# apt-file: search by file path inside packages (not yet installed)
apt install apt-file
apt-file update
apt-file search dig | grep binInstall
bash
apt install zsh git svn telnet wget curl make cmake
apt install containerd.ioRemove
bash
apt remove xxx
apt purge xxx # also remove config files
apt autoremove # remove orphaned dependenciesUpgrade
bash
apt upgrade # upgrade installed packages
apt upgrade xxx # upgrade one package
apt full-upgrade # may remove packages to satisfy depsInfo
bash
apt list
apt list --installed
apt show bind9-dnsutilsVersions & Pinning
bash
# all available versions across enabled repos
apt policy
apt policy firefox
# install a specific version
apt install firefox=59.0.2+build1-0ubuntu1dpkg (Debian / Ubuntu)
List Installed
bash
dpkg -l
dpkg -l | grep nginxFind Owner of File
bash
dpkg -S /usr/bin/lsb_release
dpkg -S /lib/libmultipath.soList Files of a Package
bash
dpkg -L lsb-releaseLocal File Install / Remove
bash
dpkg -i elasticsearch-8.8.2-amd64.deb
dpkg -r mysql-common # remove (keep config)
dpkg -P mysql-common # purge (remove config)dnf (RHEL / Fedora)
Repo Cache & Management
bash
dnf repolist
# enable / disable a repo
dnf config-manager --set-enabled crb
dnf config-manager --set-disabled crb
# refresh metadata
dnf update # also upgrades; use `dnf check-update` for read-only
dnf clean allSearch
bash
dnf search gtk | grep theme
dnf search shell-themeInstall
bash
dnf install zsh git svn telnet wget curl make cmake
dnf install containerdRemove
bash
dnf remove xxx
dnf autoremove # remove orphaned dependenciesUpgrade
bash
dnf upgrade # upgrade all (alias of `dnf update`)
dnf upgrade xxx # upgrade one packageInfo
bash
dnf list installed
dnf info bind-utilsVersions & Pinning
bash
# show all available versions across enabled repos
dnf list --showduplicates gcc
dnf search --showduplicates gcc
# install a specific version
dnf install gcc-11.4.1-3.el9Modules (AppStream)
bash
dnf module list
dnf module enable nodejs:18
dnf module disable <module>:<stream>
dnf module reset <module>rpm (RHEL / Fedora)
List Installed
bash
rpm -qa
rpm -qa | grep nginxFind Owner of File
bash
rpm -qf /bin/lsList Files of a Package
bash
rpm -ql nginxLocal File Install / Remove
bash
rpm -ivh xxx.rpm # install verbose with progress
rpm -Uvh xxx.rpm # upgrade (install if not present)
rpm -e xxx # removeVerify
bash
rpm -V nginx # verify package integrity
rpm -qip xxx.rpm # info about a .rpm filepacman (Arch)
Repo Cache
bash
pacman -Sy # refresh package database
pacman -Syu # refresh + upgrade everythingSearch
bash
pacman -Ss nginx # search remote repos
pacman -Qs nginx # search installed packagesInstall
bash
pacman -S zsh git curl make cmakeRemove
bash
pacman -R nginx
pacman -Rs nginx # also remove unused dependencies
pacman -Rns nginx # also remove config filesUpgrade
bash
pacman -Syu # upgrade all
pacman -S nginx # upgrading by re-installingInfo
bash
pacman -Q # list installed packages
pacman -Qi nginx # info about installed package
pacman -Si nginx # info about remote packageFind Owner of File
bash
pacman -Qo /usr/bin/nginxList Files of a Package
bash
pacman -Ql nginxLocal File Install
bash
pacman -U ./pkgname-1.0-1-x86_64.pkg.tar.zstReference: