Reading Time: < 1 minute
DNF (Dandified Yum) 101: Basic Package Manager Interaction
I. What is DNF (Dandified Yum)?
II. DNF Examples: Install, Remove, Upgrade, and Downgrade

Install a Package

Syntax:

dnf install <package>

Install a Single Package – Example:

dnf install mysql-server

Where mysql-server is the package name.

Install Multiple Packages – Example:

dnf install mysql-server mysql

Where mysql-server and mysql are the package names.

Upgrade / Update a Package

The update command has been deprecated in favor of upgrade.

Upgrade Every Package:

dnf upgrade

Upgrade a Single Package – Example:

dnf upgrade mysql-server

Where mysql-server is the package name.

Upgrade Multiple Packages – Example:

dnf upgrade mysql-server mysql

Where mysql-server and mysql are the package names.

Reinstall a Package

Syntax:

dnf reinstall <package>

Reinstall a Single Package – Example:

dnf reinstall mysql-server

Where mysql-server is the package name.

Reinstall Multiple Packages – Example:

dnf reinstall mysql-server mysql

Where mysql-server and mysql are the package names.

Downgrade a Package

Downgrades the specified package(s) to the highest of all known lower versions, if possible.

Syntax:

dnf downgrade <package>

Downgrade a Single Package – Example:

dnf downgrade mysql-server

Where mysql-server is the package name.

Downgrade Multiple Packages – Example:

dnf downgrade mysql-server mysql

Where mysql-server and mysql are the package names.

Remove a Package

By removing a specified package(s) from the server, you’ll also remove ANY packages dependent on the package(s) being removed.

Syntax:

dnf remove <package>

Remove a Single Package – Example:

dnf remove mysql-server

Where mysql-server is the package name.

Remove Multiple Packages – Example:

dnf remove mysql-server mysql

Where mysql-server and mysql are the package names.

List of All Available Commands

autoremove
check-update
clean
distro-sync
downgrade
group
help
history
info
install
list
makecache
provides
reinstall
remove
repolist
repository-packages
search
updateinfo
upgrade

Avatar for J. Mays

About the Author: J. Mays

As a previous contributor, JMays shares his insight with our Knowledge Base center. In our Knowledge Base, you'll be able to find how-to articles on Ubuntu, CentOS, Fedora and much more!

Latest Articles

Change cPanel password from WebHost Manager (WHM)

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change the root password in WebHost Manager (WHM)

Read Article