Linux Software Installation rpm

Source: Internet
Author: User
Tags documentation gpg md5


RPM Package Overview

The program Manager is actually to organize the components of the compiled application (binaries, library files, configuration files, Help files) organized, packaged into one or several package files, you can complete or help install, upgrade, uninstall, query, check and other related operations.

The Package Manager content includes:

1, the package of the composition of the list (each program is implemented separately): file list, install or uninstall the script run,

2. The database is used by all program functions: Defines the name and version of each package, the dependencies between the reports, the function description, the file path that is generated by the installation, and the checksum information.

Linux Package Management three major mainstream:

DEBIN:DPT tool to package packages into files that are suffixed with ". Deb";

RATHAT:RPM (Redhat Package Manager) packs packages into files with ". rpm" suffix, and the RPM tool uses the C language card software.

s.u.s.e:rpm, the Rathat RPM tool is used for it.

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

VERSION:major.minor.release; (the release in version and the release in RPM are not a few moments)

The Release:release.os.arch in the RPM package represents the release number of the RPM package. OS represents the operating system used by Arch (archetecture): platform information such as x84_64 I386,PPC. Example: redis-3.0.2-1.centos7.x64.rpm


RPM Dependencies:

The most important feature of RPM is that the software you want to install is compiled first, and packaged into a RPM mechanism of the installation package, through the packaged software in the default database record this software must be installed when the dependency property software. When your Linux host installation, RPM will be based on the data in the software to query the Linux host dependency property software is satisfied, if satisfied to install, if not satisfied will not be installed. Because of this dependency of software, the following issues need to be noted:

    • The software installation environment must be consistent or equivalent to the environmental requirements at the time of packaging

    • Need to meet the software's attribute requirements

    • Anti-installation requires special care, the lowest software can not be deleted first, otherwise it may cause the whole system problem


Advantages of RPM:

    • RPM contains compiled programs and settings files and other data, can let users exempt from the problem of recompilation

    • RPM before being installed, will check the system hardware capacity, operating system version, etc., you can avoid the wrong installation of files

    • The RPM file itself provides the software version information, the dependency property software name, the software use description, the software contains the document and so on information, facilitates the understanding software

    • The RPM management method uses the database to record the RPM file related parameters, facilitates the upgrade, the deletion, the query and the verification

The path of RPM package acquisition:

    • Select the disc or official file server (or mirror site) of the system release

Http://mirrors.aliyun.com.

Http://mirrors.sohu.com.

Http://mirrors.163.com

http://apache.org/

Www.zabbix.com

    • Project official Site

    • Third-Party organizations:

A, EPEL:

B, search RPM package engine

http://pkgs.org

Rpmfind.net

Rpm.pbone.net

    • DIY, clothed

rpm Default installation path:         

/etc

directory where general configuration files are placed

/usr/lib

Dynamic library files used by the program

/usr/bin

Executable binary file

/usr/share/doc

Software user manuals and help documentation

/usr/share/man

Mans page File

RPM Command Manager on CentOS system: Software Installation, upgrade, uninstall, query and checksum, database maintenance, etc.

RPM Command:

RPM [OPTIONS] [Package_file]

-i,--install: Installation

-u,--update;-f,--freshen: Upgrade

-e,--erase: Uninstalling

-q,--query: Query

-v,--verify: Checksum

--BUILDDB,--INITDB: Database Maintenance

Installation:

RPM {-i} [install-options] pachage_file ...

RPM-IVH package_file.

Genral OPTIONS:

-v:verbose More information

-VV: More details

install-options

