Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ RPM package management tools under Linux     - Heartbeat (v1, v2, pacemaker) cluster components Overview (Server)

- How to configure Apache Solr on Ubuntu 14/15 (Server)

- command-line tool for send e-mail (Linux)

- Oracle 11R2 Grid Infrastructure execute root.sh script rootcrs.pl execution failed treatment (Database)

- Understanding Linux firewall Iptables (Linux)

- Linux source code analysis tool (Linux)

- Ubuntu amend resolv.conf restart failure problem (Linux)

- Linux, Firefox unloading and installation and upgrade (Linux)

- How to forcibly change the Linux system password on a regular basis (Linux)

- Lenovo E431 notebook CentOS system is installed wireless network card driver (Linux)

- Linux security settings Notes (Linux)

- Linux account management add relevant directives (Linux)

- Linux development environment to build and use the directory structure and file --Linux (Linux)

- Intel Graphics Installer 1.0.3 released, support for Ubuntu (Linux)

- MySQL and Oracle time zone settings compare (Database)

- Linux novice common commands (Linux)

- ASM Management - How to Rename diskgroup (Database)

- Boost notes --Thread - problems encountered in the initial use on Ubuntu (Programming)

- Learning C ++ Standard Template Library and data structures (Programming)

- CentOS 6.7 compile and install LAMP (Server)

 
         
  RPM package management tools under Linux
     
  Add Date : 2017-04-13      
         
       
         
  lab environment:

CentOS release 6.6 (Final) a

IP address: 172.16.249.230

RPM is an acronym for Red Hat Package Manager, the intention is Red Hat Package Manager, as the name suggests is a contribution out of Red Hat package manager; in CentOS, RedHat, Fedora, SUSE, YellowDog other mainstream release, and on the basis of these two versions release times developed using;

First, use the RPM package management;

1, you can install, remove, upgrade and management software; course also supports online software installation and upgrades;

2, the package contains files which RPM package management to know, but also to know the system which package a file belongs to;

3, the package can query the system is installed and its version;

4, as the developers can put their packaged as RPM package was released;

5, the package import GPG signature and MD5, verification and signature release

6, dependency checks to see if there are packages because they do not disturb the compatibility of the system;

Two, RPM usage rights;

RPM software installation, delete, update only root privileges to use; to query any user can operate; if ordinary users have install directory permissions to be installed;

Three, rpm little simple use;

In addition to our package manager, can be installed via the rpm command; is that not all packages can pass rpm command to install it? No, the file .rpm suffix ending it; sometimes we find file.rpm on some websites, should use rpm to install;

A) initialize the rpm database;

By rpm command to query a rpm package is installed, but also through the rpm database to complete; therefore we should always use the following two commands to initialize the rpm database;

# Rpm -initdb initialize the database

Regardless of whether the current database already exists, and will re-establish direct overwrite an existing database

# Rpm --rebuilddb rebuild Note: This will take a long time;

If the data does not exist beforehand, it will create a new, or will not rebuild

Note: These two parameters are extremely useful, sometimes rpm system is a problem, can not be installed and queries, mostly a problem here;

Two) RPM Package Manager search function:

Command Format

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

RPM search function is extremely powerful, is one of the very important function; a few common example, more detailed specific, please refer #man rpm

1, the system software has been installed queries;

1) query system installed software;

Syntax: rpm -q Software name

Example:

[Root @ LinuxHost html] # rpm -q zsh

zsh-4.3.10-7.el6.x86_64

-q is --query, Chinese means "asked" This command indicates that the system is not installed zsh; if there is information output has been installed; If not, it will not install zsh output information;

See all the system has been installed package, to add -a parameter;

[Root @ LinuxHost html] # rpm -qa

If the tab view, plus a pipeline | and more command;

[Root @ LinuxHost html] # rpm -qa | more

Find all already installed a software package, such as zsh; grep can be extracted;

[Root @ LinuxHost html] # rpm -qa | grep zsh

zsh-4.3.10-7.el6.x86_64

This result of the above features and rpm -q zsh output is the same;

2) a query files belong to which package has been installed;

Syntax rpm -qf filename

NOTE: The absolute path name of the file where you want to point out

Example:

[Root @ LinuxHost html] # rpm -qf / bin / zsh

zsh-4.3.10-7.el6.x86_64

3) query installed packages are installed to where;

Syntax: rpm -ql software name or rpm rpmquery -ql Software name

Example:

[Root @ LinuxHost html] # rpm -ql zsh

[Root @ LinuxHost html] # rpm rpmquery -ql zsh

4) Query a package has been installed

