RPM Package Management

Source: Internet
Author: User
Tags gpg sha1

First, the procedure:


1. Compiling process: pre-compiling, compiling, compiling, linking.

Edit: Translates the source code into a CPU instruction set.


2, Api:application programming Interface, application programming interface.


3, Abi:application binary Interface, Application binary interface (binary file to run the file).


Components of the package:


1. Binary Program:/bin,/sbin,/usr/bin,/usr/sbin,/usr/local/bin,/usr/local/sbin

Configured through environment variables.

2, library files: for two times for development, such as the current browser.

/lib,/lib64,/usr/lib,/usr/lib64,/usr/local/lib,/usr/local/lib64

Library file configuration file:/etc/ld.so.conf,/etc/ld.so.conf.d/*.conf

Header file/etc/include

#ldd命令: Used to view the shared libraries on which the application depends.


such as: #ldd ' which cat '


3. configuration file:/etc

4. Help file:/usr/share/man


Note: If you install the program to a specific specified path such as:/usr/local/nginx,

The paths for binaries, library files, configuration files, and Help files are:

Binary program:/usr/local/nginx/bin,/usr/local/nginx/sbin

Library:/usr/local/nginx/lib,/usr/local/nginx/lib64

Header file:/usr/local/nginx/include

Configuration file:/usr/local/nginx/etc or/usr/local/nginx/conf

Help file:/usr/local/nginx/man


Third, the man command itself configuration file:/etc/man.config



Four, RPM package:

1, RPM Package name format:

SOURCE program: Name-version.tar. {GZ|BZ2|XZ}

Version:major.minor.release

RPM Package: name-version-release.arch.rpm

Release: The hairstyle number for the Distributor

Arch: Using the platform 32-bit/64-bit

X86_64,i386,i586,i686,noarch

such as: bash-4.3.3-2.el6.x86_64.rpm

El6:redhad Enterprise Linux 6

such as: bash-4.3.3-2.centos5.x86_64.rpm

Centos5:centeros5


2. Basic functions of Package Manager:

Packaged

Installation

Inquire

Upgrade

Unloading

Check

Database management

3. Verification of source legitimacy:

SOURCE program: Verified by MD5 or SHA1 checksum code.

RPM Package: The legitimacy provided by publishers is credible.

Verifying package Integrity: Check code

Verify the source is legitimate: public key


4. Get the path of the RPM package:

A, the publisher's CD-ROM or site

Take CentOS for example:

Http://mirrors.163.com

Http://mirrors.sohu.com


B, Http://rpmfind.net


C, Http://rpm.pbone.net


5, RPM Package installation:

A, #rpm-IVH ***.rpm

-i:install

-V: Installation Information

-H: Progress bar to # Display


B: #rpm-ivh--test ***.rpm


--test: Tests only and does not actually perform the installation process.



C, when installing, how to solve the dependency relationship?


Ignore dependencies:--nodeps (note may be installed, not available)

#rpm-IVH--nodeps ***.rpm


Try to install the dependencies, this is more cumbersome.


D, reinstall: #rpm-IVH--replacepkgs ***.rpm


6, RPM Package Uninstall:


A, #rpm-e,--Erase Package_name


B, if uninstalled, by other programs rely on the solution:

To unload the dependent persons together;

ignoring dependencies;--nodeps


7, RPM Package query:


A, #rpm-Q package_name: Query whether a package is installed.


B. Query all installed packages:

#rpm-qa


-a:all


C, the query package description information:

#rpm-qi Package_name

-i:info

such as: #rpm-qi bash


D. List of files generated after query package installation:

#rpm-QL Package_name

-l:list

such as: #rpm-QL bash


E, query the configuration file generated after package installation:

#rpm-QC Package_name

-c:conf


F, query which installation package the file is generated from:

#rpm-qf/path/to/somefile


G: Query package-related scripts:


#rpm-Q--scripts package_name


There are four types of scripts:

Pre-installation script: Preinstall


Post-installation script: Postinstall


Pre-uninstall script: Preuninstall


Post-uninstallation script: Postuninstall


H: Query the help document that was generated after the package was installed:


#rpm-QD Package_name


-d:documents


I,-P option: query for information about RPM package files that are not yet installed, commonly used as follows:

Query the list of files generated after installation:

#rpm-qpl/path/to/package_file

Query its simple description information:

#rpm-qpi/path/to/package_file


8, RPM Package Upgrade:


#rpm-U: Upgrade or install


#rpm-F: Upgrade


Format: #rpm {-UVH|-FVH}/path/to/package_file


--nodeps: Ignore dependencies

--force: Forced installation


Note: Do not upgrade the kernel.

Multiple versions of the kernel can coexist, so it is recommended to perform installation operations on the kernel.

9, RPM Package Verification: Check the package after the installation of the generated files have been modified.


#rpm-V Package_name


-v:verify


such as: Rpm-v zsh, no message stating that has not changed.


10, RPM package check the source legitimacy and package integrity.


A, packet integrity: usually one-way encryption mechanism (MD5|SHA1)

B, the legitimacy of the source: public key encryption Mechanism (RSA)

#rpm-K/path/to/package_file


Note that before execution, the public key of the creator is imported, and the public key of the CentOS distribution is in the ISO file

Import command: #rpm--import/path/to/gpg-key-file

Such as:

#rpm--import rpm-gpg-key-centos-6

#rpm-K zsh-4.3.10-7.el6.x86_64.rpm


10, RPM Package Database reconstruction:


A, database location:/var/lib/rpm


B, #rpm--initdb: Initialize, new if not previously present, or overwrite if present.


#rpm--rebuilddb: Rebuilding, rebuilding the database directly, overwriting the original library.



Summary: Installing applications with RPM packages, the biggest problem is the dependency relationship.


RPM Package Management

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.