An overview of Linux package managers. Package managers on linux systems Which package manager is better to use

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

Synaptic- this is graphics program, which allows you to manage packages in Ubuntu. It combines all the features of the apt console package management system with the convenience of GUI. 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

Since Ubuntu 11.10 Synaptic is not bundled standard programs. 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 further work with 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 full list 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, mail clients etc.). To do this, use the "Sections" button. After clicking on it, you will be able to select packages from various sections.

For getting detailed information about the package, right-click on it and select 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 the package with the "Mark for complete removal” then not only the package you selected will be removed, but also all dependencies.

Update

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

    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

TeamKeyboard 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
Select all possible updates ctrl+g
Quick installation package specific versionCtrl+E
Cancel last change Ctrl + 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 chapter 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 maximum size cache in megabytes. In this case, all packages older than 30 days will be deleted even if the cache size is less than 500 mb, and no package less than 2 days old will be deleted even if the cache size exceeds 500 mb.

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;

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 packages. software into 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 will cover package managers based on , the main RedHat package managers Enterprise Linux(RHEL), 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 release operating system 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 code. 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.

Greetings, Dear friends, acquaintances and other personalities.

As you probably know and remember, I promised to slowly (at your request) cover the Linux cycle, introducing you to different basics and very gradually flowing from theory to practice.

Today we will continue the topic of acquaintance with the theory and basics for the time being, and therefore we will talk about such a thing as repositories and everything connected with them, i.e. Let's figure out how the software looks like from the inside in Linux, how it's all stored and all that stuff.

All this huge pile of packages with their heap of dependencies on each other, managed by the package manager, just makes up your Linux distribution. But this is not just a pile of garbage, but an ordered system called - ta-dam! - repositories of software packages. The circle is closed - we are back to the first concept - what is a repository :)

A few words about nuances

Finally, I still want to say that no matter how Linux is stable, stable and indestructible, the user must still adhere to certain caution. For example:

  1. There is no need to tempt fate and put programs in Linux bypassing the package manager, by simple compilation. They will work, but the package manager will not know anything about them, which is why when you update the system or programs, you risk getting more problems on your head than imagine. Install programs only as packages.
  2. It is not necessary to connect those repositories about which you have a very vague idea. For example, it is not necessary to connect repositories with the words testing , debug and similar terms, because these repositories are primarily intended for the distribution developers themselves and are far from always stable.
  3. Do not connect all available repositories in a row, this can also play a trick on you. Connect only the most necessary, no need to be greedy :)

For example, when installing the Fedora operating system, two repositories are immediately connected by default:

  • Fedora (packages that fit any combination of CDs or DVDs)
  • Updates (updated packages, newer than the Fedora repository)

For normal operation, you need to connect an additional rpmfusion repository (you really cannot do without it), which will give access to programs that could not be included in the distribution due to licensing restrictions (applications that are required for, such as mp3 , dvd, etc.). - these include proprietary drivers for ATI and NVIDIA; games: Bub's Brothers, Secret Maryo Chronicles, UFO: Alien Invasion, Wörms of Prey, xrick, GLtron and many, many others; emulators: Commodore 64 emulator, as well as Commodore 8 bit, Amiga emulator, Nestopia, ZSNES and many others). To connect this repository, it is enough to enter the commands in the command line (terminal) from the superuser () :
$ sudo rpm -ivh https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
$ sudo rpm -ivh https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

Note that the rpmfusion repository is split into two parts: free and nonfree . The first contains pure free software within the meaning of the FSF, distributed under the GPL and its compatible licenses. The contents of the second, contrary to the name, are also mostly free programs, but fall under the notorious patent restrictions of some states (for example, audio and video codecs).

The same goes for the Fedora package manager. For normal and convenient operation package manager (yum) in Fedora, it is recommended to include an additional fastestmirror plugin. This plugin is very important: it does not just detect the nearest mirror, as similar utilities from other package management systems do, but installs exactly the fastest mirror in this moment- by response time.
$ sudo yum install yum-plugin-fastestmirror
Something like this in a nutshell :)

Afterword

I understand that without practice it is quite difficult to perceive all this on the fly, but there is nothing to do - this is the most initial and basic theoretical information with which each user must be familiar at least somehow in order to have an idea of ​​what is what and why, and do not blindly poke buttons and read unfamiliar terms.

In the following articles, we will look at what exactly is installing packages on Linux, how it works in this operating system, what is meant by the user (and who is the superuser, he is also root), and we will also talk about programs and something else. Stay with us.

As always, if there are any questions, additions, and so on, I will be glad to see them in the comments to this material.

P.S. Thanks to a member of the Pantera team for the existence of this article

Sometimes the question may arise: whose file is this, where did this library come from? A handy package manager solves a lot of OS problems. It's safe to say that if you make friends with MP, you make friends with the distribution itself. Moreover, it is important to master the set of basic commands, and to know where to find additional information.


This is followed by a gentleman's set of commands of the main Linux distributions necessary for the daily routine: install, update and remove the package, roll updates, check dependencies, set the file belonging to the package, etc.

Debian and related

Popularity and user-friendly image Linux distribution played a cruel joke with Ubuntu. Some newbies feel like they can do whatever they want without help. command line. This is a delusion and it is better to get rid of it as soon as possible.


Just because aptitude is in the examples doesn't mean it's better than apt-get . For me, it's just a matter of habit.


$ aptitude install package #install package; $ aptitude safe-upgrade package #upgrade package; $ aptitude update #check and install updates; $ aptitude remove package #remove a package; $ aptitude purge package #remove the complete package, all data and settings; $ apt-get dist-upgrade #upgrade OS, killer-feature and it works! $ aptitude search package #search for a package. $ apt-cache depends package #package dependencies; $ apt-cache rdepends package #reverse dependencies on a package.

Some features are available with the optional dpkg mp.


$ dpkg -l #list installed programs; $ dpkg -L package #list package files
Internet