Newbie School: software installation package in Linux

Source: Internet
Author: User
Tags rpmbuild
Article Title: newbie School: software installation package in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

This is also a confusing question for new users. Let's talk about my understanding of this issue.

I. rpm package

Rpm packages, which can be binary rpm and source rpm.

Binary rpm is the most commonly used. It has been compiled and can be directly installed.

I used to want to install software through rpm when I was studying linux. However, it is easy to install software through rpm, but you have nothing to set up, as a teacher said in the past, for example, installing windows and ms experts and installing me, there is no difference, because there is nothing you can do.

This is actually the case when you use rpm for installation. The advantage is of course that everything is simple and everything is installed by default. Save time, fast,

Ii. Source Code

If we download the source code, a compilation is involved here.

In linux, all programs are developed with c. So how can we make the cpu understand the programs developed with c? Then the compiler and gcc compiler are required, convert the code into the code recognized by the machine. Cpu only recognizes 0 and 1.

When the source code is compiled into binary code, you can install it on your machine.

If we download binary code and binary code, mysql is used as an example. mysql downloads binary code. After decompression, in fact, it can be used directly.

Source code is a code written by a programmer,

Binary code is the machine running code.

Source code must pass compile to become binary code.

How to score? Run the file command to see the following:

Tar-zxvf some.version.tar.gz

Cd some

File *

$ File source. file

$ File binary. file

There are two types of RPM: binary rpm and source rpm.

The former is compiled binary and can be installed.

The latter is a source that has not been compiled. It must be rebuilt before installation.

How to install. Src. rpm Software Package

Some software packages are. Src. rpm ends. This type of software package contains the source code rpm package and needs to be compiled during installation. There are two installation methods for such software packages.

Method 1:

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

6. # make

7. # make install

Method 2:

1. # 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. In this case, under the directory/usr/src/redhat/RPM/i386/(depending on the specific package, it may be i686, noarch, etc, there is a new rpm package, which is a compiled binary file.

4. # rpm-I new-package.rpm can be installed.

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.