Skip to content

Downloading DNF Package Dependencies Without Installing Them

Steps
4
Category
Linux
Covers
DNF/YUM
On this page 4 steps

When working with Linux, especially Fedora, CentOS, or RHEL distributions, the DNF or “Dandified YUM” is an indispensable tool. DNF is the next-generation version of the Yellowdog Updater, Modified (YUM), a package manager for .rpm systems.

Often, you may need to download package dependencies without necessarily installing them. This guide provides a detailed step-by-step process for accomplishing this task using DNF.

Prerequisites

This tutorial assumes that you’re using a Linux distribution that uses DNF as the package manager. If your system uses YUM, it may be possible to perform similar tasks, but the specific steps and commands can vary.

Step 1 of 4Update Your System

Before you proceed with the actual download process, it’s important to ensure your system is up-to-date. Run the following command:

sudo dnf update -y 

This command updates all the packages on your system. It’s a good practice to keep your system updated, as this helps fix bugs, patch security vulnerabilities, and install the latest features.

Step 2 of 4Check the DNF Download Plugin

DNF has a plugin system that allows for added functionality. To download packages without installing, you’ll need the dnf-plugins-core package, which includes the download plugin.

You can check if it’s installed with this command:

sudo dnf list installed dnf-plugins-core 

If it’s installed, you’ll see it in the list. If not, you can install it using:

sudo dnf install dnf-plugins-core -y 

Step 3 of 4Downloading Package Dependencies

Now that the download plugin is available, you can use it to download a package and its dependencies. Here is the basic command structure:

Replace <package-name> with the name of the package you want to download. The --resolve flag tells DNF to resolve and download dependencies.

For example, if you want to download the ‘nano’ editor and its dependencies, you would use:

sudo dnf download --resolve nano 

The package and its dependencies will be downloaded to the current working directory.

Step 4 of 4Inspect the Downloaded Packages

After the download process is complete, you can list the directory contents to see the downloaded packages. Each package will be a .rpm file:

ls 

This lists all the files in the current directory. You should see the package files for the desired package and its dependencies.

Final Words

By following the steps above, you have successfully downloaded a package and its dependencies without installing them. This feature can be incredibly useful, particularly when you want to inspect package content without installing or when working with systems that, for security or other reasons, cannot be updated via standard methods. It’s just one more reason why mastering DNF can greatly enhance your effectiveness as a Linux user.

Remember to exercise caution when downloading and using packages, always verify that the source of your packages is trustworthy. Keep exploring the vast world of Linux!

Rahul

Rahul Kumar is the founder and chief editor of TecAdmin.net. A Red Hat Certified Engineer (RHCE), he has worked in IT since 2009, with hands-on experience in Linux system administration, DevOps, web hosting, cloud platforms and automation. He started TecAdmin in 2013 to share practical, step-by-step guides, and leads its editorial work with one aim: making technical learning clear and useful for sysadmins, developers and beginners alike.

Leave a Reply

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


Back to top