linux  Software Installation (rpm detailed)

Source: Internet
Author: User

Transferred from: http://www.51testing.com/?uid-227476-action-viewspace-itemid-99651

In the process of using the Linux system, the installation of the package is not to be avoided, under Linux, there are many kinds of software installers , installation methods are also various, (comfort is not natural compared to Windows:-) However, there are two types of packages that are common to us:

1) contains the software of the source code of the compressed package, decompression needs to be compiled manually. This software installation package is typically a tar package that is compressed with gzip (suffix. tar.gz).

./configure (config)

Make (Compile)
Make install (install)
Make clean (uninstall)

Note: Typical source code packages can be installed like this, but not all of them, such as Webmin
To execute under its directory./setup.sh Enter the interactive configuration installation
Uninstall with Uninstall program
Specifically, if you don't see the Readme file under the package you want to install,

2) software executable program, you just install it on it (get used to the favorite of Windows installed friends!). )。 This software installation package is called the rpm package(Redhatlinuxpacketmanager, which is the Redhat Package Manager), and the suffix is. rpm.

Of course, there are source code that can be packaged in RPM format, and executable packages that are compressed with gzip.
But as long as you understand the following installation ideas, these two forms of installation package is also a cinch.

Below, we carry out a detailed description of different package installation

Part I: Installing the. tar.gz Package

1. First, use TAR-XZVF to unpack the package, such as:

# TAR-XZVF Apache_1_3_6_tar.gz
*******************************************
The tar command parameter explains:
X release the file from the archive file.
Use gzip to compress/unzip the file, plus this option to compress the archive file, but be sure to unzip it using this option when restoring.
V Detailed report of file information processed by tar. Without this option, TAR does not report file information.
F using a file or device, this option is usually required.
If you need to know more about the use of tar see other documentation
*******************************************

This creates a new directory in the current directory (the directory name is similar to the file name of the. tat.gz package), which is used to store the extracted content. As in this case, apache_1.3.6

2. Enter this directory, and then use the LS command to view the included files, the command is as follows:

# CD apache_1.3.6
# ls

You see which of the following files is included in this directory: Configure, Makefile, or Imake.

1) If it is a configure file, execute:

#./configure
# make
# make Install

2) If it is a makefile file, execute:

# make
# make Install

3) If it is a Imake file, execute:
# XMKMF
# make
# make Install

4) If you do not have a itstall (installation process) file, such as a Rzsz software package, perform
# make POSIX
Or
# Make Linux


3. If there are no error prompts, the TAR package is installed. Where the software is installed, it usually appears at installation time. If you do not have access to the README.


Frequently asked questions during the TAR package installation process:

1) No C or C + + compiler installed
Diagnostic method: Execute command gcc (c + + is g++), indicating that the command could not be found.
Workaround: Mount the Linux installation CD, then go to the RPMs directory and execute the command:
# RPM-IVH gcc* (c or C + + compiler is RPM package, will be mentioned later)

2) No Make tool installed
Method of Diagnosis: Execute command make, indicating that the command could not be found.
Workaround: Mount the Linux installation CD, then go to the RPMs directory and execute the command:
# RPM-IVH make*

3) no autoconf tools installed;
Method of Diagnosis: Execute command make, indicating that the command could not be found.
Workaround: Mount the Linux installation CD, then go to the RPMs directory and execute the command:
# RPM-IVH autoconf*

4) missing certain link libraries;
Method of diagnosis: When make, some files are required to be prompted.
Workaround: Install the package that contains this file.

Part Two: Installing the. RPM Package

RPM is the Redhat company with Redhatlinux has introduced a package manager that makes it easier and more easy to install software (like software installed under Windows).

1. Install the Software: Execute RPM-IVH RPM package name, such as:

# RPM-IVH apache-1.3.6.i386.rpm
*******************************************
RPM Parameter Explanation:
I install packages
V Show additional Information
H Output Hash mark (' # ') at installation
If you need to know more about the use of RPM see Appendix
*******************************************

2. Upgrade the SOFTWARE:
# RPM-UVH RPM Package Name
 
3. Uninstall the package:
# rpm-e RPM Package Name

4. Query the package details:
# RPM-QPI RPM Package Name

