This is also a confusing question for new users. let's talk about my understanding of this issue. I. There are two types of rpm packages: binaryrpm and sourcerpmbinaryrpm.
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. by default, it saves time and speed,
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. the 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 a compiled binary file, which is available for installation. The latter is a source file that has not been compiled and can be installed only after rebuild.
How to install the. src. rpm Package
Some software packages end with. src. rpm. These software packages are rpm packages that contain source code and need to be compiled during installation. These software packages have two installation methods:
Method 1:
- # Rpm-I your-package.src.rpm
- # Cd/usr/src/redhat/SPECS
- # Rpmbuild-bp your-package.specs // A specs file with the same name as your package
- # Cd/usr/src/redhat/BUILD/your-package/a directory with the same name as your package
- #./Configure
- # Make
- # 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.