• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 23, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System CentOS

Use DNF To Manage Software Packages On CentOS 7

How VPS by How VPS
October 1, 2019
in CentOS
0
0
SHARES
31
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Prerequisites
  2. Install DNF on CentOS
  3. DNF’s basic usages and examples
    1. Upgrade all packages
    2. Search for the package you need
    3. Search for an installed package
    4. Display repo list
    5. Install a single package
    6. Install multiple packages
    7. Reinstall a package
    8. Upgrade a single package
    9. Uninstall a package
    10. Uninstall all dependency packages which are no longer required
    11. Clean all temporary files
    12. Consult dnf man page
  4. Want to contribute?


Since Fedora 22, DNF (Dandified Yum) has replaced Yum to become the default software package manager of the Fedora distribution. Considering the demonstration effect of Fedora, it is just a matter of time before DNF becomes fashionable on other RPM-based distributions.

Compared with Yum, DNF:

  • achieves faster dependency resolving speed with less memory usage,
  • provides specific and solid Python API documentation,
  • runs in both Python 2 and Python 3 environments, and
  • has similar synopsis and usage.

Besides working on all of the RPM-based distributions, DNF can also co-exist with its predecessor, Yum. So you can already pilot DNF on CentOS or other RPM-based distributions without concerns.

Prerequisites

All of the instructions in this tutorial are geared to the needs of a sudo user on a Vultr CentOS 7 server instance. You need to log in as a sudo user to test the following commands. For instructions on how to create such a user, see this Vultr tutorial.

Install DNF on CentOS

You need to setup the EPEL Yum repo before you can install DNF.

sudo yum install epel-release
sudo yum install dnf

Note:

On CentOS 6, you will get a “No package dnf available” notice after you have run the commands above, because the DNF program has not been added into the EPEL 6.x Yum repo. You would need to build DNF from source.

DNF’s basic usages and examples

Synopsis of the dnf command:

[sudo] dnf [options] <command> [<arguments>...]

Now, I will show you some examples of how to use DNF:

Upgrade all packages

sudo dnf upgrade

or

sudo dnf update

Unlike in Yum, DNF’s “update” sub command is deprecated, now it becomes the alias of “upgrade”.

Search for the package you need

dnf list <package-name>

You can use wildcards to match more packages:

dnf list php* 

Search for an installed package

dnf list --installed <package-name>

Display repo list

dnf repolist

Install a single package

sudo dnf install <package-name>

Install multiple packages

sudo dnf install <package1-name> <package2-name> <package3-name>

Reinstall a package

sudo dnf reinstall <package-name>

Upgrade a single package

sudo dnf upgrade <package-name>

Uninstall a package

sudo dnf remove <package-name>

Uninstall all dependency packages which are no longer required

sudo dnf autoremove

Clean all temporary files

sudo dnf clean all

Consult dnf man page

You can consult the dnf man page to learn more about dnf sub commands and usages:

dnf --help

or

dnf -h

or

man dnf

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

How to Install a Tekkit Classic Server on CentOS 6/7

Next Post

How To Install and Run Ioping on CentOS 6

Next Post

How To Install and Run Ioping on CentOS 6

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet