1. Linux Package Management

Source: Internet
Author: User

There are two kinds of Linux package management: RPM Package Management and source package management, in which RPM package management has two ways: ①rpm command management, ②yum Online command management.

RPM Package dependencies:

1, tree-type dependence

2, ring-dependent (with a command at the same time to solve)

3, the module relies on, the module relies on the query URL www.rpmfind.net. For example, when installing an rpm package, you need to rely on module libodbcinst.so.2to resolve the steps: rpmfind Locate the RPM package where the module is located , and then install the package.

Difference between "package full name" and "Package name"

1, Package full name: mysql-5.1.73-7.el6.x86_64.rpm, corresponding package name:MySQL

2, use the full name of the package: the operation of the package has not been installed, using the package full name. For example, installation and upgrade operations.

3, using the package name: the operation of the package has been installed, using the package name, it will search the database in the/var/lib/rpm/. For example, query and unload operations.

One, RPM package Management--rpm Command management:

Installation:RPM-IVH Package full name

Options:

-I installation( install )

-V Show more information (verbose)

-H Display Progress (hash)

--nodeps does not check for dependencies (resulting in missing features)

Upgrade:RPM-UVH Package full name

Options:

-U Upgrade (upgrade)

Uninstall:rpm-e Package name

Options:

-E Offload (erase)

--nodeps does not check for dependencies

query: RPM-QA// Check out all installed rpm packages

Rpm-q Package name // query package is installed

Rpm-qi Package name // query for installed software information

RPM-QIP Package Full name // query does not install package information

RPM-QL Package name // Query package file installation location

RPM-QLP Package Full name // query rpm package where to install the files

RPM-QF System file name // query system files belong to which rpm package

RPM-QRP Package Full name // query package dependencies

Options:

-Q queries (query)

-A All

-I software information (information)

-P not installed packages (Package)

-L Package File installation Location list

-F System file belongs to which package (file)

-R software package dependencies (Requires)

checksum:rpm-v installed package name

Options:

  - v Verify the specified RPM files in the package ( Verify )

Check output 8 information bits, if the corresponding item changes, then use point display:

S file size is changed

M file type or file permissions (rwx) have changed

5 The MD5 checksum of the file is changed

D Equipment

L file path is changed

does the owner of the U file change

whether the group G file belongs to change

T file modification time changed

File type: the

C Profile (configfile)

D Ordinary file (documentation)

G "Ghost" file, rarely seen, is that the file should not be included in this rpm package

L Authorization Document (licensefile)

R profile (Read Me)

file extract:Rpm2cpio Package full name | Cpio-idv . The absolute path of the file // Note the point here. " "Will rpm The files in the package are extracted into the current directory

Description

Rpm2cpio convert rpm package to cpio Format command

Cpio is a standard tool for creating software archive files and extracting files from archive files

Cpio Options < [ file | Equipment ]

Options:

-I: copy-in mode, restoring

-D: Automatically create a new directory when restoring

-V: Displays the restore process

File Extraction Command Use example: Join me to the system /bin/ls command mistakenly deleted, how to restore?

①rpm-qf/bin/ls// query which package the LS command belongs to (another machine, or online)

②Rpm2cpio coreutils-8.22-15.el7.x86_64.rpm | Cpio-idv./bin/ls // extracting ls into the current directory

③CP./ls/bin/// Copy the extracted ls file to the /bin/ directory

Second, RPM package Management--yum Command management:

network Yum Source profile (used by default): /etc/yum.repos.d/centos-base.repo

[Base] container name, must be placed in [] in

Name container description, you can write your own

Mirrolist Mirror site, this can be commented out

BaseURL Yum source server address. The default is the official CentOS yum source server, which can be replaced by other yum sources

Enabled If this container is in effect, if it is not written or written "enable=1" is effective, written as "enable=0" does not take effect

Gpgcheck 1 The digital certificate of the specified RPM takes effect and0 does not take effect

Gpgkey the public key file where the digital certificate is stored. Without modification.

query:yum list// to the Web server to query all available rpm Resources

Yum Search keyword // Search all and keyword-related packages on the server

Installation:yum-y install package name // installation, auto answer Yes

Upgrade:yum-y update package name // Note: If there is no package name, all software, including the kernel, will be upgraded. Use caution to upgrade all.

Uninstall:yum-y Remove package name // Uninstall. Note:yum uninstalls all dependent packages and is most likely to unload the common dependency package or even the system dependency package. Server installation principle, minimize installation, do not install redundant software, without yum uninstall .

Yum software Group management:

Query group:yum grouplist// list all available groups

installation Group:yum-y groupinstall "software group name"// installation Group

Uninstall Group:yum-y groupremove "software group name"// uninstall specified software group

Disc Yum Source setup steps:

① Mounting Discs

mount/dev/cdrom/mnt/cdrom/

② make the network yum source file Invalid (enable=0, the convenient Way is "renaming",yum source is by detection " . Repo"suffix to read the configuration file)

cd/etc/yum.repos.d/

MV Centos-base.repo Centos-base.repo.bak

MV Centos-debuginfo.repo Centos-debuginfo.repo.bak

MV Centos-vault.repo Centos-vault.repo.bak

③ Modifying the disc yum source file ( Note that the configuration file should be strictly in the default format)

Configure baseurl=file://Absolute path//such as:File:///mnt/cdrom

Use enable=1to make the file effective

Three, source package management:

Generally speaking, including "Configuration" "Compile" "Install", after getting a source package, generally open its "install" or "README" file, there will be related to the compilation installation instructions.

1. Linux Package Management

Related Article

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.