-h:hash marks output hash progress bar to see the installation progress (hash per # indicates 2% progress)

-test: Test installation, check for and report dependencies, conflict messages, etc.

--nodeps ignore dependencies and do not necessarily use

--replacepkgs: Reinstall

When you delete a configuration file by mistake, remove the source profile and reinstall the software to resolve it.

--NOSCRIPTS:RPM can be installed with four types of scripts:

-- nopre : Preinstall---The script that runs before the installation process starts,%pre

--nopost:postinsatll---The script that runs after the installation process is complete,%post

--nopreun:preuninstall---The uninstallation process really starts executing the script that was run before,%preun

--nopostun:postuninstall---The script that runs after the uninstallation process is complete,%postun

--nosignature: Does not check package signature information and does not check source legitimacy

--nodigest: Do not check package completion information

Uninstall:-E

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

--allmatche: Specifies that all versions of the matching name package be uninstalled

--nodeps: Ignoring dependencies

--test: Test Uninstall, do not really execute, Dru run mode

Query:-Q

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

Package_name: Queries whether the specified package is already installed and its version.

Select-options

-a,--all: Querying all installed Packages

Rpm-qa | grep "string"

-f,--file file: Queries which RPM package the specified files are provided by

-g,--group group: Specifying package groups

-p,--package Package_file: Performs a query operation on a package that is not installed.

RPM-QP Package_file

Rpm-qpl

Rpm-qpi

Rpm-qpc

Rpm-qpd

Rpm-qpr

--wahtprovides CAPABILITY: Indicates that the CAPABILITY specified by the query is provided by that package

--whatrequires CAPABILITY: Query which package the specified CAPABILITY is dependent on

[Query-options]:

--changelog: Query the Change log of RPM package

-l,--list: Lists all files generated by the installation RPM package.

RPM-QL SSH

-I,--Info: Query Package-related information, version number, size, package group belonging to ...

Rpm-qi Bash |less

-c,--configfiles: Querying the configuration file for the specified package

RPM-QC Bash

-D,--docfiles: Queries the supplied documentation for the specified package.

RPM-QD Bash

--provides: Lists all capability provided by the specified package

RPM-Q--provides Bash

-R,--requires: query for packages that the specified package depends on

--scripts: The script that the query package contains.

Checksum:-V

Rpm-v zsh

The RPM check content is as follows to get the file change information according to the prompt content.

S file Size differs

M Mode differs (includes permissions and file type)

5 Digest (formerly MD5 sum) differs

D Device Major/minor number mismatch

L Readlink (2) path mismatch

U User ownership differs

G Group ownership differs

T MTime differs

P capabilities differ

Database rebuild:

How can RPM-QL bash find information about bash installation? This is what the database does, and all the information about the installed RMP package is recorded in the database. The query operations of RPM are based on the database.

RPM Manager database path:/var/lib/rpm/

Query operation: through the database here;

CentOS 6 View Help information: Man rpm

CentOS 7 View Help information: Man Rpmdb

RPM {--INITDB|--REBUILDDB}

--INITDB: initializes the database. No database is currently present, but it is initialized, a new one is created, and no action is currently taken

--REBUILDDB: Rebuilding the database by reading the current RPM related information


The package comes from legitimacy, integrity verification:

RPM is a packaged installation package, the source code is open, installation time may be some bad guys change the settings inside, or inject the virus inside. How can we guarantee the reliability of the installation package? Here's a look at the legality checksum integrity check.

First, the RPM package maker will be after the RPM package is finished, using a one-way encryption algorithm to calculate the signature, with its own private key to encrypt the signature, and the signature code is encrypted and placed behind the package file. The user uses the RPM package, takes the producer's public key to decrypt the signature, calculates a characteristic value, which is the validation of the source legitimacy of the package, and the user takes the public key to calculate the package file with the same one-way encryption algorithm, and the signature is compared with the signature of the package file, if the two are consistent, The integrity of the package is valid. The above description can be used to indicate:

650) this.width=650; "title=" integrity source line checksum. jpg "src=" http://s2.51cto.com/wyfs02/M00/78/88/wKioL1Z_geGAmtWkAAtNnqkR1_ 0091.jpg "alt=" Wkiol1z_gegamtwkaatnnqkr1_0091.jpg "/>

RPM's public key:/media/cdrom/rpm-gpg-key-centos-6 (or local/etc/pki/rpm-gpg/rpm-gpg-key-centos-6) on the disc The local file is the public key of the RPM package when it is copied to the directory after the import operation. Manually import it into the system, and then install the software will not appear nokey error.

RPM--import/media/cdrom/rpm-gpg-key-centos-6

or rpm--import /etc/pki/rpm-gpg/rpm-gpg-key-centos-6

Verification: When you install a program that is signed by a secondary organization, the verification action is performed automatically;

Manual verification Method: Rpm-k Package_file

Cases:

[Email protected] packages]# rpm-k zsh-html-4.3.11-4.el6.centos.x86_64.rpm
Zsh-html-4.3.11-4.el6.centos.x86_64.rpm:rsa SHA1 (MD5) PGP MD5 OK

The above is the RPM installation method content, and so on what to try it yourself.















Linux Software Installation 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.