5. Query for a file that belongs to the RPM package:
# RPM-QF RPM Package Name

6. Check what files the package will write to the system:
# RPM-QPL RPM Package Name


*****************************************

Appendix:

"rpm Details"

First, install the package

Command format:

Rpm-i (or--install) options file1.rpm ... filen.rpm

Parameters:

file1.rpm. filen.rpm the file name of the RPM package to be installed

Detailed options:

-H (or--hash) output hash mark (' # ') during installation

--test only tests the installation and does not actually install it.

--percent outputs the progress of the installation as a percentage.

--excludedocs do not install the documentation files in the package

--includedocs Installation Documentation

--replacepkgs Force reinstallation of installed packages

--replacefiles replace files that belong to other packages--force Ignore package and file conflicts

--noscrīpts do not run pre-install and post-install scripts

--prefix Install the package to the specified path

--ignorearch not verifying the structure of the package

--ignoreos does not check the operating system that the package runs

--nodeps does not check dependency relationships

--ftpproxy used as an FTP proxy

--FTPPORT specifies that the port number for FTP is

Common options

-V Show additional information

-VV Display Debug Information

--root let RPM take the specified path as "root" so that the preinstallation and post-Setup programs will be installed in this directory

--rcfile set the RPMRC file to

--dbpath set the path of the RPM data inventory where

Example:

1. Installing the Software

RPM-IVH *.rpm

If you are prompted to install the software or for other reasons, but if we do want to execute the installation command, you can add a parameter "-replacepkgs" after-IVH.

2. Online Installation

Rpm-i ftp://ftp.* *.rpm

Ftp://ftp.* is the address *.rpm package

Ii. removal and uninstallation of software packages

Command format:

RPM-E (or--erase) options pkg1 ... pkgn

Parameters

Pkg1. PKGN: Package to remove

Detailed options

--test perform only the deleted tests

--noscrīpts do not run pre-install and post-install scripts

--nodeps does not check for dependencies

Common options

-VV Display Debug Information

--root let RPM take the specified path as "root" so that the preinstallation and post-Setup programs will be installed in this directory

--rcfile set the RPMRC file to

--dbpath set the path of the RPM data inventory where

Example:

1. Uninstalling the Software

Rpm-e *.rpm

Third, software upgrade

Command format

Rpm-u (or--upgrade) options file1.rpm ... filen.rpm

Parameters

file1.rpm. filen.rpm software package Name

Detailed options

-H (or--hash) output hash mark (' # ') during installation

--oldpackage allow "Upgrade" to an older version

--test only for upgrade testing

--excludedocs do not install the documentation files in the package

--includedocs Installation Documentation

--replacepkgs Force reinstallation of installed packages

--replacefiles replacing files belonging to other packages

--force ignoring package and file conflicts

--percent outputs the progress of the installation as a percentage.

--noscrīpts do not run pre-install and post-install scripts

--prefix Install the package to the specified path

--ignorearch not verifying the structure of the package

--ignoreos does not check the operating system that the package runs

--nodeps does not check dependency relationships

--ftpproxy used as an FTP proxy

--FTPPORT specifies that the port number for FTP is

Common options

-V Show additional information

-VV Display Debug Information

--root let RPM take the specified path as "root" so that the preinstallation and post-Setup programs will be installed in this directory

--rcfile set the RPMRC file to

--dbpath set the path of the RPM data inventory where

Example:

1. Upgrading the Software

RPM-UVH *.rpm

Note: The file name at this point must be the upgrade patch to upgrade the software

Iv. Inquiries

Command format:

Rpm-q (or--query) options

Parameters:

Pkg1 ... PKGN: Querying Installed Packages

Detailed options

-P (or "-") query the package file

-F query which package belongs to

-A queries all installed packages

--whatprovides query provides the functionality of the package

-G query packages that belong to a group

--whatrequires querying all packages that require functionality

Information options

Displays the full identity of the package

-I displays the package's summary information

-L display the list of files in the package

-C Display configuration file list

-D displays a list of document files

-S Displays the list of files in the package and displays the status of each file

--scrīpts display Install, uninstall, check script

--queryformat (or--QF) displays query information in a user-specified manner

