What package management does linux have?

11-17-2023

Designed for programming, automatic code writing robot, free to open. Today, Xiaobian will share with you some knowledge points about package management in linux. The content is detailed and the logic is clear. I believe most people still know this knowledge too well, so I share this article for your reference. I hope you will gain something after reading this article. Let's take a look at it together.

Eight kinds of common package management are: 1. DPKG, Debian package management system; 2. The package management system on apt, Debian and Ubuntu; 3. apt-cache, an apt software package management tool; 4. RPM, the package management system of Red Hat; 5. yum, a software package manager that exists to solve package dependencies; 6. DNF, a new generation of rpm software package manager; 7. pkg, the package manager used by FreeBSD by default; 8. Pacman, Arch package management system.

Operating environment of this tutorial: linux7.3 system and Dell G3 computer.

Most modern Unix-like operating systems provide a centralized mechanism for searching and installing software. Software is usually stored in a repository and distributed in the form of packages. The job of handling packages is called package management. Packages provide the basic components of the operating system, as well as shared libraries, applications, services and documents.

In addition to installing software, the package management system also provides tools to update the installed packages. The package repository helps to ensure that the code used in your system has been reviewed and that the installed version of the software has been approved by developers and package maintainers.

Most package systems are built around a collection of package files. A package file is usually an archive file, which contains compiled binaries and other resources of the software, as well as installation scripts. Package files also contain valuable metadata, including their dependencies and a list of other packages needed to install and run them.

Although the functions and advantages of these package management systems are roughly the same, the packaging formats and tools vary from platform to platform:

Operating system format tools debian.debapt, apt-cache,, DPKGubuntu.debapt, apt-cache,, dpkgcentos.rpmyumfedora.rpmdnffreebsdports, .txzpkg1, dpkg.

Dpkg is a package management system of Debian system, and the package suffix is. deb.

Dpkg is a tool for installing, creating and managing software packages under linux system. The installed software package is generally downloaded to the local software package, and the extension name is deb.

Format: dpkg parameter package.deb (beginners easily forget to put spaces between commands and parameters and between parameters and software packages, otherwise linux will not recognize them).

dpkg -i

Dpkg -i is a command used to install software packages under linux system.

Format: /home/ user name/desktop)/ # dpkg -i package.deb (At this time, the installation package is placed on the desktop, or it can be placed in other folders, and the terminal is opened in the folder or # dpkg -i/absolute path /package.deb).

dpkg -r

Dpkg -r is a command used to uninstall software packages under linux system. I recommend using it with the dpkg -l command, because the name of the uninstallation software is not necessarily the same as the name of the installation package when installing.

Format: # dpkg -r package (you can uninstall in any path)

