RPM yes RedHat Package Manager(RedHat Package management tools ) similar Windows Inside “ add to / Delete program ”

rpm Execute installation package
Binary package (Binary) And the source code package (Source) Two kinds of . Binary packages can be installed directly in the computer , And the source code package will be RPM Automatic compilation 、 install . Source code packages are often written with src.rpm Suffixed name .

Common command combination :

-ivh: Installation shows the progress of the installation --install--verbose--hash
-Uvh: Upgrade package --Update;
-qpl: List RPM File information in the package [Query Package list];
-qpi: List RPM Description of the package [Query Package install package(s)];
-qf: Find which... The specified file belongs to RPM software package [Query File];
-Va: Verify all RPM software package , Look for missing files [View Lost];
-e: Delete package
rpm -q samba // Check whether the program is installed
rpm -ivh  /media/cdrom/RedHat/RPMS/samba-3.0.10-1.4E.i386.rpm // Install by path and show progress 
rpm -ivh --relocate /=/opt/gaim gaim-1.3.0-1.fc4.i386.rpm    // Specify the installation directory rpm -ivh --test gaim-1.3.0-1.fc4.i386.rpm  // Used to check dependencies ; It's not really an installation ;
rpm -Uvh --oldpackage gaim-1.3.0-1.fc4.i386.rpm // The new version is downgraded to the old version rpm -qa | grep httpd  #[ Search assignments rpm Is the package installed ]--all Search for *httpd*
rpm -ql httpd #[ Search for rpm package ]--list All the files in the installation directory rpm -qpi Linux-1.4-6.i368.rpm #[ see rpm package ]--query--package--install package Information
rpm -qpf Linux-1.4-6.i368.rpm #[ see rpm package ]--file
rpm -qpR file.rpm #[ Check the bag ] Dependency relationship
rpm2cpio file.rpm |cpio -div    #[ Pull out the file ] rpm -ivh file.rpm  #[ Install the new rpm]--install--verbose--hash
rpm -ivh rpm -Uvh file.rpm    #[ Upgrade one rpm]--upgrade
rpm -e file.rpm      #[ Delete one rpm package ]--erase

Common parameters :

Install/Upgrade/Erase options:

-i, --install                     install package(s)
-v, --verbose                     provide more detailed output
-h, --hash                        print hash marks as package installs (good with -v)
-e, --erase                       erase (uninstall) package
-U, --upgrade=<packagefile>+      upgrade package(s)
--replacepkge                     Whether the package has been installed or not , Both force the installation of software packages
--test                             Install the test , It's not actually installed
--nodeps                           Ignore package dependencies and force installation
--force                            Ignore conflicts between packages and files Query options (with -q or --query):
-a, --all                         query/verify all packages
-p, --package                     query/verify a package file
-l, --list                        list files in package
-d, --docfiles                    list all documentation files
-f, --file                        query/verify package(s) owning file

RPM Source code packaging installation

.src.rpm Final document , These files are packaged by the source code of the software , Users need to install this kind of RPM software package , You have to use the command :

rpm --recompile vim-4.6-4.src.rpm   # This command will unpack and compile the source code 、 Install it , If the user uses the command :
rpm --rebuild vim-4.6-4.src.rpm # After installation , It will also repackage the executable file generated by compilation into i386.rpm Of RPM software package .

