This post explains some different package managers available for Linux operating system.
List of Linux Package Managers
Linux package managers featured on this post:
- Dependent packages
- APT
- YUM
- DNF
- Standalone packages
- Snap
- Flatpak
- AppImage
Dependent packages
Dependent packages requires that when an app is installed are its dependencies are installed within the system.
There may be some conflicts if an app requires a version of a dependency and another app requires a different version of the same dependency. This is one of the reasons why the OS controls the latest version of software that is being installed and tries that all software uses the same version of dependencies.
Standalone packages are an alternative that tries to address this issue.
APT
APT, an acronym for Advanced Package Tool, is a package manager. Its command is apt, formerly known as apt-get.
It was introduced in 1998 as a development within the Debian project. apt works with Debian packages, that have file extension .deb.
A deb package contains only the data for its own application. In case that the application requires other packages (i.e., there are dependencies), the other packages will be automatically downloaded and installed before the app. This operation would be recursive for each package involved.
Because of the use of dependencies, apt-get packages are smaller than snap packages.
apt does not allow to install different versions of the same package.
When you run an app installed from apt, it is run as a standard process in the OS. There is no sandboxing.
To update the info from repositories:
sudo apt update
To install a package with apt:
sudo apt install packagename
To uninstall a package with apt:
sudo apt remove packagename
To update installed packages with apt:
sudo apt upgrade
To upgrade only a single package, and only if it is installed.
sudo apt --only-upgrade install packagename
To check which version of a package is installed, you can use command apt-show-versions. apt-show-versions is not installed by default.
To install apt-show-versions:
sudo apt install apt-show-versions
To check the version of an installed package (using apt-show-versions):
apt-show-versions packagename
To check which packages can be upgraded:
apt list --upgradable
To remove packages that are no longer needed because they are no longer used by apps:
sudo apt autoremove
To upgrade the operating system:
sudo do-release-upgrade
YUM
Yellow-dog Updater Modified (YUM) is a package manager that work with .rpm packages.
YUM is the tool that works with RPM (RPM Package Manager, formerly RedHat Package Manager) packages, that have file extension .rpm.
DNF
DNF (Dandified YUM) is an evolution of Yum packages.
It is the default package manager used on Fedora and Fedora-based distributions.
pacman
pacman is the default package manager for Arch and Arch-based (such as Manjaro) Linux distributions.
Standalone Packages
Standalone packages contain the apps and all its dependencies in an isolated environment. This allows that an application can have a version of a dependency and another application a different version, what was not possible using dependent packages.
They appeared later than dependent package.
Snap
Snap is a package manager developed by Canonical, the British company behind Ubuntu OS.
Snap packages include the dependencies within it, and thus, they are standalone packages. This is one of the reasons why snap packages are heavier than apt packages.
snap packages are standalone. This packages includes all dependencies. Because of this reason, snap packages are heavier.
Because there are no dependencies between packages, snap packages are easier to create than apt.
The installation and uninstallations are usually cleaner.
Snap allows to install multiple versions of the same package.
Another feature from snap packages is that when you execute an application installed from snap, it is run in a sandboxed environment.
To install a package with snap:
snap install packagename
To uninstall a package with snap:
snap remove packagename
Snapcraft is the tool for developers to create a snap package.
If you want to get more information about how to create a snap package, check out this external link.
Flatpak
Flatpak is developed by Red Hat.
It is the default standalone package manager for Fedora and Fedora-based distributions.
AppImage
AppImage was developed by Simon Peter.
Linux Packages
Linux packages:
- deb
- rpm
deb
deb is a package system used mainly in Debian and Debian-based distributions (such as Ubuntu).
rpm
rpm is a package system used mainly in Fedora and Fedora-based distributions.
Linux Package Repositories
Linux package repositories:
Ubuntu Software
Ubuntu Software is the package repository for Ubuntu.
AUR
Arch User Repository (AUR) is the repository used on Arch Linux.
It contains package descriptions (PKGBUILDs) that allow you to compile a package from source with makepkg.
You might also be interested in…
External References
- Chris Tozzi; “Ubuntu snap vs. apt: Which package manager to use and when“; TechTarget
- Jack Wallen; “Why Snap and Flatpak make Linux a better OS and how they’re different“; ZD NET