Computer literacy, help and repair

Which package manager is better with dependencies. Package Managers

We will be comparing different package managers in Linux. Between all Linux distributions, one of the things they share is the need to be able to install new software packages on the system. Depending on the distribution, various package managers are available, allowing the user to install, manage and remove packages quickly and easily. Package managers are very good at optimizing installations, with common installation locations and configurations. In this article, we'll discuss the various package managers available, which distributions they can be used on, and what makes each one unique. We'll cover package managers based on , the main RedHat Enterprise Linux (RHEL) package managers, and other custom package managers.

Debian - Based Package Managers

dpkg package manager

Ubuntu and Debian are considered to be one of the most widely used Linux-based consumer operating systems on the market today. Their package managers are generic, with the lowest level package management system "Dpkg", short for "Debian Package". It is a skeleton of package management software, with tools to install, remove, and build packages.

Dpkg lacks more advanced features - functionality such as downloading packages from the Internet, or installing dependencies automatically is not possible through DPKG. Being able to do this from the web is very useful as it allows users to add package repositories, which greatly increases the choice of software that can be easily installed on the system. It can also greatly simplify the software installation process by being able to easily find and install a package with just one command.

Pacman is the package manager for Arch Linux. Pacman is the only package management tool found on Arch, which makes it not a frontend. Arch Linux is an operating system release where updates are added every day. There are only a few pacman commands for finding, installing, and removing packages. This package manager can connect to the internet and purchase its packages from there, making it more user friendly. However, pacman is designed to install software from the Arch repository, which makes it impossible to install from third-party repositories.

ABS, short for Arch Build System, is a system of tools designed to create installable software packages for Arch Linux from source. It consists of several tools that work together to create packages - all of these tools are independent programs such as makepkg, pacman, asp, and so on. The method of creating/installing a package using ABS is different from a regular Linux distribution. Instead of installing precompiled packages, you need to create a PKGBUILD file from an Svn or Git branch using the asp package. From there, you use the makepkg command, which uses the PKGBUILD file to download and compile the source code for your system. This makes ABS a slightly less intuitive method of installing packages on Arch Linux. It has several other uses, such as customizing existing packages, or building and installing your own kernel.

This article is a stub. You can help the project by completing the article.

Synaptic is a graphical program that allows you to manage packages in Ubuntu. It combines all the features of the apt console package management system with the convenience of a graphical interface. With Synaptic, you can install, remove, configure, and update packages on your system, view lists of available and installed packages, manage repositories, and update your system to a new version.

Installation

Starting with Ubuntu 11.10 Synaptic is not distributed in the standard software package. You can install it by clicking on the link on the left or by entering the command in the terminal:

sudo apt-get install synaptic

Launch and appearance

Before starting the program, you will see a window in which you will need to enter your password in order to continue working with the application.

To launch Synaptic, open the Main Menu and search for synaptic . You can also start Synaptic by typing the following command in the terminal:

sudo synaptic

When you start you will see the main window of the program: Main menu at the top, a panel with several buttons, the role of which will become clear a little later.

On the left side of the screen at the bottom there are five buttons that determine what will be shown in the list above them, so you can select packages in the list by grouping them by status.

If you select All, you will see a complete list of available and installed packages. Clicking "Installed" will only show installed packages, and so on. The right part of the window is divided into upper and lower parts. A list of packages is displayed at the top, and when you select a package from the list, the package's details and description are displayed at the bottom.

Packages can be grouped by functionality (text editors, documentation, email clients, etc.). To do this, use the "Sections" button. After clicking on it, you will be able to select packages from various sections.

To get detailed information about a package, right-click on it and select from the menu that appears. Properties.

Software management

Installation

    Click the button Refresh

    Right click on the desired package and select from the menu that appears Mark for installation, or press Ctrl + I . If a package requires another package to be installed, then a dialog box will appear with the changes that will be made, if you really want to continue with the installation, then click on the button Apply or press Ctrl + P .

    To install, click the button Apply

Removal

    Right click on the desired package and select from the menu that appears select Mark for deletion.

    A dialog box will appear with the changes that will be made, if you really want to proceed with the removal, then click on the "Apply" button or press Ctrl + P .

    To uninstall, click the "Apply" button on the main panel of the Synaptic Package Manager.

If you mark a package with the "Mark for Clean Remove" marker, not only the package you selected will be removed, but all dependencies as well.

Update

    Click the button Refresh or press Ctrl + R to download a list of the latest software versions.

    Right click on the desired package and select from the menu that appears Mark for update.

    Apply on the main panel of the Synaptic Package Manager.

Whole system update

Synaptic provides two options for updating the system

    Smart Update will attempt to resolve package conflicts before updating the system. The smart upgrade action is similar to that of the apt-get dist-upgrade command.

    Standard update

    A standard update will only update those packages that do not require additional dependencies to be installed.

