Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the basic beginnings of Linux package management

2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

What this article shares to you is about the basic introduction operation of Linux software package management, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article. Let's take a look at it.

Most modern Unix-like operating systems provide a centralized package management mechanism to help users search, install, and manage software. The software is usually stored in the warehouse "repository" in the form of "package". The use and management of the software package is called package management. The basic components of the Linux package are usually shared libraries, applications, services, and documents.

Package management is usually not limited to one-time installation of software, but also includes tools to upgrade installed packages. The package repository helps ensure that the code has been reviewed on the system you are using and managed by the software developer or package maintainer.

When configuring a Linux server or development environment, it is usually not limited to using official sources. Although the stable software packages used by official sources are likely to be out of date compared to today's rapid update iterations of software versions, mastering the basic operations of common Linux package management is a must-have skill for system administrators and developers.

Here will introduce the basic ways and quick references of common Linux distributions in package management such as search, installation and upgrade, which can help you quickly understand the basic operations and skills of different Linux package management.

Software package Management system: a brief introduction

Most package management systems are collections based on package files, which usually contain compiled binaries and other resources: software, installation scripts, metadata, and their required dependency lists.

Although most popular Linux distributions have more or less the same package management tools, methods, and forms, there are platform differences:

System format tools Debian.debapt, apt-cache, apt-get, dpkgUbuntu.debapt, apt-cache, apt-get, dpkgCentOS.rpmyumFedora.rpmdnf

The package format of Debian and its derivatives such as Ubuntu, Linux Mint and Raspbian is .deb file. APT is the most common package operation command, but search bases, installation packages and their dependencies and manage upgrades. To install the off-the-shelf .deb package directly, you need to use the dpkg command.

CentOS, Fedora, and Red Hat series Linux use RPM package files, and use yum commands to manage package files and interact with software libraries.

In the Fedora version of * *, the yum command has been replaced by dnf for package management.

Update the list of local package databases

Most Linux use a local database to store a list of remotely available package repositories, so update the database before installing or upgrading the package.

System command Debian / Ubuntusudo apt-get updateCentOSyum check-updateFedoradnf check-update

Upgrade installed packages

In the absence of package management, it is a huge project to upgrade and keep the installed version of Linux software at *, and administrators and users have to manually track upstream software version changes and security warnings. With the package management system, it only takes a few commands to maintain the software.

The system command notes that Debian / Ubuntusudo apt-get upgrade only upgrades installed packages sudo apt-get dist-upgrade can add or remove packages to meet new dependencies. CentOSsudo yum updateFedorasudo dnf upgrade

Find / search for software packages

Most Linux desktop versions provide an interface for users to search for and install software packages, which is a way to find and install software. But for efficiency and server administrators, using command-line tools to find / search for software packages is the right way.

The system commands Debian / Ubuntuapt-cache search search content CentOSyum search search content yum search all search content search all content, including package description. Fedoradnf search search content dnf search all search content searches everything, including package descriptions.

View a package information

We often need to see a detailed description of the package before deciding which package to install. The description file of the package usually includes metadata such as package name, version number and dependency list, which can be viewed using the following command.

System command remarks Debian / Ubuntuapt-cache show package name displays local cache information about the package dpkg-s package name shows the current installation status of the package CentOSyum info package name yum deplist package name since the Fedoradnf info package name dnf repoquery-requires package name is listed

Install the package from the software repository

Once we know the name of a software package, we can install the package from the software repository using the following command.

System command remarks Debian / Ubuntusudo apt-get install package name sudo apt-get install package 1 package 2. Install all listed package sudo apt-get install-y package names without prompting to install CentOSsudo yum install package name sudo yum install package 1 package 2 … Install all listed package sudo yum install-y package names without prompting to install Fedorasudo dnf install package name sudo dnf install package 1 package 2 … Install all listed package sudo dnf install-y package names without prompting to install directly

Install the package directly from the local file system

In many cases, we need to install the package directly from the local file system after testing or getting the package directly from somewhere. Debian and derivative systems can be installed using dpkg, and CentOS and Fedora systems can be installed using yum and dnf commands.

System command remarks Debian / Ubuntusudo dpkg-I package name.debsudo apt-get install-y gdebi&& sudo gdebi package name.deb uses gdebi to retrieve the missing dependency CentOSsudo yum install package name.rpmFedorasudo dnf install package name.deb

Remove installed packages

Because the package manager knows which files are provided by which package, you can usually get a clean system after uninstalling unneeded packages.

The system commands Debian / Ubuntusudo apt-get remove package name sudo apt-get autoremove automatically removes known unneeded package CentOSsudo yum remove package name Fedorasudo dnf erase package name the above are the basic introductory operations of Linux package management, the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report