Managing Packages With Apt, Yum, And Dnf

Managing Packages with Apt, Yum, and Dnf

In the world of Linux operating systems, package management is a crucial aspect for installing, updating, and managing software. Three widely used package managers, Apt, Yum, and Dnf, play a significant role in this aspect.

Apt (Advanced Package Tool) is the package manager used in Ubuntu, Debian, and their derivatives. It provides a command-line interface for managing packages and dependencies. Apt uses repositories to store software packages and provides a mechanism to download and install them on the system.

Yum (Yellowdog Updater, Modified) is the package manager used in Red Hat Enterprise Linux (RHEL), CentOS, and Fedora. Similar to Apt, it utilizes repositories to fetch and install packages. Yum offers a flexible configuration system, making it easier for system administrators to manage multiple repositories.

Dnf (Dandified Yum) is a newer package manager that was developed as a successor to Yum. It is found in Fedora and Red Hat Enterprise Linux 8 onwards. Dnf aims to enhance speed, reliability, and security compared to Yum. It introduces several improvements, such as parallel downloads, better dependency handling, and enhanced modularity.

Package Management Commands


  • apt update: Updates the list of available packages and their versions.
  • apt install [package]: Installs a package.
  • apt remove [package]: Removes a package.
  • apt upgrade: Upgrades all installed packages to their latest versions.


  • yum update: Updates metadata about available packages.
  • yum install [package]: Installs a package.
  • yum remove [package]: Removes a package.
  • yum update [package]: Updates a specific package.


  • dnf update: Updates metadata about available packages.
  • dnf install [package]: Installs a package.
  • dnf remove [package]: Removes a package.
  • dnf upgrade [package]: Updates a specific package.

Managing Repositories

Repositories are essential for accessing software packages. All three package managers support adding and managing repositories.


  • /etc/apt/sources.list: Main configuration file for repositories.
  • apt-add-repository [repository] or add-apt-repository [repository]: Adds a repository.


  • /etc/yum.repos.d/*.repo: Repository configuration files.
  • yum-config-manager: Tool for managing repositories.


  • /etc/yum.repos.d/*.repo: Repository configuration files.
  • dnf config-manager: Tool for managing repositories.


Apt, Yum, and Dnf are powerful package managers that help in maintaining a Linux system’s software. They provide efficient ways to install, update, and remove packages, while also managing their dependencies and repositories. By utilizing these tools, system administrators and users can ensure their systems are up-to-date with the latest software and security patches.## Managing Packages with Apt, Yum, and Dnf

Executive Summary

Package managers such as Apt, Yum, and Dnf are essential tools for managing software on Linux systems. This comprehensive guide provides a deep dive into their functionalities, highlighting key commands, configurations, and best practices to effectively manage and maintain your Linux systems.


Package managers play a crucial role in the maintenance and efficiency of Linux systems. They simplify software installation, updates, and dependencies management, saving time and effort. This article explores three widely used package managers – Apt for Debian-based systems, Yum for Red Hat-based systems, and Dnf as the successor to Yum.


Apt commands

  • apt-get: Main command for package management
  • apt-cache: Used to search for packages and retrieve information
  • dpkg: Low-level package management tool


  • /etc/apt/sources.list: List of repositories for package downloads
  • /etc/apt/preferences: Configuration of package preferences and priorities

Best Practices

  • Utilize apt-get update to regularly update package information
  • Keep a local package cache with apt-get install -d
  • Safely remove packages using apt-get purge


Yum commands

  • yum install: Install packages
  • yum update: Update system and installed packages
  • yum search: Search for packages


  • /etc/yum.conf: Main configuration file for Yum
  • /etc/yum.repos.d/: Directory containing repository configuration files

Best Practices

  • Configure multiple repositories to enhance package availability
  • Utilize yum groups install to install predefined software groups
  • Resolve dependency issues using yum install --skip-broken


Dnf commands

  • dnf install: Install packages
  • dnf update: Update packages
  • dnf grouplist: Display available software groups


  • /etc/dnf/dnf.conf: Main configuration file for Dnf
  • /etc/dnf/plugins/: Plugins directory for extending Dnf functionalities

Best Practices

  • Take advantage of Dnf’s module system for flexible software management
  • Utilize the dnf check-update command to preview updates
  • Use dnf autoremove to remove obsolete packages


Apt, Yum, and Dnf are powerful tools for managing packages on Linux systems. Understanding their functionalities and configurations allows for efficient software maintenance. Regular updates, proper configuration, and adherence to best practices ensure a stable and secure system.

Keyword Phrase Tags

  • Linux package management
  • Apt package manager
  • Yum package manager
  • Dnf package manager
  • Command-line package management
Share this article
Shareable URL
Prev Post

Linux Networking: Setting Up A Vpn With Openvpn

Next Post

Customizing The Linux Kernel: An Overview

Comments 11
  1. your post is absolutely right, I’ve being doing this for a long time and I’ve never used another package manager other than apt

  2. apt is the best package manager out there, I’ve never had any problems with it and I’ve been using it for years

  3. thanks for the tutorial, I’ve been struggling with package management for a while now and this post has been a lifesaver

  4. this is a waste of time, you should just use the default package manager that comes with your operating system

  5. I’ve been using yum for years and I’ve never had any problems with it, I don’t see why you would want to use anything else

  6. this post is missing a lot of important information, I suggest you do more research before writing about this topic

  7. apt is the worst package manager I’ve ever used, it’s slow, unreliable, and it breaks my system all the time

Dodaj komentarz

Twój adres e-mail nie zostanie opublikowany. Wymagane pola są oznaczone *

Read next