My Learning Record--linux (CentOS) program installation package management, RPM

Source: Internet
Author: User

Overview:

Because an application is made up of many files, it is very complex to load and unload, in order to make it easier for users to manage applications. So the introduction of program packaging management. Mainly include: installation, uninstall, upgrade, query, inspection.


Common Package Manager:

. Deb:debian Research and development

. rpm:red Hat Development (common standard for Package Manager on Linux, so I learned rpm)


Common CPU Platforms: (so choose the application to install, you must choose the version that matches your CPU)

X86:i386, i486, i586, i686

x86_64:x86_64, AMD64


Subcontracting mechanism:

Core Package: Main package, main program.

Child Package: A package that adds additional functionality to a program.


Package Acquisition Path: (be sure to get packages in the regular channel)

1, the system's release disc image or the official site (or mirror server)

Recommended Sites:

Http://mirrors.sohu.com

Http://mirros.163.com

Http://mirros.aliyun.com

2. The official site of the package

3. Trusted third-party organizations

4. Package Search engine

Recommended Sites:

Http://rpmfind.net

Http://rpm.pbone.net

---------------------------------------------------------

Prepare the lab environment:

1. Prepare the CentOS6.6 virtual machine

2. Mount the CentOS6.6 system CD DVD1

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5E/1C/wKiom1UpJ-eAnCRYAAB3H-ruDWU654.jpg "title=" 1.jpg " alt= "Wkiom1upj-eancryaab3h-rudwu654.jpg"/>


RPM Command:


Installation: (Install a new package)

rpm-i [install-options] package_file1 ...

-h:hash, with # to indicate installation progress

-V: Displays detailed information during installation

-VV: Details

-VVV: More details

--test: Do not perform a real installation process, but only report dependencies and conflicting information

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5E/1C/wKiom1UpKsvA2r-MAADBndXvUUg148.jpg "title=" 2.jpg " alt= "Wkiom1upksva2r-maadbndxvuug148.jpg"/>

There is a dependency between packages: Because packages are made up of a number of small, single-purpose programs that result in dependencies between them, sometimes when you install a program, it prompts you for missing packages. As follows:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5E/1C/wKiom1UpLFSiJGMlAAEB27aMqBI531.jpg "title=" 3.jpg " alt= "Wkiom1uplfsijgmlaaeb27amqbi531.jpg"/>

--nodeps: Ignore dependencies (can be installed successfully, but not necessarily run)

--replacepkgs: Overwrite the installation (reinstall and overwrite the original file)

--force: Forced installation

Upgrade: (Upgrade a package that is already installed)

RPM {-u|--upgrade} [install-options] package_file ...

-U: Upgrade or install (upgrade if installed, install if not installed)

RPM {-f|--freshen} [install-options] package_file ...

-F: Upgrade only

-v,-h,--Test,--nodeps,--Force common options usage Ibid.

--oldpackage: Downgrade to old version

Note:

1. Do not upgrade the kernel!

2. Generally, the upgrade will not overwrite the user's modified configuration file, the new profile name will be appended with the suffix (rpmnew) to save


Uninstall: (remove installed packages)

RPM {-e|--erase} [--allmatches] [--nodeps] [--test] package_name ...

Rpm-e package_name ...: Uninstall, simple usage

--nodeps: Ignoring dependencies

--test: Uninstalling the test

--allmatches: If multiple versions of a package are installed, uninstall all versions

Note: If the package configuration file has been modified, the configuration file is not deleted when uninstalled, and the suffix (rpmsave) will be saved


Enquiry: (query whether a package is installed, and check all packages installed to see a package information)

RPM {-q|--query} [select-options] [query-options] package_name ...

[Select-options]:

1. Query whether a package or some packages are installed

Rpm-q package_name ...


2. Query all packages that have been installed

Rpm-qa

3. Query which package the file is generated from (for example: Inittab This file is generated by initscripts this package)

Rpm-qf/path/to/somefile

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5E/18/wKioL1UpNouzGl11AABTiTjVO4w984.jpg "title=" 4.jpg " alt= "Wkiol1upnouzgl11aabtitjvo4w984.jpg"/>

4. Query for information about package files that have not yet been installed

Rpm-p (typically combined with the following options)

-PQI package Brief information not installed

-PQC the configuration file generated by the package is not installed

-PQL list of files that are not installed package will be generated

[Query-options]:

1. Query the brief description information of a package

Rpm-qi package_name

2. Querying a list of files generated by a package installation

RPM-QL package_name

3. Query the configuration file generated after a package installation is complete

RPM-QC package_name

4. Query the Help file generated after a package installation is complete

RPM-QD package_name

5. View the program history version and the revised information

Rpm-q--changelog Package_name

6. Query the capabilities (function, capability) provided by a package

Rpm-q--provides Package_name

7. Query the capabilities on which a package depends (query dependencies)

Rpm-q--requires Package_name

8. Query the script that executes when a package is installed or uninstalled

Rpm-q--scripts Package_name


Checksum: (whether the files generated by the query package installation have changed)

RPM {-v|--verify} [select-options] [verify-options]

common usage:rpm-v package_name

S File size differs change

M Mode differs (includes permissions and file type) permissions change

5 Digest (formerly MD5 sum) differs content changes

D device Major/minor number mismatch change

L Readlink (2) path mismatch

U User ownership differs owner

G Group ownership differs

T MTime differs modified time

P capabilities differ

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5E/28/wKiom1UpRNLzGXxZAAA1UE9DLQw409.jpg "title=" 6.jpg " alt= "Wkiom1uprnlzgxxzaaa1ue9dlqw409.jpg"/>


Verification of the validity of the package:

SOURCE valid:

provided by our trusted creators

dependent on: The digital signature of the creator; The signature is performed by the author using his own private key cryptographic package;

Content Legal:

The package has not been modified two times; Integrity Check succeeded

dependent on: The program signature provided by the creator:

Authentication Method: The installer uses a common signature extraction algorithm to extract the signature of the package and compare it with the original one, and if it is the same, the content is legal;

verify the source and integrity of the packages on their CDs:

Import Public key: Rpm-import/path/to/rpm-gpg-key-file

Verify: RPM {-k|--checksig} package FILE

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5E/2B/wKiom1UpS-CTKlNVAAFnwE1gr3Q034.jpg "title=" 8.jpg " alt= "Wkiom1ups-ctklnvaafnwe1gr3q034.jpg"/>

--nosignnature: Does not check the legitimacy of the source

--nodigest: Do not check integrity

RPM Manager database:/var/lib/rpm (each program installed, the installation information will be stored in this directory)

Rebuild the database:

--INITDB: Initialize the database, that is, the database does not exist at all, can be new;

--REBUILDDB: No matter the current data exists, the library will be rebuilt directly;


This article is from the "Linux" blog, so be sure to keep this source http://laoliao.blog.51cto.com/10027070/1631415

My Learning Record--linux (CentOS) program installation package management, RPM

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.