Install * src. rpm in Linux

Source: Internet
Author: User
Tags rpmbuild

 

 

Src. rpm is the source package and can be used only after compilation. After installation, the source code is used. After rebuild, the rpm package will be generated.

 

Method:

 

Example 1:

Download complete:

[Root @ localhost beinan] # ls unrar *

Unrar-3.5.2-1.2.fc4.src.rpm unrar. spec

Install the source package unrar-3.5.2-1.2.fc4.src.rpm; Have a look at where installed?

[Root @ localhost beinan] # rpm-ivh unrar-3.5.2-1.2.fc4.src.rpm

Install it here:

[Root @ localhost beinan] # ls/usr/src/redhat/SOURCES/unrar

Unrarsrc-3.5.2.tar.gz

Then we use unrar. spec to execute it. In fact, it is a compiled script;

[Root @ localhost beinan] # rpmbuild -- ba unrar. spec

Compilation completed:

[Root @ localhost beinan] # ls/usr/src/redhat/RPMS/i386/

Unrar-3.5.2-1.i386.rpm unrar-debuginfo-3.5.2-1.i386.rpm

Can it be installed?

[Root @ localhost beinan] # rpm-ivh/usr/src/redhat/RPMS/i386/unrar-3.5.2-1.i386.rpm

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

1: unrar ####################################### #### [100%]

Is it available?

[Root @ localhost beinan] # unrar x mydoc.rar

Clean up junk files: If you often use this method to compile RPM packages, you can mainly clean up the contents of various directories in/usr/src/redhat;

 

Example 2:

Method 1:

1. Execute 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 code software. You can add Parameters

6. make

7. make install

 

Method 2:

1. Execute rpm-I you-package.src.rpm

2. cd/usr/src/redhat/SPECS

The first two steps are the same as method 1.

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)

 

There is a new rpm package under this Directory, which is a compiled binary file.

 

Run the rpm-I new-package.rpm to complete the installation.

 

This article is from the WebOS blog

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.