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

Installation and Management Command usage of Software package in Linux

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

Share

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

This article mainly explains the usage of installation and management commands of software packages in Linux. The explanation in this article is simple and clear and easy to learn and understand. Please follow the editor's ideas to study and learn the usage of installation and management commands of software packages in Linux.

Apt-get

Usage: apt-get [options] command

Apt-get [options] install | remove pkg1 [pkg2...]

Apt-get [options] source pkg1 [pkg2...]

Apt-get is a simple command line interface for downloading and installing software packages.

The most commonly used command is update (update)

And install (installation).

Command:

Update-get the package list again

Upgrade-updates are made

Install-install the new software package

Remove-remove package

Autoremove-automatically removes all unused software packages

Purge-remove packages and configuration files

Source-download the source file

Build-dep-configure compilation dependencies for source packages

Dist-upgrade-release upgrade, see apt-get (8)

Dselect-upgrade-update as selected by dselect

Clean-clear downloaded archive files

Autoclean-clear old downloaded archive files

Check-check for corrupted dependencies

Options:

-h this help file.

-Q output to log-No progress indication

-qq does not output information, except for errors

-d download only-do not install or extract archive files

-s is not actually installed. Simulate the execution of commands

-y assume that yes is selected for all queries and no prompts are made.

-f attempts to correct the system dependency damage

-m if the archive cannot be located, try to continue

-u also displays a list of update packages

-b compile after getting the source package

-V displays the detailed version number

-clockwise? Read this profile

-oops? Set custom configuration options, such as-o dir::cache=/tmp

Example:

The code is as follows:

Apt-cache search packagename

Search package

The code is as follows:

Apt-cache show packagename

Get information about the package, such as description, size, version, etc.

The code is as follows:

Apt-get install packagename

Installation package

The code is as follows:

Apt-get install packagename-reinstall

Reinstall the package

The code is as follows:

Apt-get-f install

Repair installation "- f =-- fix-missing"

The code is as follows:

Apt-get remove packagename

Delete package

The code is as follows:

Apt-get remove packagename-purge

Delete packages, including deleting configuration files, etc.

The code is as follows:

Apt-get update

Update sourc

The code is as follows:

Apt-get upgrade

Update installed packages

The code is as follows:

Apt-get dist-upgrade

Upgrade the system

The code is as follows:

Apt-get dselect-upgrade

Upgrade using dselect

The code is as follows:

Apt-cache depends packagename

Learn about using dependencies

The code is as follows:

Apt-cache rdepends packagename

Is to see which packages the package is dependent on

The code is as follows:

Apt-get build-dep packagename

Install the relevant compilation environment

The code is as follows:

Apt-get source packagename

Download the source code for the package

The code is as follows:

Apt-get clean

Clean up useless bags

The code is as follows:

Apt-get autoclean

Clean up useless bags

The code is as follows:

Apt-get check

Check for corrupted dependencies

Pacman

Pacman is a package manager as part of the ArchLinux distribution. It was first developed by Judd Vinet of Arch Linux. Pacman solves dependencies during installation and automatically downloads and installs all required software packages. The Pacman package manager is a highlight of Arch Linux. It combines a simple binary package format with an easy-to-use build system. Pacman makes it possible to easily manage and customize software packages, whether they come from the official Arch software library or user-created

The code is as follows:

[zhangy@BlackGhost] $pacman-h

Usage: pacman [...]

Action:

Pacman {- h-- help} / / help

Pacman {- V-- version} / / View version

Pacman {- D-- database} / / pacman Management Database options

Pacman {- Q-- query} [options] [package] / query installation package

Pacman {- R-- remove} [options] / / remove the installation package

Pacman {- S-- sync} [option] [package] / / install the installation package

Pacman {- U-- upgrade} [options] / / Update the installation package

Use 'pacman {- h-- help}' and an action to see the available options

The code is as follows:

[zhangy@BlackGhost] $pacman-D-- help

Usage: pacman {- D-database}

Options:

-- asdeps marked as a package that is not separately specified for installation

-- asexplicit marked as a separately specified installed package

-- config specifies another configuration file

-- logfile specifies another log file

-- noconfirm does not ask for confirmation

-- noprogressbar does not display a progress bar when downloading files

-- noscriptlet does not execute installation mini scripts

-v,-- verbose loop execution

-- debug displays debugging information

-r,-- root specify a different installation root directory

-b,-- dbpath specifies another database location

-- cachedir specifies another package cache location

-- arch sets another architecture

The code is as follows:

[zhangy@BlackGhost] $pacman-Q-- help

Usage: pacman {- Q-query} [option] [software package]

Options:

-c,-- changelog view the update log of a software package

-d,-- deps lists all packages installed as dependencies [filters]

-e,-- explicit lists all separately specified installed packages [filters]

-g,-- groups view all packages to which a package group belongs

-I,-- info view package information (- ii view backup files)

-k,-- check checks whether the files owned by the package exist

-l,-- list lists the contents of the queried software package

-m,-- foreign lists installed packages [filters] that were not found when synchronizing the database

-o,-- owns queries which software package has

-p,-- file queries from a software package rather than a database

-s,-- search searches for locally installed packages that match the specified string

