• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 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 Linux

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

How VPS by How VPS
November 2, 2018
in Linux, Operating System
0
0
SHARES
48
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Installation of DNF
  2. 1. Check DNF Version
  3. 2. List Enabled DNF Repositories
  4. 3. List all Enabled and Disabled DNF Repositories
  5. 4. List all Available and Installed Packages using DNF
  6. 5. List all Installed Packages using DNF
  7. 6. List all Available Packages using DNF
  8. 7. Search for a Package using DNF
  9. 8. See what Provides a file/sub-package?
  10. 9. Get Details of a Package using DNF
  11. 10. Install a Package with DNF
  12. 11. Updating a Package using DNF
  13. 12. Check for System Updates using DNF
  14. 13. Update All System Packages using DNF
  15. 14. Remove/Erase a Package using DNF
  16. 15. Remove Orphan Packages using DNF
  17. 16. Remove Cached Packages using DNF
  18. 17. Get Help on Specific DNF Command
  19. 18. List all DNF Commands and Options
  20. 19. View History of DNF
  21. 20. List all Group Packages
  22. 21. Install a Group Package using DNF
  23. 22. Update a Group Package
  24. 23. Remove a Group Package
  25. 24. Install a Package from Specific Repository
  26. 25. Synchronize Installed Packages to Stable Release
  27. 26. Reinstall a Package
  28. 27. Downgrade a Package
    1. Sample Output
  29. Conclusion

DNF aka Dandified YUM is a next generation Package Manager for RPM based Distribution. It was first introduced in Fedora 18 and it has replaced YUM utility in recent release of Fedora 22.

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

DNF aims at improving the bottlenecks of YUM viz., Performance, Memory Usages, Dependency Resolution, Speed and lots of other factors. DNF does Package Management using RPM, libsolv and hawkey library. Though it does not come per-installed in CentOS and RHEL 7 you can yum, dnf and use it alongside the yum.

You may like to read more about DNF here:

  1. Reasons Behind Replacing Yum with DNF

The latest stable release of DNF is 1.0 (at the time of writing of post) which was released on May 11, 2015. It (and all previous version of DNF) is mostly written in Python and is released under GPL v2 License.

Installation of DNF

DNF in not available in the default repository of RHEL/CentOS 7. However Fedora 22 ships with DNF implemented officially.

To install DNF on RHEL/CentOS systems, you need to first install and enable epel-release repository.

# yum install epel-release
OR
# yum install epel-release -y

Though it is not ethical to use ‘-y‘ with yum as it is recommended to see what is being installed in your system. However if this does not matter you much you may use ‘-y’ with yum to install everything automatically without user’s intervention.

Next, install DNF package using yum command from epel-release repository.

# yum install dnf

After dnf installed successfully, it’s time to show you 27 practical usage of dnf commands with examples that will help you to manage packages in RPM based distribution easily and effectively.

1. Check DNF Version

Check the version of DNF installed on your System.

# dnf --version

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

2. List Enabled DNF Repositories

The option ‘repolist‘ with dnf command, will display all enabled repositories under your system.

# dnf repolist

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

3. List all Enabled and Disabled DNF Repositories

The option ‘repolist all‘ will print all the enabled/disabled repositories under your system.

# dnf repolist all

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

4. List all Available and Installed Packages using DNF

The command “dnf list” will list all the available packages from all the repositories and installed packages on your Linux system.

# dnf list

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

5. List all Installed Packages using DNF

While the “dnf list” command shows all the available/installed packages from all the repositories. However, you have the option to list only the installed packages using option “list installed” as shown below.

# dnf list installed

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

6. List all Available Packages using DNF

Similarly, the “list available” option, will list all the packages available to be installed from all the enabled repositories.

# dnf list available

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

7. Search for a Package using DNF

If incase, you’ve no idea about the package that you want install, in such situation you may use ‘search‘ option with dnf command to search for the package that matches the word or string (say nano).

# dnf search nano

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

8. See what Provides a file/sub-package?

The dnf option “provides” find the name of the package that provides specific file/sub-package. For example, if you would like to find what provides ‘/bin/bash‘ on your system?

# dnf provides /bin/bash

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

9. Get Details of a Package using DNF

Let’s assume you want to know the information of a package before installing it on the system, you may use “info” switch to get a detailed information about a package (say nano) as below.

# dnf info nano

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

10. Install a Package with DNF

