What is a package dependency in Linux?

You may have heard about package dependencies in Linux and wondered what they are. Dependencies may seem confusing, but there are tools in Linux to make sure every program you install has all the necessary components.

Let's learn about Linux dependencies and their impact on Linux package management.

Linux programs are created from building blocks of software

What is a package dependency in Linux? Picture 1What is a package dependency in Linux? Picture 1

Linux dependencies are simply things a program needs to run. This is because Linux developers tend to write programs in a modular way, similar to the 'Unix philosophy' of building programs from smaller components.

 

Dependency are usually shared libraries. They can be for things like accessing databases, using network protocols, or drawing graphical elements on the screen. While proprietary programs also use shared libraries, that's easier to do in the Linux world because they're also often open source.

Dependency can also be complete program. A common pattern in the Linux world is to build a GUI user interface for an existing command line program.

Using shared libraries makes development easier because developers don't have to come up with new ways to do things every time they want to create a new application.

How Package Managers Make Linux Software Installation Easier

You can download the source code from the open source program's website and try to compile it yourself, but you'll often see something missing. This is because these projects don't include any dependencies with their program, assuming you have them installed or are willing to do so.

This worked well in the early days of Unix, running on mini PCs and mainframes with dedicated admin teams, but as Linux started to gain popularity on PCs, the old way was hard to manage for those who didn't. Single user may not have much Unix experience.

Linux distributions are starting to include package management tools that keep track of dependencies, download them over the Internet, and install and update them when a new version is available.

Flatpak and Snap are the latest efforts to manage dependencies by making them available through an application. This way, dependencies and applications can be better synchronized. Developers have more control over how the app will behave when it gets to users.

How to view package dependencies on Linux

The Linux distro package sites can show any package dependency. You can also see what dependencies a package has using the package manager.

 

On Debian or Ubuntu, use APT:

apt show [packagename]

What is a package dependency in Linux? Picture 2What is a package dependency in Linux? Picture 2

On Arch, use pacman with the -Si option. The Depends on section will display the dependencies.

pacman -Si [packagename]

What is a package dependency in Linux? Picture 3What is a package dependency in Linux? Picture 3

On Red Hat-based Linux distributions, use DNF:

dnf deplist [packagename]

What is a package dependency in Linux? Picture 4What is a package dependency in Linux? Picture 4

 

Dependency is not so mysterious on Linux. They show how Linux programs are built from smaller components. The package manager makes software installation easier by keeping track of packages.

It is also possible to see what dependencies the package has. They are also why you should update your package manager when installing new programs.

3.5 ★ | 2 Vote