-t,-- unrequired lists all packages that are not required by other packages [filters]

-u,-- upgrades lists all upgradeable packages [filters]

-Q,-- quiet displays less information when querying or searching

-- config specifies another configuration file

-- logfile specifies another log file

-- noconfirm does not ask for confirmation

-- noprogressbar does not display a progress bar when downloading files

-- noscriptlet does not execute installation mini scripts

-v,-- verbose loop execution

-- debug displays debugging information

-r,-- root specify a different installation root directory

-b,-- dbpath specifies another database location

-- cachedir specifies another package cache location

-- arch sets another architecture

The code is as follows:

[zhangy@BlackGhost] $pacman-R-- help

Usage: pacman {- R-- remove} [option]

Options:

-c,-- cascade removes software packages and all dependent packages

-d,-- nodeps skips dependency checking

-k,-- dbonly only deletes database records, not files

-n,-- nosave deletes configuration files at the same time

-s,-- recursive also removes (does not break the dependencies of other packages) (- ss also includes dependencies specified separately for installation)

-u,-- unneeded also removes unwanted (and does not break) dependencies of other software packages

-- print only prints the target and does not perform an operation

-- print-format specifies how to print the target

-- config specifies another configuration file

-- logfile specifies another log file

-- noconfirm does not ask for confirmation

-- noprogressbar does not display a progress bar when downloading files

-- noscriptlet does not execute installation mini scripts

-v,-- verbose loop execution

-- debug displays debugging information

-r,-- root specify a different installation root directory

-b,-- dbpath specifies another database location

-- cachedir specifies another package cache location

-- arch sets another architecture

The code is as follows:

[zhangy@BlackGhost] $pacman-S-- help

Usage: pacman {- S-- sync} [option] [software package]

Options:

-- asdeps is installed as a package that is not installed separately

-- asexplicit is installed as a separately designated installation package

-c,-- clean removes old packages from the cache directory (- cc clears all)

-d,-- nodeps skips dependency checking

-f,-force forced installation to overwrite conflicting files

-g,-- groups view all packages to which a package group belongs

-I,-- info view package information

-l,-- list view the list of software packages in the software library

-s,-- search queries the remote software library according to the specified string

-u,-- sysupgrade upgrade all installed packages (- uu enables downgrade)

-w,-- downloadonly downloads but does not install / upgrade software packages

-y,-- refresh downloads the new software package database from the server

-- needed does not reinstall packages that are already up to date

-- ignore a software package when upgrading ignore (can be used multiple times)

-- ignore a package group when upgrading ignoregroup (can be used multiple times)

-- print only prints the target and does not perform an operation

-- print-format specifies how to print the target

-Q,-- quiet displays less information when querying or searching

-- config specifies another configuration file

-- logfile specifies another log file

-- noconfirm does not ask for confirmation

-- noprogressbar does not display a progress bar when downloading files

-- noscriptlet does not execute installation mini scripts

-v,-- verbose loop execution

-- debug displays debugging information

-r,-- root specify a different installation root directory

-b,-- dbpath specifies another database location

-- cachedir specifies another package cache location

-- arch sets another architecture

The code is as follows:

[zhangy@BlackGhost] $pacman-U-help

Usage: pacman {- U-upgrade} [option]

Options:

-- asdeps is installed as a package that is not installed separately

-- asexplicit is installed as a separately designated installation package

-d,-- nodeps skips dependency checking

-f,-force forced installation to overwrite conflicting files

-k,-- dbonly add database records, do not install or keep existing files

-- print only prints the target and does not perform an operation

-- print-format specifies how to print the target

-- config specifies another configuration file

-- logfile specifies another log file

-- noconfirm does not ask for confirmation

-- noprogressbar does not display a progress bar when downloading files

-- noscriptlet does not execute installation mini scripts

-v,-- verbose loop execution

-- debug displays debugging information

-r,-- root specify a different installation root directory

-b,-- dbpath specifies another database location

-- cachedir specifies another package cache location

-- arch sets another architecture

Example 1:

(1)。 Install or upgrade a single package

The code is as follows:

Pacman-S mysql

(2) sometimes there are multiple versions of a package (such as extra and community) in different software repositories. You can choose one to install

The code is as follows:

Pacman-S extra/mysql

(3), step by step package database and install a software package

The code is as follows:

Pacman-Sy mysql

Example 2

Delete package

(1) remove a single package and retain all of its installed dependencies

The code is as follows:

Pacman-R mysql

(2) remove the specified package and all its dependencies that have not been used by other installed packages:

The code is as follows:

Pacman-Rs mysql

Example 3

Upgrade the system

The code is as follows:

Pacman-Syu

Example 4

Query package

Query available installation packages

The code is as follows:

Pacman-Ss mysql

To query installed software packages:

The code is as follows:

Pacman-Qs mysql

Example 5

Other uses

Clean up the cache of currently uninstalled packages

The code is as follows:

Pacman-Sc

Download the package without installing it

The code is as follows:

Pacman-Sw mysql

Thank you for your reading, the above is the content of "installation and management command usage of software packages in Linux". After the study of this article, I believe you have a deeper understanding of the installation and management command usage of software packages in Linux, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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