Syntax: rpm -qi Software name

Example:

[Root @ LinuxHost opt] # rpm -qi zsh

Name: zsh Relocations: (not relocatable)

Version: 4.3.10 Vendor: CentOS

Release: 7.el6 Build Date: Mon 25 Nov 2013 01:40:59 AM CST

Install Date: Mon 24 Nov 2014 04:05:58 AM CST Build Host: c6b9.bsys.dev.centos.org

Group: System Environment / Shells Source RPM: zsh-4.3.10-7.el6.src.rpm

Size: 5009102 License: BSD

Signature: RSA / SHA1, Mon 25 Nov 2013 03:33:46 AM CST, Key ID 0946fca2c105b9de

Packager: CentOS BuildSystem < http://bugs.centos.org>

URL: http://zsh.sunsite.dk/

Summary: A powerful interactive shell

Description:

The zsh shell is a command interpreter usable as an interactive login

shell and as a shell script command processor. Zsh resembles the ksh

shell (the Korn shell), but includes many enhancements. Zsh supports

command line editing, built-in spelling correction, programmable

command completion, shell functions (with autoloading), a history

mechanism, and more.

5) Check your installed software configuration file;

Syntax: rpm -qc Software name

Example:

[Root @ LinuxHost html] # rpm -qc zsh

/etc/skel/.zshrc

/ Etc / zlogin

/ Etc / zlogout

/ Etc / zprofile

/ Etc / zshenv

/ Etc / zshrc

6) Check the document that have been installed to install the software:

Syntax: rpm -qd Software name

Example:

[Root @ LinuxHost html] # rpm -qd zsh

7) look at the software packages and dependent files are installed;

Syntax: rpm -qR Software name

Example:

[Root @ LinuxHost html] # rpm -qR zsh

Discover summary of installed software: For a software package has been installed, we can put up with a combination of a number of parameters; for example rpm -qil; for example:

[Root @ LinuxHost html] # rpm -qil zsh

2. For non-installed packages View:

See the premise is that you have a .rpm file, that is to say of existing software to view file.rpm the like;

1) Check the use of a software package, version and other information;

Syntax: rpm -qpi file.rpm

Example:

# Rpm -qpi SDL_image-1.2.12-1.x86_64.rpm

Name: SDL_image Relocations: / usr

Version: 1.2.12 Vendor: (none)

Release: 1 Build Date: Sat 21 Jan 2012 09:53:22 AM CST

Install Date: (not installed) Build Host: localhost.localdomain

Group: System Environment / Libraries Source RPM: SDL_image-1.2.12-1.src.rpm

Size: 246207 License: LGPL

Signature: (none)

Packager: Hakan Tandogan < hakan@iconsult.com>

Summary: Simple DirectMedia Layer - Sample Image Loading Library

Description:

This is a simple library to load images of various formats as SDL surfaces.

This library supports BMP, PPM, PCX, GIF, JPEG, PNG, and TIFF formats.

2) Check the package contains a file;

Syntax: rpm -qpl file.rpm

Example:

[[Root @ LinuxHost opt] # rpm -qpl SDL_image-1.2.12-1.x86_64.rpm

/usr/lib/libSDL_image-1.2.so.0

/usr/lib/libSDL_image-1.2.so.0.8.4

/usr/share/doc/SDL_image-1.2.12

/usr/share/doc/SDL_image-1.2.12/CHANGES

/usr/share/doc/SDL_image-1.2.12/COPYING

/usr/share/doc/SDL_image-1.2.12/README

3) Check the position where the document package;

Syntax: rpm -qpd file.rpm

Example:

[Root @ LinuxHost opt] # rpm -qpd SDL_image-1.2.12-1.x86_64.rpm

/usr/share/doc/SDL_image-1.2.12/CHANGES

/usr/share/doc/SDL_image-1.2.12/COPYING

/usr/share/doc/SDL_image-1.2.12/README

Install three) packages, upgrade, delete, etc.;

1, install and upgrade a rpm package;

[Root @ LinuxHost opt] #rpm -vih file.rpm Note: This is used to install a new rpm package;

[Root @ LinuxHost opt] ## rpm -Uvh file.rpm Note: This is used to upgrade a rpm package;

If there are dependencies, resolve dependencies, in fact, the package manager can solve dependencies, see the presentation in front of the package manager; if you can not find the package dependencies Manager bag; he relies bird compiles packages to resolve dependencies, or force the installation;

Grammatical structure:

[Root @ LinuxHost opt] # rpm -ivh file.rpm --nodeps --force

