ArchLinux's Pacman command detailed __linux

Source: Internet
Author: User

Pacman is a package manager, as part of the ArchLinux release. In short, just like Apt-get to Ubuntu, Pacman is Arch's apt-get. To play the arch easily, it is necessary to learn to Pacman.
"The following is reproduced from: http://www.ha97.com/3459.html"
Pacman Package Manager is a big bright spot of ArchLinux. It draws on the advantages of other Linux versions of software management, such as the apt mechanism of Debian, the redhat yum mechanism, the yast of SuSE, and so on, which provides unparalleled convenience for installing software. In addition, because ArchLinux is an optimized distribution for the i686 architecture, it also helps to improve the efficiency of the software. Pacman can be said to be the basis of archlinux, because ArchLinux install very little software by default, and other software is installed using Pacman over the network. It combines a simple binary package format and easy to use build system. Pacman makes it possible to make simple management and custom packages, whether they come from the official Arch Software library or from the user's own creation. Pacman can be updated with the master server Synchronization package list, which makes it easy for security-focused system administrators to maintain their work.

To fully understand what Pacman can do, please read man Pacman. Here are just a few simple examples of Pacman operations.
  
Installing Packages
Install or upgrade a single package, or a list of packages (including dependent packages), using the following command:

Pacman-s package_name1 package_name2

Sometimes in different repositories, a package has multiple versions (such as extra and testing). You can choose one to install:

Pacman-s extra/package_name
pacman-s testing/package_name

Removing Packages
Delete a single package and keep all of its installed dependencies

Pacman-r package_name

Deletes the specified package and all dependencies that are not used by other installed packages:

Pacman-rs package_name

By default, Pacman backs up the deleted program's configuration files and adds them *.pacsave extensions. If you delete a package while deleting the corresponding configuration file (this behavior is called the purge purging in a Debian based system), you are using the command:

Pacman-rn package_name

Of course, it can also add the-s parameter to remove the current useless dependency. In this case, the command to really delete a package, its configuration file, and all dependencies that are no longer needed is as follows:

PACMAN-RSN package_name

Upgrade System
Pacman can use only one instruction to upgrade all installed packages in the system. The time to upgrade depends on how new your system is.

Pacman-su

Of course, the best thing to do is to synthesize the upgrade system and the synchronized warehouse data into a single instruction:

Pacman-syu

Query Package Database
Pacman can query packages in the package database, where the query location contains the name and description of the package:

PACMAN-SS Package

To query for installed packages:

PACMAN-QS Package

Once you have the full name of the package, you can get more detailed information about it:

Pacman-si Package
Pacman-qi Package

To obtain a list of files that are included in the installed package:

PACMAN-QL Package

You can also use the query database to find out what package a file in your file system is currently in.

Pacman-qo/path/to/a/file

To list all packages that are no longer dependent (orphaned orphans):

Pacman-qdt

Pacman uses the-Q parameter to query the local package database. See:

Pacman-q–help

... The-s parameter is used to query the database for remote synchronization. See:

Pacman-s–help

For more information, see Pacman Mans.

Other uses
Pacman is a very broad package management tool, and here is just some of its other key features.
• Download the package without installing it:

PACMAN-SW package_name

• Install a ' local ' package (not from the source):

Pacman-u/path/to/package/package_name-version.pkg.tar.gz

• Install a ' remote ' package (not from the source):

Pacman-u http://url/package_name-version.pkg.tar.gz

• Clean up cache of currently not installed packages (/VAR/CACHE/PACMAN/PKG):

Pacman-sc

• Fully Clean Package cache:

Pacman-scc

Warning: About PACMAN-SCC, just do this if you're sure you don't need to do any package demotion work. PACMAN-SCC removes all packages from the cache.
• To remove orphan packages (recursively, be careful):

Pacman-rs $ (PACMAN-QTDQ)

• Reinstall all packages in your system (existing in the warehouse):

Pacman-s $ (pacman-qq | grep-v "$ (PACMAN-QMQ)")

• Get a sorted list of local packages and their size:

Lang=c Pacman-qi | Sed-n '/^name[^:]*: (. *)/{S//1/;x};/^installed[^:]*: (. *)/{s//1/; h;x;s/n//;p} ' | Sort-nk2

To understand the more detailed parameter switches can be pacman–help or man Pacman.

Configuration
The Pacman configuration file is located in/etc/pacman.conf. Further information about the configuration file can be viewed in man pacman.conf.

Common Options
Common options are in the [Options] section. Read the man manual or check the default pacman.conf for information and purpose.
Skip Upgrade Package
If for some reason you do not want to upgrade a package, you can add the following content:

ignorepkg = Package Name

Skip Upgrade Package Group
As with software packages, you can skip upgrades to a package group like this:

Ignoregroup = Gnome

Note:
ArchLinux's version library includes:

Core-Core Package
extra-Other common software
community-community packages, such as MySQL.
testing-is in the beta phase and has not yet formally joined the source package. Usually the software version is newer, but not very stable.
Release-already released packages
unstable-Informal packages that may include previous versions of software or test software

Because Pacman software is updated from the source, the addresses of these software sources are configured in/ETC/PACMAN.D. In the/ETC/PACMAN.D directory, there are several software types corresponding to the file name, you can manually configure the address of these software sources.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.