Every modern Linux distribution comes with a set of tools for installing and updating software. Such tools are called package managers.
Package managers help you find software, download it to your computer and install or upgrade it. When a certain software package can’t work without additional components, relevant software packages will be installed automatically.
In Red Hat family of operating systems the package manager is called yum. In recent years it’s been replaced with backward-compatible tool called dnf.
yum package manager
yum stands for Yet Another package Manager.
When running the yum command you should specify a sub command followed by optional package or file names.
IMPORTANT: Many functions of the package manager can be used by regular users, but installing and removing software requires root privilege.
List installed software packages
Here’s how you can list all the installed packages on your system (warning! it will be a long list)
It’s a lot more useful to filter this output using grep command.
Let’s get the list of all the Python related packages installed:
Search for software packages
yum lets you find new software, too. If you are a user of bash shell, you can easily find all the related autocompletion packages like this:
yum search output shows you exact matches first - packages that fully match your search pattern. Later in the output you can see all the packages that have your pattern in the package name: bash-completion, bash-doc etc.
Install software with yum
Once you know a package name, just use the yum install command to have it downloaded and installed.
Software installation is a global change in your operating system, this means you will have to use sudo command when running yum install.
If you try running yum install as regular user, you’ll see an error:
Let’s use sudo and yum to install the bash-doc package:
Congratulations! You now know how to install software with yum.
Uninstall Software with yum
Let’s learn the last basic function of using package manager in Red Hat: uninstalling software packages.
You’ll need sudo privilege and specify exact package name in order to uninstall it:
Well done! Basic knowledge of yum/dnf usage will let you quickly check, install or remove software as necessary.