[Root @ LinuxHost opt] #rpm -Uvh file.rpm --nodeps --force

More parameters, see #man rpm

Install a software package:

Option parameter:

-h to display the hash # sign shows the installation speed

-v shows the installation details, -vv -vvv the more details

-i package

--nodeps Ignore dependency

--nodigest ignored integrity

--nosignature ignored source of legitimacy

--replacepkgs reinstall package

--test test installation without performing the actual installation procedure, dry run mode

--prefix NEWPATH specify the installation path (special package)

--oldpackeage downgrade installations

Example applications:

Installation zsh:

[Root @ LinuxHost Packages] # rpm -ivh zsh-4.3.10-7.el6.x86_64.rpm

Preparing ... ########################################### [100% ]

package zsh-4.3.10-7.el6.x86_64 is already installed

NOTE: --replacepkgs parameter is already installed software installation again; sometimes not much need;

Test installation parameters --test, to check dependencies; not a real installation;

[Root @ LinuxHost Packages] # rpm -ivh --test zsh-4.3.10-7.el6.x86_64.rpm

Preparing ... ########################################### [100% ]

package zsh-4.3.10-7.el6.x86_64 is already installed

Reinstall the package:

[Root @ LinuxHost Packages] # rpm -ivh --replacepkgs zsh-4.3.10-7.el6.x86_64.rpm

Preparing ... ########################################### [100% ]

1: zsh ########################################### [100%]

Upgrading a software package:

Command Options

-U Actually executing the upgrade, if you upgrade an older program, no installation package

-F If you have an older program upgrade. Otherwise, abort the installation

--oldpackage downgrade installations

--force ignore the conflict, forced execution

Upgrading a package:

[Root @ LinuxHost dvd] # rpm -qa zsh

zsh-4.3.10-7.el6.x86_64

[Root @ LinuxHost dvd] # rpm -Uvh zsh-4.3.10-8.el6_5.x86_64.rpm

Preparing ... ########################################### [100% ]

1: zsh ########################################### [100%]

[Root @ LinuxHost dvd] # rpm -qa zsh

zsh-4.3.10-8.el6_5.x86_64

The new version of the downgrade to the older version, to add --oldpackage parameters;

[Root @ LinuxHost dvd] # rpm -qa zsh

zsh-4.3.10-8.el6_5.x86_64

[Root @ LinuxHost dvd] # cd Packages /

[Root @ LinuxHost Packages] # rpm -Uvh --oldpackage zsh-4.3.10-7.el6.x86_64.rpm

Preparing ... ########################################### [100% ]

1: zsh ########################################### [100%]

[Root @ LinuxHost Packages] # rpm -qa zsh

zsh-4.3.10-7.el6.x86_64

note:

1. Do not perform the upgrade kernel: Linux kernel to support multiple versions exist, therefore, the new version of the kernel can be installed directly.

2. If the configuration file has been altered source packages installation, upgrade, the new version of the profile and does not overwrite the old version of the file directly, but the new version of the file is renamed (suffix .rpmnew) after reservation.

2, remove a rpm package;

grammar:

rpm {-e | --erase} [--allmatches] [--nodeps] [--noscripts]

[--notriggers] [--test] PACKAGE_NAME ...

First you must learn to query the rpm package; see the previous description;

[Root @ LinuxHost Packages] #rpm -e package names

Example: I want to remove zsh package, complete the operation should be:

[Root @ LinuxHost Packages] # rpm -e zsh

[Root @ LinuxHost Packages] # rpm -qa zsh

If there are dependencies, you can also use the --nodeps Ignore dependency checking to delete. But try not to do so, it is best to use a package manager systerm-config-packages to add or remove software;

[Root @ LinuxHost Packages] # rpm -e zsh --nodeps

Note: If the configuration file has been altered to install the package, when unloaded, this file is not deleted, but is renamed (.rpmsave original file name plus a suffix) and retained.

Fourth, import signature:

Package source of legitimacy and integrity verification:

Command syntax:

rpm --import PUBKEY ...

rpm {-K | --checksig} [--nosignature] [--nodigest]

PACKAGE_FILE ...

[Root @ LinuxHost Packages] # rpm --import signature file

Example:

Get the public key: RPM-GPG-KEY-CentOS-6

#rpm --import RPM-GPG-KEY-CentOS-6

#rpm -K Packages

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

zsh-4.3.10-7.el6.x86_64.rpm: rsa sha1 (md5) pgp md5 OK

About RPM's signature features, please see man rpm

Five, RPM Package Manager management support and network installation inquiry;

For example, we want a mirror CentOS 6.6 query installation package;

address:

