We earn commission when you buy through affiliate links.

This does not influence our reviews or recommendations.Learn more.

Have you ever wondered how Linux manages the packages downloading, installing, and removing them?

5-package-management-benefits

Well, it all comes under Linux package management.

As Linux is open source, you’re able to find many package managers.

And today, we get the chance to learn about Linux package managers in detail.

6-how-package-manager-works

What is Linux Package Manager?

The package metadata offers information about the packages, including their description, version, and dependencies.

Lets clarify that by learning about the associated package manager core concepts below.

7-package-manager-functions

#1.Packages

A package is at the core of the Linux operating system.

The package can be a command line oriented or a GUI tool.

A package can also act as a dependency for other software programs to run.

8-tips-for-using-package-manager-software-management

If we look into the past, youll see that software needs to be compiled manually.

To ease the process of managing software or services, Linux introduced its package management system.

#2.Dependencies

Linux operating system is complex.

1-installing-gimp-apt

It consists of multiple software that depend on each other.

For any software to work, it would require some other software or package.

Lets have a go at understand it from the development perspective.

2-remove-gimp-apt

If you pick up any open-source project, youll see it utilizes open-source libraries.

After all, it is not wise to develop everything from scratch re-inventing the wheel is unnecessary.

So, anytime you install a package, itll have its listed dependencies.

3-purge-apt

The package manager looks for the list of dependencies and installs all packages or the missing ones.

#3.Repositories

Repositories or repos are virtual online places that list all the packages.

Benefits of Using a Package Management System

There are multiple benefits of using a package management system.

4-upgrade-system-

These include:

Next, we will discuss how the package manager works.

How Package Manager Works?

A package manager is at the core of the Linux operating system.

However, it is also available on Linux.

This software repository lists packages.

Each package has metadata information, making it easy for the package manager to handle.

by running commands such as apt update.

Next, itll look for the dependencies needed for installing the package.

If the package has dependencies, itll install them automatically without user intervention.

Like that, the package manager can do other actions, including re-installing packages and removing and upgrading them.

The best part about all of these is that everything is configurable.

For example, you might configure mission-critical packages for your project to update when you do it yourself.

Lets go through them below.

It uses a dkpg package management tool and a package file format of .deb.

It builds on top of dkpg and acts as a front-end for the dkpg package manager.

Some of the APT commands include apt, apt-cache, and apt-get.

Lets see some of it in action below.

#2.DPKG

DPKG stands for Debain-based package management system.

The package manager uses the .deb extension.

Unlike APT, it cannot automatically install packages and their dependencies.

To install a package with dpkg, youll need to use the following command.

Similarly, you’ve got the option to remove a package by running the following command.

#3.YUM

YUM stands for Yellow Dog Updater, Modified.

It offers an easy-to-use interface.

#4.DNF

DNF stands for Dandified YUM.

It is a YUM successor and replaces it in most cases.

Like YUM, DNF utilizes the RPM package as its underlying package management.

However, it offers improvement in better documentation, faster dependency resolution, improved performance, and so on.

For example, you could find RPM in CentOS and Fedora.

RPM uses a .rpm extension.

It uses the .tar.xz file format.

Here, packages are stored and distributed in compressed tarballs.

This makes packages small and, hence, easy to distribute and install.

Pacman relies on the Arch Build System (ABS) to install packages.

It is a CLI tool that handles packages in the openSUSE Linux distro.

It uses a .rpm package file format, similar to YUM and DNF.

However, youll rely here on the Zypper interface, which uses the ZYpp libzypp library.

This makes Zypper faster compared to other package managers.

#8.Portage

Portage is the package manager for Gentoo distro.

The package file format in Portage is .tbz2 a compressed tar archive or e-build shell script.

Portage works differently compared to other package managers in our list.

Here, Portage uses pre-compiled binary packages.

The packages are distributed through e-builds a typical shell script.

Which Linux Package Manager Should You Choose?

Most package managers are self-sufficient.

In most cases, youre stuck with the Linux distro youre using.

If youre starting, you most probably have to use APT.

Advanced users may want to use other package managers.

However, the end goal is always to have better software management.

So, you’re free to pick any package manager you want, depending on your requirements.

This will benefit your software development process, improving your productivity and workflow.

How to Use A Package Manager?

In this section, well look at examples of how to use a package manager.

Well use the Advance Package Tool (APT) to simplify things.

You will also likely use APT as your first package manager.

Installing Packages

To install a package, youll need to use the following command.

$ sudo apt install package-name

Lets install gimp using the command.

For example, if youre looking for video editing software, youll need to search for it as below.

Removing Packages

you’ve got the option to also remove packages if you want.

To remove a package, youll need to use the following command.

$ sudo apt remove gimp

However, this does not remove any dependencies or package configuration.

To completely remove it, youll need to use the purge option.

It is a critical part and dictates how you manage packages on Linux.

With a package manager, you dont have to worry about dependencies or manually search for packages to install.

More On Linux