To install a package called nano, just run the below command it will automatically resolve and install all required dependencies for package nano.

# dnf install nano

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

11. Updating a Package using DNF

You may update only a specific package (say systemd) and leave everything on the system untouched.

# dnf update systemd

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

12. Check for System Updates using DNF

Check updates for all the system packages installed into the system simply as.

# dnf check-update

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

13. Update All System Packages using DNF

You may update the whole system including all the installed packages with following commands.

# dnf update
OR
# dnf upgrade

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

14. Remove/Erase a Package using DNF

To remove or erase any unwanted package (say nano), you may use “remove” or “erase” switch with dnf command to remove it.

# dnf remove nano
OR
# dnf erase nano

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

15. Remove Orphan Packages using DNF

Those packages that were installed to satisfy dependency may be useless if not being used by other applications. To remove those orphan packages execute the below command.

# dnf autoremove

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

16. Remove Cached Packages using DNF

A lot of time we encounter out-of-date headers and unfinished transactions which results into error while executing dnf. We may clean all the cached packages and headers containing remote package information simply by executing.

# dnf clean all

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

17. Get Help on Specific DNF Command

You may get help of any specific dnf command (say clean) just by executing the below command.

# dnf help clean

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

18. List all DNF Commands and Options

To list help on all available dnf commands and option simply type.

# dnf help

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

19. View History of DNF

You may call dnf history to look at the list of already executed dnf commands. This way you can be aware of what was installed/removed with time stamp.

# dnf history

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

20. List all Group Packages

The command “dnf grouplist” will print all available or installed packages, if nothing is mentioned, it will list all known groups.

# dnf grouplist

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

21. Install a Group Package using DNF

To install a Group of packages bundled together as group package (say Educational Software) simply as.

# dnf groupinstall 'Educational Software'

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

22. Update a Group Package

Let’s update a Group Package (say Educational Software) by executing the below command.

# dnf groupupdate 'Educational Software'

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

23. Remove a Group Package

We can remove the group Package (say Educational Software) as.

# dnf groupremove 'Educational Software'

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

24. Install a Package from Specific Repository

DNF makes it possible to install any specific package (say phpmyadmin) from a repo (epel) as simply as,

# dnf --enablerepo=epel install phpmyadmin

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

25. Synchronize Installed Packages to Stable Release

The command “dnf distro-sync” will provides necessary options to synchronize all installed packages to most recent stable version available from any enabled repository. If no package is selected, all installed packages are synchronized.

# dnf distro-sync

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

26. Reinstall a Package

The command “dnf reinstall nano” will reinstall an already installed package (say nano).

# dnf reinstall nano

27 ‘DNF’ (Fork of Yum) Commands for RPM Package Management in Linux

27. Downgrade a Package

The option “downgrade” will downgrades the named package (say acpid) to lower version if possible.

# dnf downgrade acpid
Sample Output
Using metadata from Wed May 20 12:44:59 2015
No match for available package: acpid-2.0.19-5.el7.x86_64
Error: Nothing to do.

My observation: DNF does not downgraded the package as it is supposed to. It has also been reported as bug.

Conclusion

DNF is the upper state of the end of the art Package Manager YUM. It tends to do a lot of processing automatically which is not going to be praised by many experienced Linux System Administrator, as I believe. As a matter of example:

  1. --skip-broken is not recognized by DNF and there is no alternative.
  2. There is nothing like ‘resolvedep‘ command however you may run dnf provides.
  3. There is no ‘deplist‘ command to find package dependency.
  4. You exclude a repo, means the exclusion apply on all operations, unlike yum which excludes those repos only at the time of install and updates, etc.

Several Linux users are not happy the way Linux Ecosystem is moving. First Systemd removed init system v and now DNF will be replacing YUM sooner in Fedora 22 and later in RHEL and CentOS.

What do you think? are distributions and the whole Linux ecosystem is not valuing it’s users and moving against their will. Also it is often said in IT industry – “Why fix, If not broken?”, and neither init System V is broken nor YUM.

That’s all for now. Please let me know your valuable thoughts in the comments below. Like and share us and help us get spread.

Source: tecmint.com

Tags: Linux Commandslinux guidelinux vps setup guide
Previous Post

How to Remove Packages with Dependencies Using Yum

Next Post

Securely Accessing Your VPS

Next Post
Securely Accessing Your VPS

Securely Accessing Your VPS

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