installation of binary/source package software in Linux rpm__linux

Source: Internet
Author: User
Tags bz2 mixed unpack rpmbuild

One or two in-system distribution (binary package in *.rpm form, *.tar.gz/*.tgz, *.bz2 binary package)

(i), *.rpm form of binary packages

Installation: Rpm–ivh packagename.rpm

Uninstall: Rpm-e PackageName

(ii), *.tar.gz/*.tgz, *.bz2 form of binary packages

Installation: Tar zxvf *.tar.gz or tar yxvf *.bz2

Uninstalling: Deleting manually

Description: *.tar.gz/*.bz2 form of the binary package is the use of the TAR tools to package, with GZIP/BZIP2 compression, the installation of a direct solution package can be.  For software that has only a single directory after decompression, uninstall with the command "RM-RF software directory Name", if the file is dispersed in multiple directories after decompression, you must one by one manual deletion (slightly troublesome), want to know what files are installed to the system during decompression, you can use the command "tar ztvf *.tar.gz"/"tar YTVF *.bz2 "Get the list. Tar parameter z is called gzip decompression, X is unpack, V is checksum, F is display result, Y is call bzip2 decompression, T is List of file packages. For more parameters Please refer to the man page: Man tar. If you prefer the graphical interface operation, you can use KDE's Ark compressed file management tool under X-window.


(iii) software packages to provide installation procedures

Such packages already provide installation scripts or binary installation wizards (Setup, install, install.sh, etc.) that can be installed by simply running it, while uninstalling scripts or programs are provided accordingly. For example, Sun's StarOffice Office software suite uses the installer named Setup and provides the ability to reverse install after the software is installed, so there is less of this type of package because it installs and unloads the same way as Windows software, so there is no need to say more.


Second, the source distribution version

(i) *.src.rpm form of source code package

At the end of the. src.rpm, this type of package is a source-code RPM package that needs to be compiled at installation time. This package is the source code RPM package, if the direct use of RPM-IVH to install, will be found in the/usr/src/redhat/sources directory a tar.gz packaged source code package. That means you need to manually unpack and compile the installation. But it can be used directly: Rpmbuild --rebuild xxxxx.src.rpm, to directly compile the source code rpm package into a normal binary RPM package. After executing the above command, you can go to the/USR/SRC/REDHAT/RPMS/ A usable binary RPM package is found in the I386 directory. This type of package has the following kinds of installation methods:

Method 1:

Rpmbuild--rebuild *.src.rpm (if not, try it: rpm--rebuild *.src.rpm or rpm--recompile *.src.rpm)

Cd/usr/src/redhat/rpms/i386

RPM-IVH *.rpm

Method 2:

1. Implementation of Rpm-i you-package.src.rpm

2. Cd/usr/src/redhat/specs

3. RPMBUILD-BB your-package.specs A specs file with the same name as your package

At this point, in/usr/src/redhat/rpm/i386/(depending on the package, it could be i686,noarch, etc.) in this directory, there is a new RPM package, which is a compiled binary file. Execution: RPM–IVH new-package.rpm can be installed and completed.

Method 3:

1. Implementation of Rpm-i your-package.src.rpm

2. Cd/usr/src/redhat/specs

3. RPMBUILD-BP your-package.specs A specs file with the same name as your package

4. cd/usr/src/redhat/build/your-package/a directory with the same name as your package

5./configure This step is the same as compiling common source software, you can add parameters

6. Make

7. Make Install

Uninstall: Rpm-e Packgename

(ii) *.TAR.GZ/*.TGZ, *.bz2 form of source code packages


Installation: Tar zxvf *.tar.gz or tar yxvf *.bz2 first extract

Then go to the unpacked directory:

./configure configuration (./configure--help)

Make compilation

Make install Installation

Uninstalling: Make uninstall or manually removed

Note: It is recommended to read the description file after decompression, you can understand what needs to install, if necessary, you need to change the compilation configuration. The source code for some packages can be uninstalled with the make install command after compiling the installation, and if this feature is not available, the uninstall of the software must be manually removed. Since software may be able to distribute files across multiple directories of the system, it is often difficult to remove them cleanly, then you should configure them before compiling to specify that the software will be installed to the target path:./configure--prefix= directory name, so you can use the RM-RF software directory name command to perform a clean and thorough uninstall. It is most difficult to build a user's own installation compared to other installation methods.
[Install]rpm Installation Tips
Link: http://www.linuxdiyf.com/viewarticle.php?id=4714

1. How to install the RPM package
RMP software packages can be installed using the program RPM to complete. Execute the following command
Rpm-i your-package.rpm
Where your-package.rpm is the file name of the RPM package you want to install, typically placed in the current directory.
The following warnings or prompts may appear during the installation:
... conflict with ... There may be some files in the package to be installed that might overwrite the existing
Files that are not properly installed by default when they are available
RPM--force-i forced installation can be
... is needed by ...
... is not installed ... Some of the software you need for this package is not available for installation
RPM--nodeps-i to ignore this information
In other words, rpm-i--force--nodeps can ignore all dependencies and file problems, what package
Can be installed, but this forced-install package does not guarantee full functionality

2. How to install. SRC.RPM Packages
Some packages end with. src.rpm, which is an RPM package that contains the source code, and at the time of installation
Need to compile. There are two ways to install this type of package.
Method One:
1. Implementation of Rpm-i your-package.src.rpm
2. Cd/usr/src/redhat/specs
3. RPMBUILD-BP your-package.specs A specs file with the same name as your package
4. cd/usr/src/redhat/build/your-package/a directory with the same name as your package
5./configure This step is the same as compiling common source software, you can add parameters
6. Make
7. Make Install

Method Two:
1. Implementation of Rpm-i you-package.src.rpm
2. Cd/usr/src/redhat/specs
The first two steps are the same as the method one
3. RPMBUILD-BB your-package.specs A specs file with the same name as your package
At this time, in/usr/src/redhat/rpm/i386/(depending on the specific package, it may be i686,noarch, etc.)
In this directory, there is a new RPM package, which is a compiled binary file.
The execution of Rpm-i new-package.rpm can be completed by installation.

3. How to uninstall the RPM package
Using the command RPM-E package name, the package name can contain information such as version number, but no suffix can be used. rpm
For example, uninstall package Proftpd-1.2.8-1, you can use the following format:
Rpm-e Proftpd-1.2.8-1
Rpm-e proftpd-1.2.8
Rpm-e proftpd-
Rpm-e proftpd
Can not be the following format:
Rpm-e proftpd-1.2.8-1.i386.rpm
Rpm-e proftpd-1.2.8-1.i386
Rpm-e proftpd-1.2
Rpm-e proftpd-1
Sometimes there are errors or warnings:
... is needed by ... This means that the software is required by other software, can not be easily unloaded
You can force uninstall with Rpm-e--nodeps

4. 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.

5. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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 "'"

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

2. 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

3. 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.

4.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.

5. 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

6. 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.

7. 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.

Source: HTTP://FORUM.EEPW.COM.CN/THREAD/262947/1

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.