KandZ – Tuts

We like to help…!

Linux CLI 26 🐧 Package management

a - Package management introduction
Each package manager maintains a list of software packages
Those can be installed, updated and removed from the system
Package managers also provide tools to search for packages...
install dependencies, manage configurations and automate updates
Almost all packages can be found on the internet
Package file is a collection of files that constitute a software package
That files are metadata files (YAML, JSON), pre/post installation scripts and numerous of programs
Metadata files contain information about the package's dependencies, installation instructions etc

b - Common package managers
Common package managers:
APT → Advanced Package Tool, default for Debian, Ubuntu, Linux Mint distros
YUM → Yellowdog Updater Modifier, default for Red Hat, and Fedora distros
Zypper → default for openSuse distro
pacman → default for Arch Linux distros
When you install a software package with one of the above package managers,
the package manager reads the metadata files from the package to determine what...
packages need to be installed and how they should be configured.
It downloads dependencies, extract software, create directories and setup configurations

c - apt package manager
apt update → updates the package index
apt upgrade → upgrades all installed packages on the system
apt list --upgradable → shows the packages that can be upgraded
apt install nano → installs nano package
apt remove nano → removes nano package
apt purge nano → removes all package data including user configuration files
apt autoremove → removes cached packages and uninstalled dependencies
apt search nano → searches for a package nano. You can also use regex

d - yum package manager
yum upgrade → upgrade all packages
yum install packageName → installs packageName
yum install /pathTo/file.rpm → installs a local RPM package
yum reinstall packageName → reinstalls packageName
yum remove packageName → removes the packageName, not the configuration files
yum downgrade packageName → installs packageName's previous version
yum search packageName → searches for packageName

e - zypper package manager
zypper up → updates all packages
zypper in packageName → installes packageName
zypper in packageName.rpm → installs local rpm file
zypper re packageName → removes packageName
zypper se packageName → searches for packageName
zypper source-install packageName → download source code and install it
zypper repos → list all known repositories

f - pacman package manager
pacman -Syu → upgrades all packages
pacman -S packageName → installs packageName
pacman -Rsc packageName → uninstalls packageName
pacman -Ss packageName → searches for packageName
pacman -Qs packageName → searches for installed packageName
pacman -Qdt → lists unneded packages
pacman -Rns $(pacman -Qdtq) → Uninstalls unneeded packages

Leave a Reply