By default, ynaptic uses smart refresh. To change the system update method, open Settings→Options→General and select the desired method in System update.

    Click the button Refresh or press Ctrl + R to download a list of the latest software versions.

    Click on the button Mark for update or press Ctrl + G to have Synaptic mark all packages for upgrade.

    To update, click the button Apply on the main panel of the Synaptic Package Manager.

How to fix broken packages

"Broken packages" are packages that have unmet dependencies. If broken packages are found, then Synaptic will not allow any changes to the package system until all broken packages have been fixed.

To fix broken packages

    Select Edit→Fix Error Packages in the main menu.

    Select Make marked changes on the menu Edit or press Ctrl+P

    Confirm the changes by clicking on the button Apply.

Hotkeys in Synaptic

CommandKeyboard shortcut
Update list of available packagesctrl+r
Open search dialogctrl+f
Show a window with the properties of the selected packageCtrl+O
Mark selected package(s) for installationCtrl+I
Mark selected package(s) for updateCtrl+U
Mark selected package(s) for removalDelete
Mark selected package(s) for complete removalShift+Delete
Undo any changes in packagesCtrl + N
Mark all possible updatesctrl+g
Quick installation of a specific version for a packageCtrl+E
Undo last changeCtrl + Z
Redo last changeCtrl+Shift+Z
Apply all selected actionsctrl+p
Sign out of SynapticCtrl+Q

Configuring Package Caching

The package caching settings are in two places. The first is in synaptic itself, the caching settings window is called up through the menu Settings→Options→Files.

The cache is stored in a folder /var/cache/apt/archives/

    Store all downloaded files in the cache- the system will store all files downloaded from the repositories in the cache, according to the storage rules (see below).

    Delete downloaded files after installation- the system will delete files downloaded from the repositories immediately after they are installed.

    Only remove packages that are no longer available in the repository- the system will store all packages downloaded from the repositories, deleting only those that will be deleted in the repository according to the rules (see below).

    Clear cache- completely clears the cache.

In section History files settings for the storage time of the installation history are set, or the deletion of this history is disabled altogether.

The second place where caching settings are stored sets the rules for storing packages in the cache. In order to access these settings, run the following command in the terminal:

sudo nano /etc/apt/apt.conf.d/20archive

These settings look like this:

APT::Archives::MaxAge "30"; APT::Archives::MinAge "2"; APT::Archives::MaxSize "500";

It displays the maximum, minimum storage period of the package in days and the maximum cache size in megabytes. In this case, all packages older than 30 days will be removed even if the cache size is less than 500 MB, and no package less than 2 days old will be removed even if the cache size exceeds 500 MB.

One of the first things new users will encounter when choosing their Linux distribution is that there are several distributions with different ways of managing packages.

Package management is very important in Linux, if you know how to use several package managers, this is another aspect that shows that you are already an advanced user. Installing software, updating, handling dependencies, removing programs are very important activities for administering the linux operating system.

To become a more experienced linux user, you need to understand how the major distributions handle software packages. Therefore, the topic of today's article is an overview of linux package managers. We will consider only the best linux package managers.

The main goal is to provide basic information about these package managers, but only a few words will be said about their use.

1. DPKG - Debian Package Management System

Dpkg is Debian's base package management system. Can be used to install, remove, store and retrieve information about .deb packages.

This is a low-level tool and there are additional utilities that help users install packages from repositories, resolve dependencies, and search for packages by name. These are programs such as:

APT (Advanced Packaging Tool)

A very popular, powerful open source command-line package management tool that greatly enhances the capabilities of dpkg. This utility is used in Debian and its derivatives such as Ubuntu, Linux Mint.

Aptitude Package Manager

This is another popular command line utility for managing Debian packages. It works similar to Apt, but there are some differences between the two. It was originally developed for Debian, but is now available on Red Hat distributions as well.

Synaptic Package Manager

Synaptic is a graphical linux package manager written in GTK and using apt as its backend. It's great for users who don't want to work on the command line. It has all the same necessary functions as in apt.

2. RPM (Red Hat Package Manager)

This is the base format and package management system created by Red Hat. Like dpkg, it is a low-level tool for which there are several utilities, these are the linux package managers:

YUM (Yellowdog Updater, Modified)

It is a popular open source linux package manager for the command line. It is used to manage packages in the Red Hat distribution. When compared to the apt tool, it has all the same functionality, although it works a little slower. Written in Python 2. You can read a little more about the differences in the package format in a separate article.

DNF - Improved Yum

This is the linux package manager used in the Fedora distribution since version 18. It is the next generation of YUM.

At first it was created only for experimentation, but since Fedora 22 it has been used as the default package manager. It works almost the same as YUM, the libsolv library and hawkey are used to resolve dependencies, but unlike YUM, it is written in Python 3. Here you can observe an increase in speed, as well as a decrease in memory consumption.

