Package Manager
Linux Package Manager
Advanced Package Tool (Apt) – Ubuntu, Debian-based Distro
apt update: update list of available packages
apt upgrade [package name]: upgraded installed packages after database has been updated
apt-cache search [keyword]: display information stored in cache, search in name and description
apt show [keyword]: Show information about a package
apt install {package name} [-y]
apt remove [–purge]: remove package, –purge will remove all leftover configuration
lsb_release -cs: check Ubuntu base version
Add Apt Repository
Local list: /etc/apt/sources.list and /etc/apt/sources.list.d/
Backup Sources: /usr/share/doc/apt/examples/sources.list
apt-get install --reinstall apt: Regenerate Source List
dpkg
dpkg -i package.deb: install .deb package
RPM - Redhat, CentOS
rpm -qa | grep -i <$keyword>: search for package
rpm -e <$package name>: erase/remove package
rpm -ivh <$package.rpm>: Install package
dnf - Oracle Linux
Yum - Redhat, CentOS
yum repolist [-v]: list repositories, -v is verbose with details
yum repolist --all: list repositories with status
yum-config-manager --enable/--disable $reponame: enable/disable a repository
rm -f /etc/yum.repos.d/repository-name.repo: remove a repository
remove repository package if installed via RPM package
yum check-update: used in Red Hat-based Linux distributions (such as CentOS and Fedora) to check for available package updates without actually installing them. It helps users gather information about updates before deciding whether to proceed with an upgrade.
yum search $keyword
yum list installed
yum info $package-name: info about specific package
yum clean all: clean cache
yum provides /path/to/file: Find which package provides a specific file
subscription-manager repos --list
subscription-manager repos --enable $REPO
Reference
https://docs.oracle.com/en/learn/use_dnf_on_oracle_8/index.html#work-with-dnf-repositories
https://linuxize.com/post/how-to-add-apt-repository-in-ubuntu/
Last updated