Package management

From English Wiki
Revision as of 11:36, 15 August 2022 by Kentlee7 (talk | contribs)
Jump to navigation Jump to search

In Linux, it is less common these days to install a program by compiling code from a tarball (a compressed tar file). While GUI based installers are handy, using commands and package managers in the command line interface (CLI) can be more convenient, especially if the GUI package manager is misbehaving. Different distros use different package managers for installing programs, with some more common ones being as follows.

  • Apt for Debian-based distros (including Ubuntu and Mint)
  • DPKG, an older package manager in Debian (useful also for fixing some installation problems if you have trouble with apt)
  • DNF in Fedora and related distros
  • RPM (Redhat Package Manager), a standard installation file format and program installation utility in Redhad and others in the Fedora family
  • Pacman for core packages in Arch and Arch-based distros (like Manjaro)
  • Pamac in Arch and Arch-based distros, for installing packages from the AUR (Arch User Repository), a secondary repository, e.g., for packages that were not originally developed natively for Arch but have been adapted for Arch
  • Flatpak, for various distros (these are packaged in a way that they can run on many multiple distros without compatability or dependency problems)
  • Yay, an older manager for AUR packages in Arch
  • Yum, an older manager for packages in Fedora

Here, then, is a summary of basic commands for these various package managers.


Command Function
add-apt-repository ppa:PPA_NAME; apt update Add repository (Debian)
apt Debian package manager
apt --fix-broken install Fix broken packages
grep -v automatic List user-installed packages
apt autoremove Remove installation packages that are no longer needed
apt install pkg Install a package with apt in Debian based systems
apt list --installed List user-installed packages
apt remove Remove a package
apt search Search for a package in the database
apt show Show detailed information about a package
apt-get --fix-broken install Check and fix broken packages
apt-get -f install Fix broken dependencies
apt-get autoremove Remove all unwanted packages
apt-get check && apt-get purge program-name Check and fix broken packages
apt-get clean / autoclean / autoremove Clean up package installation files
apt-get install pkg Install a package (older Debian command)
apt-get remove pkg Remove a package o
apt-get update Update the repository
apt-get upgrade pkg Upgrade a specific package
dnf install pkg.rpm Using the DNF package manager to install a package in Fedora
dnf list installed List installed packages
dpkg --configure -a ; apt-get update Fix uninstalled packages and update
dpkg --install pkg_file Install package in Debian
dpkg --list List packages
dpkg --remove -force --force-remove-reinstreq pkg-name Check and fix broken packages
dpkg --search file_name Find installed packages
dpkg --status packag­e_name Package status
dpkg -i pkg.deb Install .deb package
dpkg -l List installed packages
grep -i installed Get a list of all packages (in a Debian based distribution)
dpkg –get-selection List user-installed packages
dpkg-query -l List installed packages
flatpak list --app List installed flatpack packages
paccache -r Clean up old package files in pacman (Arch) (keeps 3 recent versions of packages)
packman -Qq List user-installed packages
pacman -R pkg Remove a package with pacman
pacman -Rcns pkg Remove a package and all its dependencies
pacman -Rdd “pkg” Remove a package without breaking dependencies
pacman -Sc Clean up all old package files
pactree pkg View a list of dependencies associated with a package, displayed as a tree diagram (Arch based distros)
pactree -d 1 pkg View a list of direct dependencies associated with a package, displayed as a tree diagram (Arch based distros)
pamac update Update Arch (AUR) packages
rpm -e pkg.rpm Remove or uninstall an RPM package
rpm -i –force Forcibly install an RPM package
rpm -i –nodeps Install using the ‘no dependencies’ flag
rpm -i pkg.rpm Install package from a local file
rpm -i pkg.rpm Download an RPM package
rpm -qa Query and print all installed packages
rpm -qa List installed RPM packages
grep file Query and search for a particular installed package
rpm -qi Provide information on an RPM package
rpm -U Upgrade an RPM package
rpm –rebuild file Rebuild a package if corrupted by another installation process
snap list List installed snap packages
tar zxvf sourcecode.tar.gz; cd sourcecode_folder; ./configure; make; make install Compile and install a package from source code
yay -S pkg Install a package from the AUR (Arch user repository)
yum info pkg Display a description and summary information about a package in RHEL distributions
yum install pkg Install package .
yum install pkg.rpm Install a package in Yum
yum list --available List all available packages on RPM-based distributions
yum list --installed List all installed packages on RPM-based distributions
yum list installed List installed packages
yum remove pkg Uninstall or remove a package from your system.
yum remove pkg Remove a package on RPM-based distributions
yum search keyword Trace a package installation based on specific keywords.
yum update Update all system packages to the latest version (RPM-based distributions)



See also