Linux: Software Configuration and Management
Basics
- Debian-based systems use
apt - RHEL-based systems use
yumanddnf - openSUSE systems use
Zypper
Package Managers
We use package managers to search, install, configure, update, and remove software in Linux environments.
apt - Debian-based systems
apt updateto update all package listapt upgradeto update all packagesapt install <PACKAGE>to install a packageapt remove <PACKAGE>to remove a packageapt show <PACKAGE>to show package detailsapt search <PACKAGE>to search for a packageapt purge <PACKAGE>to delete a package and associated fileapt list --installedto show all installed packagesapt cleanto clear cached downloaded packagesapt full-upgradeto the system distributionapt depends <PACKAGE>to show package dependenciesapt rdepends <PACKAGE>to show packages that depend on the selected packageapt-mark hold <PACKAGE>to lock a package at its current versionapt-mark unhold <PACKAGE>to unhold a currently held packageapt-mark showholdto show packages currently on hold
dnf - REHL-based systems
dnf check-updateto update all package listdnf upgradeto update all packagesdnf install <PACKAGE>to install a packagednf remove <PACKAGE>to remove a packagednf search <PACKAGE>to search for a packagednf list installedto view all installed packagesdnf clean allto clear cached packagesdnf historyto show transaction historydnf repolistto list enabled repositoriesdnf versionlock listto list all locked packagesdnf versionlock clearto clear all locked packagesdnf versionlock add <PACKAGE>to lock a package at its current versiondnf versionlock delete <PACKAGE>to delete a "version locked" packagednf config-manager --set-enabled <REPO NAME>to enable a repositorydnf config-manager --set-disabled <REPO NAME>to disable a repository
pacman - Arch-based systems
pacman -Syto update all package listpacman -Suto update all packagespacman -S <PACKAGE>to install a packagepacman -R <PACKAGE>to remove a packagepacman -Ss <PACKAGE>to search for a packagepacman -Qi <PACKAGE>to view a package detailspacman -Qto list all installed packagespacman -Scto clear cached packages
zypper - openSUSE-based systems
zypper refreshorzypper refto update all package listzypper upgradeorzypper upto update all packageszypper upgrade <PACKAGEto update a single packagezypper info <PACKAGEto view package detailszypper install <PACKAGE>orzypper in <PACKAGE>to install a packagezypper remove <PACKAGE>orzypper rm <PACKAGE>to remove a packagezypper search <PACKAGE>orzypper se <PACKAGE>to search for a packagezypper patch-checkto check for important patcheszypper al <PACKAGE>(add lock) locks a package to prevent it from being updated or removed during system updateszypper rl <PACKAGE>(remove lock) removes a lockzypper mr -d(modify repository) to disable a repository
Source Installation
It is a method used to install software when it is not available in repositories or when it requires a custom build.
Installing a software from source usually includes the following steps:
./configureto configure the systemmaketo build the softwaremake installto install the newly built softwaremake cleanto remove temporary build files
GNU GPG Signatures
GNU GNU Not Unix. Used to verify the authenticity of software packages, and files
GPG GNU Privacy Guard - is used to encrypt and sign data.
GPG usage
gpg --import <KEY FILE> to import a public key. ex: gpg --import developer_public_key.asc
gpg --verify <SIGNATURE FILE> <PACKAGE> to verify a signed package. ex: gpg --verify my_program.tar.gz.sig my_program.tar.gz
gpg --list-keys to list all trusted keys