Use of RPM directives in Linux __linux

Source: Internet
Author: User
Tags md5
Usage: RPM [Options ...]
Query Options (parameter-Q or--query):
-C,--configfiles list all configuration files
-D,--docfiles lists all document files
--dump Export Basic file information
-L,--list lists all the files in the package
--queryformat=queryformat using the query format that follows
-S,--state displays the status of the file list
-V,--verbose displays a detailed list of files
-A,--all query/verify all Packages
-F,--file query/checksum package containing files
-G,--group in the query/verify group
-p,--package query/Validate a package file (for example, a binary *.rpm file)
--querytags display of known query labels
--specfile Query specification File
--whatrequires queries/Verifies the dependencies of the specified package
--whatprovides Query/checksum specifies the dependency of the package

Checksum option (parameter-V or--verify):
--NOMD5[|=0X1] Do not use MD5 category checksum files
--NOFILES[|=0X10000] does not check the files in the package
--NODEPS[|=0X20000] does not check the dependencies of packages
--NOSCRIPT[|=0X40000] does not perform a validation script (any script)
-A,--all query/verify all Packages
-F,--file the files contained in the query/checksum package
-G,--group in the query/verify group
-p,--package query/Validate a package file (for example, a binary *.rpm file)
--querytags display of known query labels
--specfile Query specification File
--whatrequires queries/Verifies the dependencies of the specified package
--whatprovides Query/checksum specifies the dependency of the package

Signature options:
--addsign Add a signature to the package
--resign Signature of a package (remove current signature)
-K,--checksig Check package signature
--NOGPG[&=~0X4] ignores any GPG signatures
--NOMD5[&=~0X2] does not verify the MD5 checksum of the file

Database options:
--INITDB Initialization Database
--REBUILDDB rebuilds the reverse list of the database from the header information of the installed package

Install/upgrade/Uninstall options:
--ALLFILES[|=0X40] Installs all files, ignoring the part of the configuration item that cannot be found
--ALLMATCHES[|=0X2] Uninstalls all packages that match the item. (If more than one package is specified, an error message is generated)
--BADRELOC[|=0X8] Relocate files in a non-relocation package
-E,--erase=+ unload package
--EXCLUDEDOCS[|=0X20] does not install the document
--excludepath= an ignored file with a boot component
--FORCE[|=0X74]--replacepkgs--replacefiles shortcuts
-F,--freshen=+ upgrade package in case of installation
-H,--hash[|=0x2] hash mark for installation package (preferably with-v option)
--IGNOREARCH[|=0X2] System with no check package
--IGNOREOS[|=0X1] The operating system that does not check the package
--IGNORESIZE[|=0X180] Do not check disk space before installing
--includedocs Installation Documentation
--install=+ installation Package
--JUSTDB[|=0X8] Upgrade the database without modifying the file system
--nodeps the dependencies of the non-checksum package
--NOORDER[|=0X8] do not re-record package installation information into dependencies
--NOSCRIPTS[|=0XFF0000] script that does not execute the package
--NOTRIGGERS[|=0X990000] does not perform any scripts that are triggered by the installation package
--OLDPACKAGE[|=0X40] Upgrade to an older version of the package
(This operation is performed automatically when the--force is upgraded)
--PERCENT[|=0X1] The installation progress of the print package
--prefix= If relocation is allowed, relocate the package to
--relocate== from path to relocation file
--REPACKAGE[|=0X400] Repackaging saved uninstall package files
--REPLACEFILES[|=0X30] Replace installed files with package files at installation
--REPLACEPKGS[|=0X4] If the package already exists, then reinstall
--TEST[|=0X1] does not install the package, but to detect whether it is functioning properly
-U,--upgrade=+ upgrade pack

Common options for all RPM modes:
--version Print the version information of the RPM used
--quiet provides a small amount of detailed information output
-V,--verbose provides more detailed information output
--define= ' uses values to define macros
--eval=+ Printing + macro expansion
-R,--root= used as top level directory (default: "/")
--macros= read to replace the default macro file
--rcfile= read to replace the default RPMRC file
--SHOWRC Displays the final RPMRC and macro configuration

Options implemented through the popt alias/exec:
--scripts List all installation/uninstall scripts in the package
--setperms permissions to set files in a package
--setugids the user/group relationship of the file in the package
--conflicts list compatibility of this package
--obsoletes list the other packages that you need to uninstall to install this package
--provides lists the compatibility provided by this package
--requires lists the compatibility required for this package
--info lists the narrative information in the package
--changelog list The change log for this package
--triggers list trigger script in package
--last List Packages According to installation time, the most recent time priority
--filesbypkg list all files for each package
--redhatprovides Find the package name based on the included compatibility (you need to install the package rpmdb-redhat)
--redhatrequires Find the package name based on the compatibility of the packages that you depend on (installation package rpmdb-redhat required)
--buildpolicy= set the root of the package (for example, compact Man manual)
--with= to open packaged configuration
--without= to turn off packaged configuration
Help options:
-?,--Help displays this helpful information
--usage Display Usage Summary
******************************************************
1. How to not install but get the files in the RPM package
Using Tools Rpm2cpio and Cpio
Rpm2cpio xxx.rpm | Cpio-vi
Rpm2cpio xxx.rpm | Cpio-idmv
Rpm2cpio xxx.rpm | Cpio--extract--make-directories
The parameters I and extract are the same, representing the extracted files. V indicates that the execution process
D is the same as make-directory to create a directory based on the original path of the file in the package
m indicates how long the file is to be kept updated.