http://mirrors.sohu.com/centos/6.6/os/x86_64/Packages/

Example:

Format:

rpm rpm package parameter file http or ftp address

Inquire

[Root @ LinuxHost Packages] # rpm -qpi http://mirrors.sohu.com/centos/6.6/os/x86_64/Packages/zsh-html-4.3.10-7.el6.x86_64.rpm

Name: zsh-html Relocations: (not relocatable)

Version: 4.3.10 Vendor: CentOS

Release: 7.el6 Build Date: Mon 25 Nov 2013 01:40:59 AM CST

Install Date: (not installed) Build Host: c6b9.bsys.dev.centos.org

Group: System Environment / Shells Source RPM: zsh-4.3.10-7.el6.src.rpm

Size: 2993485 License: BSD

Signature: RSA / SHA1, Mon 25 Nov 2013 03:33:46 AM CST, Key ID 0946fca2c105b9de

Packager: CentOS BuildSystem < http://bugs.centos.org>

URL: http://zsh.sunsite.dk/

Summary: Zsh shell manual in html format

Description:

The zsh shell is a command interpreter usable as an interactive login

shell and as a shell script command processor. Zsh resembles the ksh

shell (the Korn shell), but includes many enhancements. Zsh supports

command line editing, built-in spelling correction, programmable

command completion, shell functions (with autoloading), a history

mechanism, and more.

This package contains the Zsh manual in html format.

installation

[Root @ LinuxHost Packages] # rpm -ivh http://mirrors.sohu.com/centos/6.6/os/x86_64/Packages/zsh-html-4.3.10-7.el6.x86_64.rpm

Retrieving http://mirrors.sohu.com/centos/6.6/os/x86_64/Packages/zsh-html-4.3.10-7.el6.x86_64.rpm

Preparing ... ########################################### [100% ]

1: zsh-html ########################################### [100 %]

TELL bar;

Sixth, RPM package naming and access route

Naming Rules

The general format of the RPM package:

name-version-arch.rpm

name-version-arch.src.rpm

name: the name of the package.

version: with primary, secondary and revised version of the package.

arch: hardware platform. Hardware platform includes: i386, i486, i586, i686, x86_64, ppc, sparc, alpha

src.rpm: source code package.

In "openssl098e-0.9.8e-18.el6_5.2.x86_64.rpm" as an example:

openssl098e: software name.

0.9.8e: the software version.

x86_64: is applicable hardware platform.

It also contains a special name:

1, fcXX, elXX: Publisher version indicates the package, like here fc18, described the package under Fedora 18 uses. The openssl098e-0.9.8e-18.el6_5.2.x86_64.rpm means that the package is used in RHEL 6.x (Red Hat Enterprise Linux) / CentOS 6.x.

2, devel: indicates that the RPM package is a software development kit, for example, mysql-devel-5.1.73-3.el6_5.x86_64.rpm.

3, noarch: explanation of this package can be installed on any platform, does not require specific hardware platform. It can run on any hardware platform.

Learn the naming RPM packages, see an RPM package can know it applies to the environment.

Get Way package: are ranked according to safety

1. System release disc server or official site

Mirror station (sohu, 163)

2. Program Project official website

3. The third-party organization

Fedora-EPEL: epel

search engine:

http://rpmfind.net

http://rpm.pbone.net

http://pkgs.org

4. homebrew package.

We suggested a package legality verification:

Source of legitimacy

The integrity of the package
     
         
       
         
  More:      
 
- Android custom ViewPager create kaleidoscopic image transition effects (Programming)
- jdbc Oracle database connection string writing pluggable (Database)
- Those functions under Linux you do not know the df command (Linux)
- How to install OpenOffice Ubuntu or Linux Mint (Linux)
- Do you know how to build the Linux kernel (Programming)
- CentOS Linux firewall configuration and Close (Linux)
- Linux ls command (Linux)
- Python exception summary (Programming)
- MySQL database to open a remote connection method (Database)
- Linux OOM killer mechanism (Linux)
- Disk Management LVM (Linux)
- Advanced Search Oracle study notes (Database)
- Oracle 11g can not export a variety of empty table solution (Database)
- Database Blob data type conversion String (Programming)
- CUDA (including GPU card driver) installation process under Ubuntu (Linux)
- Linux Mint 17.2 64 bit installation Docker and management software seagull (Linux)
- Linux 10 useful examples of command-line completion (Linux)
- MySQL Server Time Synchronization Problem (Database)
- How to install Perl modules from CPAN (Linux)
- Compare Swift achieve rapid sorting and sorted Methods (Programming)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.