Skip to main content

Package Managers

====================================================================================

RHEL - yum & dnf

yum and dnf are typically interchangeable in RHEL systems.

====================================================================================

yum

Cache & Repositories

Update cache

yum makecache

List enabled repositories

yum repolist

List all repositories

yum repolist --all

repositories are stored in /etc/yum.repos.d/

------------------------------------------------------------------------------------------------------------------------------------------  

Installing/ Searching/ Updating Packages

Install package

yum install packagename

remove package

yum remove packagename

update all packages

yum update


====================================================================================

Ubuntu - apt

====================================================================================

Cache & Repositories

Ubuntu apt uses a cache to store what can be installed/updated from repos. Before installing or updating software, it's worth checking that the cache has been recently updated, and if it hasn't; running an update on the cache.

Update cache

apt update

Check when cache was last updated:

stat -c %z /var/lib/apt/periodic/update-success-stamp

repositories are stored in /etc/apt/sources.list or /etc/apt/sources.list.d

------------------------------------------------------------------------------------------------------------------------------------------  

Installing/ Searching/ Updating Packages

Search packages

apt search packagename

Install package

apt install packagename

Remove package without removing configuration files

apt remove packagename

Remove package and configuration files

apt purge packagename

Check for updates

apt list --upgradable

Run all updates

apt upgrade

====================================================================================

openSuse - zypper

Cache & Repositories

Zypper uses a cache to store what can be installed/updated from repos. Before installing or updating software, it's worth checking that the cache has been recently updated, and if it hasn't; running an update on the cache.

update cache

zypper ref

List repositories 

zypper lr

Repositories are stored in /etc/zypp/repos.d

------------------------------------------------------------------------------------------------------------------------------------------  

Installing/ Searching/ Updating Packages

Search packages

zypper se packagename

Search specifically

zypper se --match-words packagename

or

zypper se --match-exact packagename

Install package

zypper in packagename

Remove package (only option to remove package and configuration files)

zypper rm packagename

====================================================================================