Alma Linux is an open-source enterprise-grade Linux distribution based on CentOS 8, inheriting many features from CentOS, including its package management tool. In Alma Linux, the primary tool for managing packages is dnf
, which stands for Dandified YUM (DNF).
dnf
was introduced in CentOS 8 to replace the old yum
tool. Compared to yum
, dnf
offers faster execution speed, more efficient dependency resolution algorithms, and a more flexible plugin system.
The basic command format for installing packages with dnf
is:
sudo dnf install package_name
If you want to install httpd
(Apache Web Server), you can run:
sudo dnf install httpd
When you execute this command, dnf
will resolve package dependencies and prompt you to confirm the installation of all related dependencies. Enter y
and press Enter to proceed with the installation.
To update all packages in the system to the latest version, you can use the following command:
sudo dnf update
If you only want to update a specific package, you can specify the package name:
sudo dnf update package_name
To remove a package from the system, you can use the following command:
sudo dnf remove package_name
If you want to view a list of all available packages, you can use the list
command:
dnf list available
If you are unsure of a package's name or want to find a package with specific functionality, you can use the search
command:
dnf search keyword
To search for packages related to "web server," you can run:
dnf search web server
To get detailed information about a specific package, such as description, version, release date, etc., you can use the info
command:
dnf info package_name
If you want to know which other packages a package depends on, or which packages depend on it, you can use the deplist
command:
dnf repoquery requires package_name # Show required dependencies dnf repoquery whatrequires package_name # Show who relies on it
dnf
downloads many RPM packages to the local cache when installing or updating packages. Over time, this cache can become large. You can use the clean
command to remove unnecessary cache files:
sudo dnf clean all
dnf in Alma Linux is a powerful and flexible package management tool that provides users with a plethora of options to install, update, remove, and manage packages effectively. By following this tutorial, you should be able to grasp the basic usage of dnf
and efficiently manage the packages in your Alma Linux system. Remember, dnf
has many advanced features and options that you can explore further by reading the official manual page man dnf
or visiting the dnf
documentation page.
Feel free to leave your comments below and don't forget to like, share, and subscribe for more content. Thank you for watching!