I don't like to write complicated things , In case of trouble ` But for reference ` I've also changed a person's ` It's really comprehensive `

author : North, South, north, South
come from :LinuxSir.Org
summary :RPM yes Red Hat Package Manager Abbreviation , The original meaning is Red Hat Package management ; In this paper, RPM, And combined with examples to explain RPM Manual installation 、 Query and other applications ;


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Text :
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

RPM yes Red Hat Package Manager Abbreviation , The original intention is Red Hat Package management , As the name suggests Red Hat Contributed package management ; stay Fedora 、Redhat、Mandriva、SuSE、YellowDog And other mainstream releases , And on the basis of these versions, the secondary development of the distribution version adopts ;

RPM What's in the bag ? It contains executable binary programs , This program and Windows In the package of .exe Files are similar to executable ;RPM The package also includes the files needed to run the program , It's the same with Windows The package is similar to ,Windows The operation of the program , except .exe Out of documents , There are other documents as well ;

One RPM The application in the package , Sometimes in addition to its own with the additional file to ensure its normal , Other specific versions of the file are also required , This is the dependency of the package ; Dependency is not Linux Peculiar , Windows The same is true of operating systems ; Let's say we have Windows Running in the system 3D game , During installation , He might prompt , To install Direct 9 ;Linux and Windows The principle is similar ;

Software installation flow chart :


The scope of this article is :

1、 This article is about RPM Description of the management software , Yes file.tar.gz or file.tar.bz2 Source code package make ;make install The installed software is invalid ;
2、 When installing the software , It is best to use the system package management tools provided by the respective distributions , about Fedora/Redhat You can refer to the following article ;

1)Fedora System management package tools system-config-packages, It is convenient to add and remove the software package provided by the system installation disk , Details please see 《Fedora Package manager system-config-packages》

2)Redhat System management package tools , The new system should be redhat-config-packages , Usage and 《Fedora Package manager system-config-packages》  equally ;

3)apt + synaptic Package online installation 、 remove 、 Upgrade tools ; usage :《 use apt+synaptic Install or upgrade online Fedora core 4.0 software package 》
4)yum Package online installation 、 upgrade 、 Remove the tool ; usage :《Fedora/Redhat Install the update package online ,yum piece 》

5) be-all yum and apt course  《apt and yum》

at present apt and yum It's very mature , When we install the software , use apt perhaps yum ; If you install the software package provided by the system disk , It can be used system-config-packages or redhat-config-packages ;


One 、RPM The purpose of package management ;

1、 Can install 、 Delete 、 Upgrade and manage software ; Of course, it also supports online software installation and upgrade ;
2、 adopt RPM Package management can know which files are included in the package , You can also know which package a file in the system belongs to ;
3、 You can query whether the software package in the system is installed and its version ;
4、 As a developer, you can package your program as RPM Package release ;
5、 Package signature GPG and MD5 Import of 、 Verification and signature Publishing
6、 Dependency checking , Check to see if any software packages are disrupting the system due to incompatibility ;


Two 、RPM Permission to use ;

RPM Software installation 、 Delete 、 Update only root Permission can only be used ; For the query function, any user can operate ; If an ordinary user has permission to install the directory , It can also be installed ;


3、 ... and 、rpm A simple usage of ;

Except for the package manager , Also can pass the rpm Command to install ; Can all software packages pass through rpm Command to install ? No, it isn't , Document to .rpm At the end of the suffix ; Sometimes we find it on some websites file.rpm , You have to use rpm To install ;

One ) initialization rpm database ;

adopt rpm Command to query a rpm Whether the package is installed , It's also through rpm Database ; So we should always use the following two commands to initialize rpm database ;

[root@localhost beinan]# rpm --initdb
[root@localhost beinan]# rpm --rebuilddb notes : It will take a long time ;

notes : These two parameters are extremely useful , Sometimes rpm There's something wrong with the system , Can't install and query , Most of it's a problem here ;

Two )RPM Query function of package management :

Command format

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

RPM The query function of is extremely powerful , It's one of the most important functions ; Take a few common examples , More detailed and specific , Please refer to #man rpm

1、 Query of installed software in the system ;

1) Query the installed software of the system ;

grammar :rpm -q The software name

give an example :

[root@localhost beinan]# rpm -q gaim
gaim-1.3.0-1.fc4

-q Namely --query , Chinese meaning “ ask ”, This command means , Is the system installed gaim ; If installed, there will be information output ; If not installed , Will be output gaim No installation information ;

Check all installed packages in the system , To add -a Parameters ;

[root@localhost RPMS]# rpm -qa

If you look at it in pages , One more pipe | and more command ;

[root@localhost RPMS]# rpm -qa |more

Find a software in all installed packages , for instance gaim ; It can be used grep Draw it out ;

[root@localhost RPMS]# rpm -qa |grep gaim

The function of the above one and rpm -q gaim The output is the same ;

2) Query which package an installed file belongs to ;

grammar rpm -qf file name

notes : The absolute path of the filename should indicate

give an example :

[root@localhost RPMS]# rpm -qf /usr/lib/libacl.la
libacl-devel-2.2.23-8

3) Query where installed packages are installed ;

grammar :rpm -ql The software name or rpm rpmquery -ql The software name

give an example :

[root@localhost RPMS]# rpm -ql lynx
[root@localhost RPMS]# rpmquery -ql lynx

4) Query information about an installed package

Grammar format : rpm -qi The software name

give an example :

[root@localhost RPMS]# rpm -qi lynx

5) Check the profile of the installed software ;

Grammar format :rpm -qc The software name

give an example :

[root@localhost RPMS]# rpm -qc lynx

6) View a document where the software has been installed :

Grammar format : rpm -qd The software name

give an example :

[root@localhost RPMS]# rpm -qd lynx

7) Check the packages and files that the installed software depends on ;

Grammar format : rpm -qR The software name

give an example :

[root@localhost beinan]# rpm -qR rpm-python

Query summary of installed software : For a package already installed , We can combine a series of parameters to use ; such as rpm -qil ; such as :

[root@localhost RPMS]# rpm -qil lynx

2、 For viewing packages that are not installed :

The premise of viewing is that you have a .rpm The file of , In other words, for existing software file.rpm And so on ;

1) Look at the purpose of a package 、 Version information ;

grammar : rpm -qpi file.rpm

give an example :

[root@localhost RPMS]# rpm -qpi lynx-2.8.5-23.i386.rpm

2) Look at the files contained in a package ;

grammar : rpm -qpl file.rpm

give an example :

[root@localhost RPMS]# rpm -qpl lynx-2.8.5-23.i386.rpm

3) See where the documentation for the package is located ;

grammar : rpm -qpd file.rpm

give an example :

[root@localhost RPMS]# rpm -qpd lynx-2.8.5-23.i386.rpm

5) Look at the configuration file of a package ;

grammar : rpm -qpc file.rpm

give an example :

[root@localhost RPMS]# rpm -qpc lynx-2.8.5-23.i386.rpm

4) Look at the dependencies of a package

grammar : rpm -qpR file.rpm

give an example :

[root@localhost archives]# rpm -qpR yumex_0.42-3.0.fc4_noarch.rpm
/bin/bash
/usr/bin/python
config(yumex) = 0.42-3.0.fc4
pygtk2
pygtk2-libglade
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
usermode
yum >= 2.3.2


3、 ... and ) Package installation 、 upgrade 、 Delete etc. ;

1、 Install and upgrade a rpm package ;

[root@localhost beinan]#rpm -vih file.rpm notes : This is for installing a new rpm package ;
[root@localhost beinan]#rpm -Uvh file.rpm notes : This is to upgrade a rpm package ;

If there's a dependency , Please resolve the dependency , In fact, package manager can solve the dependency relationship very well , Take a look at the package manager ; If you can't find a dependency package in the package manager ; That can only be solved by compiling the packages that he relies on , Or force installation ;

Grammatical structure :

[root@localhost beinan]# rpm -ivh file.rpm --nodeps --force
[root@localhost beinan]# rpm -Uvh file.rpm --nodeps --force

More parameters , Please check out man rpm

Example application :

[root@localhost RPMS]# rpm -ivh lynx-2.8.5-23.i386.rpm
Preparing... ########################################### [100%]
      1:lynx ########################################### [100%]
[root@localhost RPMS]# rpm -ivh --replacepkgs lynx-2.8.5-23.i386.rpm
Preparing... ########################################### [100%]
      1:lynx ########################################### [100%]

notes : --replacepkgs Parameter is to install again with the installed software ; Sometimes it's not necessary ;

Test installation parameters --test , Used to check dependencies ; It's not really an installation ;

[root@localhost RPMS]# rpm -ivh --test gaim-1.3.0-1.fc4.i386.rpm
Preparing... ########################################### [100%]

Downgrade from new version to old version , To add --oldpackage Parameters ;

[root@localhost RPMS]# rpm -qa gaim
gaim-1.5.0-1.fc4
[root@localhost RPMS]# rpm -Uvh --oldpackage gaim-1.3.0-1.fc4.i386.rpm
Preparing... ########################################### [100%]
      1:gaim ########################################### [100%]
[root@localhost RPMS]# rpm -qa gaim
gaim-1.3.0-1.fc4

Specify the installation directory for the package : To add -relocate Parameters ; The following is an example of gaim-1.3.0-1.fc4.i386.rpm Specify to install on /opt/gaim Directory ;

[root@localhost RPMS]# rpm -ivh --relocate /=/opt/gaim gaim-1.3.0-1.fc4.i386.rpm
Preparing... ########################################### [100%]
      1:gaim ########################################### [100%]
[root@localhost RPMS]# ls /opt/
gaim

Specify the installation directory for the package : To add -relocate Parameters ; The following is an example of lynx-2.8.5-23.i386.rpm Specify to install on /opt/lynx Directory ;

[root@localhost RPMS]# rpm -ivh --relocate /=/opt/lynx --badreloc lynx-2.8.5-23.i386.rpm
Preparing... ########################################### [100%]
1:lynx ########################################### [100%]

How can we call the program installed in the specified directory ? General executive procedures , It's all in the installation directory bin perhaps sbin Directory ; See the following example ; If there is an error output , Do the corresponding links , use ln -s ;

[root@localhost RPMS]# /opt/lynx/usr/bin/lynx
Configuration file /etc/lynx.cfg is not available.
[root@localhost RPMS]# ln -s /opt/lynx/etc/lynx.cfg /etc/lynx.cfg
[root@localhost RPMS]# /opt/lynx/usr/bin/lynx www.linuxsir.org

2、 Delete one rpm package ;

First of all, you should learn to inquire rpm package ; Please see the previous instructions ;

[root@localhost beinan]#rpm -e Package name

give an example : I want to remove lynx package , The complete operation should be :

[root@localhost RPMS]# rpm -e lynx

If there is a dependency , You can also use --nodeps Ignore dependent checks to remove . But try not to , It's best to use the package manager systerm-config-packages To remove or add software ;

[root@localhost beinan]# rpm -e lynx --nodeps


Four 、 Import signature :

[root@localhost RPMS]# rpm --import Signed documents

give an example :

[root@localhost fc40]# rpm --import RPM-GPG-KEY
[root@localhost fc40]# rpm --import RPM-GPG-KEY-fedora

About RPM The signature function of , For details, see man rpm

5、 ... and 、RPM The management pack manager supports network installation and query ;

For example, we want to go through Fedora Core 4.0 A mirror query of 、 Install package ;

Address :
http://mirrors.kernel.org/fedora/core/4/i386/os/Fedora/RPMS/

give an example :

Command format :

rpm Parameters rpm Package file http perhaps ftp The address of
# rpm -qpi http://mirrors.kernel.org/fedora/core/4/i386/os/ Fedora/RPMS/gaim-1.3.0-1.fc4.i386.rpm
# rpm -ivh http://mirrors.kernel.org/fedora/core/4/i386/os/ Fedora/RPMS/gaim-1.3.0-1.fc4.i386.rpm

Draw inferences from one instance ;


6、 ... and 、 A supplement to the installed package query ;

[root@localhost RPMS]# updatedb
[root@localhost RPMS]# locate Software name or file name

adopt updatedb, We can use locate To find out where some software has been installed ; When the system is first installed, perform updatedb , Every once in a while ; To keep the installed libraries up to date ;updatedb yes slocate Software package all ; If you don't have this command , You have to install slocate ;

give an example :

[root@localhost RPMS]# locate gaim


7、 ... and 、 from rpm Package extraction file ;

Command format : rpm2cpio file.rpm |cpio -div

give an example :

[root@localhost RPMS]# rpm2cpio gaim-1.3.0-1.fc4.i386.rpm |cpio -div

The extracted file is in the directory of the application operation usr and etc in ;

In fact, it is not as convenient to install the software as to specify the installation directory ; You can also extract files ;

Specify the installation directory for the package : To add -relocate Parameters ; The following is an example of gaim-1.3.0-1.fc4.i386.rpm Specify to install on /opt/gaim Directory ;

[root@localhost RPMS]# rpm -ivh --relocate /=/opt/gaim gaim-1.3.0-1.fc4.i386.rpm
Preparing... ########################################### [100%]
      1:gaim ########################################### [100%]
[root@localhost RPMS]# ls /opt/
gaim

It's also clear at a glance ;gaim All of the files are installed in /opt/gaim in , We just put gaim Backup the directory , Then remove it gaim; In fact, this is also a bit of usage of extracting files ;


8、 ... and 、RPM Configuration file for ;

RPM Package management , The configuration file is rpmrc , We can find it in our own system ; such as Fedora Core 4.0 Medium rpmrc The file is located in ;

[root@localhost RPMS]# locate rpmrc
/usr/lib/rpm/rpmrc
/usr/lib/rpm/redhat/rpmrc

We can go through rpm --showrc see ; Specifically, we have to learn by ourselves . o ... Don't ask me , I don't understand ; As long as you read this article , I think it's useful for you , Your level is similar to mine ; Our level is the same , So I can't help you ; Please understand ;

Nine 、src.rpm Usage of :

《file.src.rpm A brief introduction to how to use it 》


Postscript :
Fedora/Redhat Package management in the introductory tutorial , I've written a lot ; At present, there is still a lack of software installation methods through the source code package and a summary document ; I want to make it up in the last two days , I've written these two before ; Just rearrange it and post it ;

At my level , Write Fedora The introductory course is extremely laborious , It can only be improved and supplemented little by little ; The tutorial I wrote is for Linux I'm a novice ; In the course, the application of examples accounts for the majority ; I found that without examples , It's better to watch man ; Can see man 了 , Of course, I'm not a novice ;

I often see some brothers' questions on the forum , Although a question can be dealt with in the past ; But I want to make it more convenient , It's better to write an introduction to the system ; Although it takes a little longer ;

rpm More related articles on command instructions

  1. Linux cp Instructions for using the command

    Linux cp Instructions for using the command -- Functional specifications : Copy directory or file -- Command format :cp  [ Parameters ]  < File or directory >  < File or directory > -- Common parameters : -R duplicate catalog -i Overlay file of ...

  2. linux I'm not careful to rpm Command uninstalled , How to recover ?

    Today we are building mysql Cluster service , install mysql Before cluster service , First unload the original mysql Software package , Carelessly rpm I've also unloaded my command , It's a tragedy , Nothing can be done . stay google I went through a lot of pages , Even the official website , no ...

  3. Linux rpm Command parameter usage details [ Introduction and Application ]

    RPM yes RedHat Package Manager(RedHat Package management tools ) similar Windows Inside “ add to / Delete program ” rpm Execute installation package Binary package (Binary) And the source code package (Source) two ...

  4. magnum Instructions for using the command

    magnum Instructions for using the command 1. usage usage: magnum [--version] [--debug] [--os-cache] [--os-region-name <region-nam ...

  5. Linux Use rpm command

    RPM yes RedHat Package Manager(RedHat Package management tools ) similar Windows Inside “ add to / Delete program ” rpm Execute installation package binary package (Binary) And the source code package (Source) Two kinds of ...

  6. Linux rpm Command parameter usage details [ Introduction and Application ]( turn )

    RPM yes RedHat Package Manager(RedHat Package management tools ) similar Windows Inside “ add to / Delete program ” rpm Execute installation package binary package (Binary) And the source code package (Source) Two kinds of ...

  7. yum rpm command linux

    centos Software installation can be divided into two types : [centos]rpm Files installed , Use rpm Instructions   similar [ubuntu]deb Files installed , Use dpkg Instructions [centos]yum install    similar [ubuntu ...

  8. rpm Command parameter usage details

    RPM yes RedHat Package Manager(RedHat Package management tools ) similar Windows Inside “ add to / Delete program ” rpm Execute installation package Binary package (Binary) And the source code package (Source) two ...

  9. Linux rpm Command parameter usage details [ Introduction and Application ]( turn )

    RPM yes RedHat Package Manager(RedHat Package management tools ) similar Windows Inside “ add to / Delete program ” rpm Execute installation package binary package (Binary) And the source code package (Source) Two kinds of ...

Random recommendation

  1. Open source project GitHub

    GitHub Hand in hand to teach you how to join github Open source world of ! http://www.open-open.com/lib/view/open1396580186465.html How to be in Github On the hair ...

  2. jquery Get dimensions about width and height

    The author is original , Reprint please be famous ! console.log(" Height of visual area :"+$(window).height()); console.log(" Visual area width :"+$(w ...

  3. Confused it male , Where should I go

    From last year 7 In the graduation , It's been almost a year now . Accurately speaking , I've been working for two years . My first job was HIS Engineering personnel , Mainly responsible for the implementation of hospital system deployment and maintenance , The reason why we were looking for implementation , It's also imperative , The idea of second best , I was still at school ...

  4. MySQL Big data paging optimization ideas and index delay Association

    At the last sharing meeting of the Department before , I heard about MySQL Paging of big data , How to use limit offset,N To paginate big data , Now make a note : First we know that ,limit offset,N When ,MySQL Query for ...

  5. English grammar It all started the summer before second grade when our moving van pulled into her neighborhood

    It all started the summer before second grade when our moving van pulled into herneighborhood It all ...

  6. cJSON: One use c Write a simple and easy to use JSON Parser

    from :http://blog.csdn.net/chenzhongjing/article/details/9188347 Download address : http://sourceforge.net/projects/ ...

  7. Aptana​ ​S​t​u​d​i​o install

    Aptana Studio It's an integrated Web Application development environment , It can not only run as a stand-alone program , And it can be used as Eclipse The plug-in USES . AptanaStudio It's based on Eclipse Integrated Web open ...

  8. Python Information isolation in threads of concurrent programming ( 5、 ... and )

    Hello everyone , Concurrent programming Enter the third chapter . First day at work , We should be busy . So is Xiao Ming , So today's content is very little . It takes only a few minutes to learn . Yesterday we said , Thread and thread to control the execution of the program through message communication . I'm done with messaging , Today ...

  9. Integrate X-Admin Front end frame modification ABP

    “ Standing on the shoulders of giants ”, thus , Don't be polite , Save time in a worthwhile direction , After all, life is just once . In contact with ABP since , Always wanted to take time to integrate LayUI Front frame to ABP in , And then can gradually polish out a set of suitable framework , Development study ...

  10. vb.net MakeWParam

    Private Function MakeWParam(loWord As Integer, hiWord As Integer) As Integer ) End Function