SoFunction
Updated on 2025-04-20

How to use package management RPM, YUM, and DNF in Linux system

This article introduces the commonly used package management systems in Linux systems, including Debian/Ubuntu, Hat/CentOS/Fedora, ArchLinux, openSUSE, etc., and focuses on the use of RPM, YUM/DNF, including installation, update, and removal of software packages.

1. The Linux system mainly uses the following package management systems:

/Ubuntu series: using dpkg and apt (APT)

/CentOS/Fedora series: using rpm and yum/dnf

Linux: Using pacman

: Use zypper

5. General method: source code compilation and installation

2.Red Hat/CentOS/Fedora System (YUM/DNF)

Command to install

rpm command introduction

The rpm command, full name Red Hat Package Manager, is a program used to manage various Linux suites. It was originally a program specially used by the Red Hat Linux distribution to manage various Linux suites. It has become popular because it follows GPL rules and is powerful and convenient, and has gradually been adopted by other distributions.

rpm default installation path

Installation path

meaning

/etc

Configuration file installation directory

/usr/bin

Executable command installation directory

/usr/lib

The function library used by the program is saved

/usr/share/doc

Basic software user manual save location

/usr/share/man

Help file saving location

Basic syntax of rpm command

rpm [Options] [Parameters] Full name of the package

Common options and parameter description of rpm command

Options

illustrate

-i

Install

-v

Show more detailed information

-h

Print

-U

Upgrade package

-e

Uninstall the package

-q

Query package

-V

Verification package

Notes on rpm command

When using RPM commands, you need to pay attention to the dependencies between software packages. If other packages depend on it when uninstalling a package, you need to uninstall the dependent package first. If you encounter dependency problems when installing or upgrading a package, you can use the yum or dnf command to automatically handle the dependencies.

and dnf installation

YUM (Yellowdog Updater, Modified) and DNF (Dandified YUM) are common package managers in Linux systems. YUM was an early package management tool, and DNF was its replacement in Linux 8 and later. The two are basically the same in command usage, software warehouse configuration and software installation, but DNF has improved performance and memory management.

Key differences

1. Dependency parsing: YUM: Use the public API to parse dependencies, and the dependency parsing speed is slow. DNF: Use libsolv for dependency resolution, with higher performance.

2. Programming language: YUM: mainly written in Python. DNF: written in C, C++ and Python.

3. Extension support: YUM: Only supports Python-based extensions. DNF: Supports various extensions, and the API has complete documentation.

4. Memory usage: YUM: When synchronizing the metadata of the repository, too much memory is used. DNF: Use less memory.

5 Update mechanism: YUM: Update the package without verification. DNF: If the package contains irrelevant dependencies, it will not be updated.

6. Error handling: YUM: If a repository is unavailable, it will be stopped immediately. DNF: If the enabled repository does not respond, it will be skipped and continue to use the available repository to handle transactions.

Configure the installation source

YUM's configuration file is usually located in the /etc/ directory and ends with .repo. These files define the detailed information of the repository, such as download address and GPG signature verification. For example, the YUM source can be set as a NetEase (163) YUM source to improve the speed of software package installation and update. The dnf installation source can be downloaded from the required enterprise.

Install software

yum install package name

dnf install package name

Update software

yum updata package name

yum upgrade package name

Remove software

yum remove package name

dnf remove package name

This is the article about how to use RPM, YUM, and DNF in Linux system. For more related RPM, YUM, and DNF content in Linux, please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!