Package manager cheat sheet
This Package manager cheat sheet is just a collection of some useful commands that I tend to forget.
dnf / yum
# list all enabled repositories
dnf repolist
# disable repositories
dnf config-manager --set-disabled pgdg*
# list the files contained in a package
dnf repoquery -l postgresql
# list all installed packages
dnf list installed
# list all available packages from a repo
dnf repoquery --repo pgAdmin4
dnf repo-pkgs pgAdmin4 list
# search for a package
dnf search resource-agents
# which (installed or uninstalled) package provides a file
dnf provides */createrepo
# disable subscription manager
sed -i s/^enabled=1/enabled=0/ /etc/dnf/plugins/subscription-manager.conf
rpm
# list all installed packages
rpm -qa
# which package provided a installed file
rpm -qf /usr/pgsql-17/bin/postgres
# list all files contained in a package
rpm -ql postgresql17-server
# locate the path of a file provided by any package
rpm -qal | grep pg_config
# list all installed gpg keys
rpm -qa --qf 'gpg-pubkey-%{VERSION}-%{RELEASE} %{SUMMARY}\n' gpg-pubkey*
# remove a gpg key
rpm -e gpg-pubkey-10458545-64e78669
apt
# list installed packages
dpkg -l
# search available packages
apt-cache search zabbix-agent2
Leave a Reply