Use the dpkg -l command to find the software that needs to be uninstalled, copy the software name (don't copy the software version together), and the copied software name replaces the package in the format.

dpkg -P

Dpkg -P is a command to uninstall a software package and delete its configuration file under linux system. You'd better use this command if you want to completely uninstall the software package. I have encountered the problem that the later version of the software could not be successfully installed because it was not uninstalled cleanly.

Format: # dpkg -P package (please refer to dpkg -r for usage)

dpkg -l

Dpkg -l is a command to view and list the currently installed software packages under linux system.

Format: # dpkg -l you can see all the installed software packages.

If you want to see a specific software, such as the software I installed in the company with the keyword gongsi.

You can use # dpkg -l grep | gongsi to see the installation package with gongsi keywords, where | is a vertical bar instead of the letter l.

2、apt

Apt is the abbreviation of Advanced Package Tool, which is a software package management system working on related linux distributions such as Debian, Ubuntu. Apt provides functions such as automatic retrieval, configuration and installation of software packages on Unix-like operating systems to simplify software management.

The commands apt, apt-get and apt-cache use the library to handle the software package. Apt can actually be regarded as the front end of dpkg, and it is more user-friendly than the previous dselect.

Apt integrates apt-get and apt-cache-these two commands have many functions but are usually not used, so apt retains common and important functions.

Common commands:

# Synchronize the latest software information from software sources and cache it locally. apt update  # Installs the specified package, and also installs other packages that it depends on.   apt install [package]  # Update the software version apt upgrade  # Find software. If you don't add parameters, you will show all the software packages. If you add keywords, you will search for the specified package. apt list zlib*  # List the installed software versions apt list --installed  # Name and description of keyword search software apt search zlib*  # Uninstall the package, but the configuration file will still be saved. apt remove [package]  # Uninstall the package and delete the configuration file apt purge [package]  # Uninstall the dependency of automatic installation due to installation software apt autoremove  # Delete all downloaded software packages apt clean  # Similar to clean, but the expired packages are deleted (that is, packages that can no longer be downloaded or are useless). apt autoclean

3、apt-cache

Apt-cache is an apt package management tool under linux, which can query the binary package cache file of apt. Most information query functions of APT package management can be realized by apt-cache command. By using apt-cache command with different subcommands and parameters, functions such as searching, displaying package information and package dependencies can be realized.

Common commands:

apt-cache show package_name # Displays the information of the specified software package, including version number, installation status and package dependencies. apt-cache search package_name # Search for software packages, you can search for software packages by keywords. Usually, the keywords used for query will use the name of the software package or part of the software package. apt-cache showpkg package_name # Displays the dependency information of the software package.  apt-cache stats # Displays the statistical information of data sources used by the current system, and users can use this command to view the relevant statistical information of data sources. apt-cache policy package_name # Displays the installation status and version information of the software package. apt-cache depends package_name # Displays the packages on which the specified package depends. When users need to know which other packages a package depends on, they can use apt-cache dependencies to query package dependencies. apt-cache rdepends package_name # Query the reverse dependency of the specified software package, that is, those other software packages need to rely on the software package you specified as a necessary condition for installation and operation. apt-cache dump # Displays a brief description of each package in the cache. apt-cache unmet # Show inconsistent dependencies.

4、RPM

RPM is a package management system of Red Hat, and the package suffix is. rpm.

RPM is the abbreviation of red-hat package manager. Although the name of this file format is marked with the symbol of RedHat, its original design concept is open, and now it has been adopted by distributed versions of Linux such as OpenLinux, S.u.S.E and Turbo Linux, which can be regarded as a recognized industry standard. A packaging and installation tool for Internet download packages, which is included in some Linux distributions. It generates files with the. RPM extension. Similar to Dpkg.

In short, it is a software package in linux.

Rpm packet composition

[1] Software name

[2] Version

[3] Applicable system

[4] System architecture

[5] Suitable for rpm system software

Rpm related commands and parameters

You can use the rpm command to process the rpm package software.

5、yum

Yum, the full name of Yellow dog Updater, Modified, is a software package manager that exists specifically to solve the dependency of packages. Just like Windows system can install, upgrade and uninstall software with one click through 360 software manager, Linux system also provides such a tool, namely yum.

It can be said that yum is an improved software manager for RPM, which solves the problem of software package dependence faced by RPM. Yum stores all RPM packages on the server side, and records the dependencies among the packages in files. When the administrator uses yum to install RPM packages, yum will first download the dependency files of the packages from the server side, and then download and install all related RPM packages from the server side at one time by analyzing this file.

Yum software can be installed by rpm command. Before installation, you can check whether yum is installed by the following command:

# rpm -qa | grep yum yum-metadata-parser-1.1.2-16.el6.i686 yum-3.2.29-30.el6.centos.noarch yum-utils-1.1.30-14.el6.noarch yum-plugin-fastestmirror-1.1.30-14.el6.noarch yum-plugin-security-1.1.30-14.el6.noarch

As you can see, yum is already installed on the system.

Yum is based on RPM package management, which can automatically download and install RPM packages from designated servers, automatically handle dependencies, and install all dependent software packages at once, without cumbersome downloading and installing again and again.

Yum provides commands to find, install and delete a certain, group or even all software packages, and the commands are concise and easy to remember.

Yum grammar

yum [options] [command] [package ...]

Options: Optional. The options include -h (Help), -y (when prompted by the installation process to select all "yes"), -q (do not display the installation process) and so on.

Command: the operation to be performed.

Package: the name of the installed package.

Yum common commands

1. List all updatable software inventory commands: yum check-update.

2. Update all software commands: yum update

3. Only install the specified software command: yum install.

4. Update only the specified software command: yum update.

5. List all the installable software list commands: yum list.

6. Delete package command: yum remove

7. Find the package command: yum search

8. Clear cache command:

Yum clean packages: clear the packages in the cache directory.

Yum clean headers: clear headers in the cache directory.

Yum clean oldheaders: clear the old headers in the cache directory.

yum clean, yum clean all (= yum clean packages; Yum clean oldheaders): clear the software packages and old headers in the cache directory.

6、DNF

DNF is a new generation of rpm package manager. He first appeared in the release of Fedora 18. Recently, it replaced yum and officially became the package manager of Fedora 22.

DNF package manager overcomes some bottlenecks of YUM package manager and improves many aspects including user experience, memory occupation, dependency analysis, running speed and so on. DNF uses RPM, libsolv and hawkey libraries for package management operations. Although it is not pre-installed in CentOS and RHEL 7, you can use DNF while using YUM.

Install DNF package manager

DNF is not installed in RHEL or CentOS 7 system by default, but Fedora 22 has used DNF by default.

1. In order to install DNF, you must first install and enable epel-release dependency.

Execute the following command in the system:

# yum install epel-release

or

# yum install epel-release -y

In fact, there is no reason to force the use of -y here. On the contrary, without using -y, users can check what is installed in the system during the installation process. But for users who don't have this requirement, you can use the -y parameter in YUM to automatically install everything.

2. Use YUM command in epel-release dependency to install DNF package. Execute the following command in the system:

# yum install dnf

Then, the DNF package manager is successfully installed in your system. Next, it's time to start our tutorial! In this tutorial, you will learn 27 commands for DNF package manager. With these commands, you can manage the RPM software package in your system conveniently and effectively. Now, let's learn 27 common commands of DNF package manager!

7、pkg

The default package manager used by FreeBSD.

8、Pacman

Pacman is a package management system of Arch. The new version of the package has the suffix pkg.tar.zst, while the previous version is pkg.tar.xz.

That's all the contents of this article about which packages are managed in linux. Thank you for reading! I believe that everyone has gained a lot after reading this article. Xiaobian will update different knowledge for everyone every day. If you want to learn more knowledge, please pay attention to the Yisu cloud industry information channel.

Ask AI for details

Copyright Description:No reproduction without permission。

Knowledge sharing community for developers。

Let more developers benefit from it。

Help developers share knowledge through the Internet。

Follow us