Bash Wiki
Posts (Latest 30 updated) :
Read all
Contents:
  1. [Linux] Bash dnf Uso: Package management tool for RPM-based distributions
    1. Overview
    2. Usage
    3. Common Options
    4. Common Examples
      1. Install a Package
      2. Remove a Package
      3. Update All Packages
      4. Search for a Package
      5. List Installed Packages
      6. Get Information About a Package
    5. Tips

[Linux] Bash dnf Uso: Package management tool for RPM-based distributions

Overview

The dnf command is a package manager for RPM-based Linux distributions, such as Fedora and CentOS. It is used to install, update, remove, and manage software packages on your system, making it easier to handle software dependencies and maintain your system’s software.

Usage

The basic syntax of the dnf command is as follows:

dnf [options] [arguments]

Common Options

  • install: Install a package.
  • remove: Remove a package.
  • update: Update installed packages to the latest version.
  • search: Search for a package in the repositories.
  • list: List available packages or installed packages.
  • info: Display detailed information about a package.
  • clean: Clean up cached files.

Common Examples

Here are some practical examples of using the dnf command:

Install a Package

To install a package, use the install option:

dnf install package-name

Remove a Package

To remove an installed package:

dnf remove package-name

Update All Packages

To update all installed packages to their latest versions:

dnf update

Search for a Package

To search for a specific package:

dnf search package-name

List Installed Packages

To list all installed packages on your system:

dnf list installed

Get Information About a Package

To get detailed information about a specific package:

dnf info package-name

Tips

  • Always run dnf update regularly to keep your system up to date with the latest security patches and software improvements.
  • Use the --assumeyes option with commands to automatically answer “yes” to prompts, which can be helpful in scripts.
  • Check for available package versions using dnf list package-name before installing to ensure you are getting the desired version.