--dump Show all verified information for each file

--provides displays the functionality provided by the package

--requires (or-r) displays the features required by the package

Common options

-V Show additional information

-VV Display Debug Information

--root let RPM take the specified path as "root" so that the preinstallation and post-Setup programs will be installed in this directory

--rcfile set the RPMRC file to

--dbpath set the path of the RPM data inventory where

1. Query whether a package is installed

Rpm-q *.rpm

2. View the contents of the software package

Rpm-qpi *.rpm

3. See what parts of the package will be installed in the system

RPM-QPL *.rpm

4. Quickly determine which package a file belongs to

RPM-QF *.rpm

5. List all installed RPM packages

Rpm–qa

V. Verifying the installed Packages

Command format:

Rpm-v (or--verify, or-y) options

Parameters

Pkg1. PKGN the package name to verify

Package options

-P Verify against package file

The package to which the-F checksum belongs

-A Verify check all packages

-G verifies all packages belonging to the group

Detailed options

--noscrīpts do not run a validation script

--nodeps not verifying dependencies

--nofiles not verifying file properties

Common options

-V Show additional information

-VV Display Debug Information

--root let RPM take the specified path as "root" so that the preinstallation and post-Setup programs will be installed in this directory

--rcfile set the RPMRC file to

--dbpath set the path of the RPM data inventory where

Example:

1. List all corrupted files

Rpm-va *.rpm

Vi. verifying the files in the package

Grammar:

Rpm-k (or--checksig) options file1.rpm ... filen.rpm

Parameters:

file1.rpm. filen.rpm software package file name

checksig--Detailed Options

--NOPGP not verifying PGP signatures

Common options

-V Show additional information

-VV Display Debug Information

--rcfile set the RPMRC file to

Seven, other RPM options

--REBUILDDB Rebuilding RPM Database

--INITDB Create a new RPM library

--quiet reduce the output as much as possible

--help Display Help files

--version Show current version of RPM

Common Command combinations:

-IVH: Installation shows installation progress--install--verbose--hash

-UVH: Upgrade package--update;

-QPL: Lists the file information in the RPM package [Query packages list];

-QPI: Lists the description information for RPM packages [Query Package Install pack (s)];

-QF: Find which rpm package the specified file belongs to [Query file];

-va: Check all RPM packages to find the missing files [View Lost];

-E: Remove Package

Rpm-q Samba//query program is installed

rpm-ivh/media/cdrom/redhat/rpms/samba-3.0.10-1.4e.i386.rpm# install and show progress by path

RPM-IVH--relocate/=/opt/gaimgaim-1.3.0-1.fc4.i386.rpm # Specify the installation directory

rpm-ivh --testgaim-1.3.0-1.fc4.i386.rpm > # used to check dependencies; not a real installation;

rpm-uvh--oldpackagegaim-1.3.0-1.fc4.i386.rpm # New version downgraded to old version

Rpm-qa | grep httpd #[Search Specifies whether RPM packages are installed]--all search *httpd*

RPM-QL httpd #[Search rpm Package]--list All files installation directory

Rpm-qpi linux-1.4-6.i368.rpm #[View RPM Packages]--query--package--install Package Information

RPM-QPF linux-1.4-6.i368.rpm #[View RPM Package]--file

RPM-QPR file.rpm #[View Package] Dependencies

Rpm2cpio file.rpm |cpio-div #[extract file]

RPM-IVH file.rpm 0> #[Installing the new Rpm]--install--verbose--hash

rpm-ivhhttp://mirrors.kernel.org/fedora/core/4/i386/os/fedora/rpms/gaim-1.3.0-1.fc4.i386.rpm

rpm-uvhfile.rpm c20> #[ upgrade a rpm]--upgrade

rpm-efile.rpm c34> #[Delete an RPM package]--erase

RPM Related issues Highlights

