What is a package dependency in Linux?
Let's learn about Linux dependencies and their impact on Linux package management.
Linux programs are created from building blocks of software
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]
On Arch, use pacman with the -Si option. The Depends on section will display the dependencies.
pacman -Si [packagename]
On Red Hat-based Linux distributions, use DNF:
dnf deplist [packagename]
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.
You should read it
- 9 most popular Linux package managers today
- Decode how the package manager works and software installation on Linux
- How to use winget - New Package Manager for Windows 10
- How to find out if the package is installed in Linux
- How to execute .run or .bin packages in Linux
- How to Install or Remove an RPM Package
- Chocolatey or Windows Package Manager is the better tool to download Windows software?
- Binary and Source Package: Which should be used?
- How to install Pip in Ubuntu
- Winstall.app - web-based GUI for Windows Package Manager only
- How to manage packages on RPM-based Linux distributions with DNF
- How to Create DEB Packages for Debian and Ubuntu