3. Pacman - Arch Linux Package Manager

This linux package manager is developed by a team of programmers for the ArchLinux distribution. Now, besides ArchLinux, it is used by Manjaro and several other obscure distributions based on ArchLinux.

All the main features are supported here - software installation, automatic dependency resolution, updates, removal of packages, as well as downloading software packages for subsequent installation.

The program is specially designed for convenient work with packages in Arch Linux. And since it's a rolling release system, this package manager is the best fit. Pacman keeps the system up to date by synchronizing package lists from the main server. And there is only one version of the system - the current one.

The program is written in C, and tar.xz format files are used as packages, which are actually ordinary archives containing program files and a PKGBUILD installation description file.

4. Zypper - OpenSUSE package manager

It is a command line linux package manager for the OpenSUSE and SUSE Linux distribution. Developed specifically for this distribution and uses the libzypp library, which implements such common features as accessing the repository, installing packages, resolving dependencies, working with repositories and much more.

Zypper is written in C and is much faster than Yum. Supports various repository formats as well as repository extensions. Both a regular update and a patch update are supported, during which only patches are applied to installed packages to fix security problems.

5. Portage - Gentoo Package Manager

This package manager is used by Gentoo, a less popular but no less powerful distribution. And it is one of the best package managers. The main advantage of the Gentoo system is the ability to build packages from source at installation time. This gives a lot of useful things, such as the ability to set compilation flags, enable only the necessary functions, and also build packages specifically for your processor. All of this is supported by Portage, and basic functionality such as updating, removing packages, and resolving dependencies is also included.

An interesting feature is the Portage states, as well as slots that allow you to install multiple versions of the same program or library on your system. There is no list of packages as such, there is only a tree of ports, which contains ebuild files with instructions for building all packages. By saving the tree, you can very easily roll back the system to the previous version.

conclusions

As I said, the main purpose of the article is to review linux package managers, introduce users to the best package managers, and also show the differences between them. Of course, users of a particular distribution will have to study their package manager in more detail. If I missed an important point about one of the programs, write in the comments!

What is a package manager?

Package Manager keeps track of what programs are installed on your computer and allows you to easily install new programs, update programs to newer versions, or remove programs that you have previously installed. As the name suggests, package managers deal with packages- sets of files that are packaged together and can be installed or removed as a group.

Often, a package is just a standalone program. For example, an instant messaging client gaim is in the Debian package of the same name. On the other hand, it is quite normal for programs to consist of several interconnected packages. For example, a graphics editor gimp consists not only of the gimp package, but also of the gimp-data package; optional packages with add-ons (containing esoteric data, documentation, etc.) are also available. Several small related programs can be included in one package, for example the fileutils package contains several common Unix commands such as ls , cp etc.

Some packages require other packages to work. On Debian, packages can depend from other packages recommend, suggest, break them or to confront with them.

    If package A depends on another package B, then B is required for A to function correctly. For example, the gimp package depends on the gimp-data package because it must be ensured that the necessary data files are available to the GIMP graphics editor.

    If package A recommends another package B, then package B provides important additional functionality to package A that is desirable in most cases. For example, the mozilla-browser package recommends the mozilla-psm package, which adds support for secure data transfer to the Mozilla web browser. While the mozilla-psm package is not strictly required for Mozilla to function, most users want Mozilla to support the secure transfer of sensitive data (such as credit card numbers).

    If package A offers another package B, then package B provides functionality that can improve package A, but is not necessary in most cases. For example, the kmail package offers the gnupg package, which contains an encryption program that can be used by KMail.

    If package A conflicts with another package B, then the two packages cannot be installed at the same time. For example, the fb-music-hi package conflicts with the fb-music-low package because they provide alternative music sets for Frozen Bubble .

The job of a package manager is to provide an interface that assists the user in managing the set of packages installed on his or her system. aptitude provides such an interface based on the apt package management system.

Package managers make it easier to use someone else's code by providing this code in the form of independent modules - packages. These packages are connected to their code according to the principle of black boxes - this is when we don’t know and it doesn’t matter to us how everything works inside this box, but we know what it does. Thanks to this loosely coupled architecture, it becomes possible to easily update someone else's code or replace one package with another with similar functionality.

How package managers work

Each package manager has a settings file in which we need to specify which packages our code depends on, so that the package manager downloads and installs them into our system. However, each package can depend on other packages. The package manager unravels this dependency system and installs whatever it needs, which is why they are also called dependency managers. Here's an example: I'm using the Twitter Bootstrap framework for work and it needs jQuery to work. So if I tell my package manager to install Twitter Bootstrap, it will automatically install jQuery as well.

Which package managers to use

I use three different package managers in my work:

  • is a package manager for the PHP world. I use to load someone else's PHP code;

Similar posts