1. How do I 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, which means extracting the files. V indicates that the execution process
D is the same as make-directory, which means that the directory is created according to the original path of the file in the package
M indicates the time to keep the file updated.
2. How can I view the files and other information related to RPM packages?
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 do I get the full file name of a package?
Rpm-q MySQL can get the full name of the MySQL package installed in the system, from which you can get
Information such as the version of the current package. In this example, you can get information mysql-3.23.54a-11
4. Where are the files in one RPM package installed?
RPM-QL Package Name
Note Here is the name of the package that does not include the. rpm suffix
That means you can 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. Which files are included in a RPM package?
A package that has not been installed, using RPM-QLP ****.rpm
An already installed package, you can also use RPM-QL ****.rpm
6. How do I get information about a package's version, usage, etc.?
A package that has not been installed, using RPM-QIP ****.rpm
An already installed package, you can also use Rpm-qi ****.rpm
7. Which package is installed for a program, or which package contains the 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 quotation mark, but a ', the key in the upper left corner of the keyboard.
You can also use RPM-QILF to output package information and file lists
8. Which package is installed for a file, or which package contains this file?
Note that the method in the previous question only applies with the executable program, while the following method can not only
Can be used for executable programs, or for any normal file. The prerequisite is to know the file name.
First get the full path to the program, either with Whereis or which, and then using 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:
Obtain package-related information with rpm-q,q to query queries, followed by other options, such as
I means info, get the package information;
L represents list, obtains the file listing;
A represents all, and queries are executed in all packages;
f denotes file, and the relevant query according to the document;
P means package, query according to the packages
The required query conditions can be generated using grep, or from the command line in "'"
9. What is RPM?
RPM, Redhat package Management, is one of Redhat's inventions.
10. Why do I need RPM?
Under one operating system, you need to install a package that implements various functions. These packages generally have their own
Process, but it also has a complex dependency relationship. You also need to fix the version of the package, as well as the installation,
Configuration, uninstall the automation issue. To solve these problems, Redhat proposed a
A better way to manage hundreds of thousands of software. This is the RPM management system. The RPM management system is installed in the system.
Later, as long as it is compatible with the RPM file standard packaging program can be easily installed, upgrade, uninstall
11. Are all Linux using RPM?
Any system requires a package management system, so many Linux uses the RPM system. But the RPM system is specifically for RH
But Tl,mandrake and other systems also use RPM. Since the source program of RPM can be compiled on another system,
So it's possible to use RPMs on other systems as well.
In addition to RPM, some other systems also have their own package management programs, such as the Debian Deb package,
Slakware also has its own package management system.
Why is the file name of the 12.rpm package 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 version number of the software, 2 is the release number, TL is used for the TL operating system, may be RH and so on. i386 says
For the Intel x86 platform, and possibly for SPARC.
13. What does the i386,i686 in the package file name mean?
The file name of the RPM package includes not only the software name, version information, but also the applicable hardware architecture.
The information.
i386 refers to a computer (AI32) that this package applies to Intel's more than 80386 x86 architectures
i686 refers to computers (IA32) that this package applies to x86 architectures above intel80686 (Pentium Pro)
Noarch refers to this package is independent of the hardware architecture and can be used universally.
Programs for i686 packages are typically optimized for CPU, so backward-compatible comparisons are used to i386 packages
It can be used on x86 machines. Forward is generally incompatible. But now the computer, Pentium Pro, the following CPU has been very few
Normally configured machines can use the i686 package
14. Can I mix RPM packages issued by different operating systems?
For RPM packages that have been compiled into binary, they cannot be mixed due to different operating system environments.
For packages that are released in src.rpm, they can be compiled locally because they need to be installed, so they are usually available in different
Installed under the system.
15. Special issues encountered when using RPM
Q I use rpm-e **.rpm cannot delete rpm package
A package name does not include RPM,
RPM-E package name, can contain information such as version number, but can not have suffix. rpm
Q is there a tool for reading RPM files under MS System?
A wincmd with RPM plugins .....
Q can I install an upgrade RPM package via FTP installation?
A Yes. rpm-ivhftp://xxxxxxxx/path2somerpm
Q RPM installed when the package version is too high what to do?
A sometimes because the installed packages are too old, and the relevant package versions in the system are newer, some files that may need to be installed will not be found. There are two ways to solve this problem:
The first is to find in the system files and need the file functions of the same or similar files, do a symbolic link to the required directory.
The second is to download and install the new version of the package.

linux  Software Installation (rpm detailed)

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.