Skip to content
Menu
Sri Kode
  • Home
  • Contact
Sri Kode
September 2, 2024

Package Management in Linux Administration

When you think about managing software on your computer, you might imagine downloading a file from a website and clicking through an installer. However, in the world of Linux, package management works a bit differently. Let’s break it down in a way that’s easy to understand.

What is Package Management?

Package management in Linux refers to the process of installing, updating, configuring, and removing software packages on your system. A package manager is a tool that automates this process. It handles the heavy lifting of finding the right versions of software and their dependencies, ensuring they are all installed correctly and kept up to date.

RPM and YUM: The Basics of Red Hat-Based Systems

For distributions like Red Hat Enterprise Linux (RHEL), CentOS, Fedora, and Amazon Linux 2, the RPM (Red Hat Package Manager) is the core tool for managing software packages. The RPM system allows you to install, uninstall, and verify software, but it doesn’t automatically resolve dependencies. That’s where YUM (Yellowdog Updater, Modified) comes in.

YUM is a more advanced package manager that uses RPM in the background. It identifies any software dependencies, automatically downloads them, and installs them along with your desired package, making your life much easier.

In recent years, YUM has been replaced by DNF (Dandified YUM) in newer versions of these distributions. DNF offers better performance, enhanced dependency resolution, and a more modern approach to package management.

Usage of DNF (or YUM)

To ensure you have the necessary permissions, use sudo or switch to the root user (su -) before performing package management tasks. This prevents permission errors and ensures the commands execute successfully.

Here’s how you can perform some basic tasks with DNF:

  • To Installs a specific package and its dependencies on your system.
sudo dnf install package-name

When you run this command, the package manager consults configuration files in /etc/yum.repos.d/ to find repositories, which are essentially URLs where packages are stored. The package manager then fetches the package and its dependencies from these URLs and installs them on your system.

  • To displays a list of all the packages that are currently installed on your system.
dnf list installed
  • To shows a list of all packages that are available for installation from the configured repositories but are not currently installed (no sudo needed for this read-only action)
dnf list available
  • To remove (uninstall) a specific package and its associated dependencies that are no longer needed by any other installed packages (no sudo needed for this read-only action)
sudo dnf remove package-name -y
  • To updates a specific package to the latest version available in the repositories.
sudo dnf update package-name

Similarly, for APT:

For Debian-based distributions like Ubuntu, the package management system revolves around APT (Advanced Package Tool). APT is similar to YUM and DNF in that it automatically handles dependencies. The core command used to interact with APT is apt-get.

  • To install package
sudo apt-get install package-name

APT also looks up repositories listed in files located in /etc/apt/, fetching and installing packages as requested.

Specialized Package Managers for Customized Applications

Apart from the system package managers like dnf, yum, and apt-get, there are other package managers specifically designed for certain programming environments and languages. These specialized tools help manage dependencies and packages in custom applications or development settings.

  • npm (Node Package Manager): Used for managing JavaScript packages, especially in Node.js projects. The command npm install reads the package.json file to download all the necessary dependencies listed in it. This makes it easy for developers to manage and update JavaScript libraries in their projects.
  • pip (Python Installer Package): This package manager is popular among Python developers. It installs Python libraries and packages from the Python Package Index (PyPI) with the command pip install package-name. Pip ensures that Python projects have all the required libraries to work correctly.
  • Maven: Commonly used in Java projects, Maven manages builds, dependencies, and documentation using a central pom.xml file. It simplifies the process of building and managing dependencies for Java applications.

Whether you’re dealing with system packages or specialized environments, knowing the right commands and tools is essential for keeping your software up-to-date and your system running smoothly.

«Previous Post
Next Post»

To dive deeper… Check out these related topics:

  • AWS
    • EC2
    • IAM
  • DevOps
    • Lifecycle
    • Linux
      • Linux Administration
      • Server Access & Management
    • Role & Responsibilities
  • Docker
  • Introduction
  • Jenkins
  • Terraform

Leave a Reply Cancel reply

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

  • Preventing Data Loss in Containers with Docker Volumes
  • Fixing “Permission Denied” Errors in Containers
  • Fixing Port Accessibility Issues in Docker Containers
  • Artifact Repositories in DevOps: Why They Matter
  • Commonly Used Maven Build Targets in Daily DevOps Workflows
©2025 Sri Kode