2. How to view the files and other information related to the RPM package
All of the following examples assume the use of package mysql-3.23.54a-11
1. The RPM packages are installed in my system
Rpm-qa to list all installed packages
If you want to find all installed packages that contain a string of SQL
RPM-QA |grep SQL

3. How to obtain the full file name of a package
Rpm-q MySQL can obtain the full name of the MySQL package installed in the system, from which you can obtain
Information such as the version of the current package. In this case, you can get information mysql-3.23.54a-11

4. An RPM package where the files are installed.
RPM-QL Package Name
Note that here is the name of the package that does not include the. rpm suffix
That means you can only use MySQL or mysql-3.23.54a-11 instead of mysql-3.23.54a-11.rpm.
If you just want to know where the executable program goes, you can also use which, such as
which MySQL

5. Include those files in an RPM package
A package that has not been installed, using the RPM-QLP ****.rpm
An already installed package, you can also use the RPM-QL ****.rpm

6. How to obtain information about the version, purpose, etc. of a software package.
A package that has not been installed, using the RPM-QIP ****.rpm
An already installed package, you can also use the Rpm-qi ****.rpm

7. Which package is installed in a program, or which package contains this program
RPM-QF ' which program name ' returns the full name of the package
Rpm-qif ' which program name ' returns information about the package
RPM-QLF ' which program name ' Returns the file list of the package
Note that this is not a quote, but a ', that's the key in the upper-left corner of the keyboard.
You can also use RPM-QILF to output package information and file lists at the same time

8. Which package is installed in a file, or which package contains this file
Note that the method in the previous question applies only to the executable program, and the following method can not only
Can be used for executable programs, or for any file that is normal. The prerequisite is to know the file name.
First get the full path to the program, you can use Whereis or which, and then RPM-QF for example:
# Whereis Ftptop
Ftptop:/usr/bin/ftptop/usr/share/man/man1/ftptop.1.gz
# Rpm-qf/usr/bin/ftptop
Proftpd-1.2.8-1
# Rpm-qf/usr/share/doc/proftpd-1.2.8/rfc/rfc0959.txt
Proftpd-1.2.8-1

Summarize:
Get package-related information with rpm-q,q for query queries, followed by other options, such as
I express info, get information of software package;
L represents list, obtains file lists;
A represents all and executes the query in all packages;
f indicates file, the relevant query according to the document;
P indicates package, query based on package
The required query criteria can be generated using grep, or from the command line in "'"

9. Some relevant knowledge about RPM software package
1. What is rpm
RPM, Redhat Package Management, is one of Redhat's inventions.

10. Why need rpm
Under one operating system, you need to install packages that implement various functions. These packages generally have their own
program, but there are also complex dependencies. You also need to fix the version of the package and install it,
Configuration, uninstall automation issues. In order to solve these problems, Redhat for its own system proposed a
Better way to manage hundreds of software. This is the RPM management system. RPM management system installed in the system
Later, as long as the RPM file standard packaging procedures can be easily installed, upgrade, uninstall

11. Does all Linux use rpm
Any system requires a package management system, so many Linux uses the RPM system. But the RPM system is dedicated for RH
But Tl,mandrake and other systems also use RPM. Because the source of the RPM can be compiled on another system,
So it's possible to use RPM on other systems as well.
In addition to RPM, other systems have their own package management programs, such as the Debian Deb package,
Slakware also has its own package management system.

12.RPM Package file name Why is it so long
The file name of the RPM package contains the version information of the package, operating system information, hardware requirements, and so on.
such as mypackage-1.1-2tl.i386.rpm, where MyPackage is the name of the package registered in the system
1.1 is the software version number, 2 is the release number, TL for the TL operating system, but also may be RH and so on. I386 said
For Intel x86 platforms, and possibly SPARC.

13. What does the i386,i686 in the package file name mean?
The name of the RPM package includes not only the software name, version information, but also the applicable hardware architecture.
of information.
i386 refers to the software package that applies to more than 80386 of Intel's x86 architecture computers (AI32)
i686 refers to a computer (IA32) that applies to the x86 architecture of Intel more than 80686 (Pentium Pro)
Noarch refers to this package is not related to the hardware architecture, can be universal.
i686 software package programs are typically optimized for CPUs, so backward compatibility comparisons are used to i386 packages in
It can be used on x86 machines. Forward is generally incompatible. But now the computer, Pentium Pro CPU has been very little
Used, the i686 package can be used for machines that are usually configured

14. The RPM packages issued by different operating systems can be mixed.
For the RPM package that has been compiled into binary, the operating system environment is different, generally can not be mixed.
For packages that are published in src.rpm, they can usually be compiled locally as they need to be installed, so it is often possible to
System under Installation.

15. Some special problems encountered when using RPM
Q I use rpm-e **.rpm can't delete rpm package
A package name do not include RPM,
RPM-E package name, can include information such as version number, but can not have suffix. rpm

Q There is no tool for reading RPM files under MS's system.
A wincmd with RPM plugins .....

Q Whether you can install the upgrade RPM package through an FTP installation.
A can. RPM-IVH Ftp://xxxxxxxx/PATH2SomeRPM

Q RPM Installation When the existing package version is too high to do.
A sometimes because the packages are too old to be installed, and the associated package versions are newer in the system, you may need
Some files that are dependent on the installed package will not be found. There are two ways to solve this problem.
The first is found in the system files and need the same file function or similar files, do a symbol link to
Required directory.
The second is to download and install a new version of the package.
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.