Install the RPM Package in Linux (1) _ MySQL

Source: Internet
Author: User
Tags rpmbuild
1. how to install the rpm package rmp package can be completed using the program rpm. Run the following command rpm-iyour-package.rpm where the your-package.rpm is the file name of the rpm package you want to install, typically placed under the current directory. The following warning or prompt may appear during installation:... conflictwith... it may be that there is a LinuxRPM in the package to be installed.

1. how to install the rpm software package
You can use the program rpm to install the rmp package. Run the following command:
Rpm-I your-package.rpm
The your-package.rpm is the file name of the rpm package you want to install, usually under the current directory.
The following warning or prompt may appear during installation:
... Conflict with... may be that some files in the package to be installed may overwrite the existing
In this case, you cannot correctly install the file.
Rpm -- force-I force installation
... Is needed...
... Is not installed... some software required for this package can be used without installation
Rpm -- nodeps-I to ignore this information
That is to say, rpm-I -- force -- nodeps can ignore all dependencies and file problems.
Can be installed, but this forced installation of software packages cannot guarantee full functionality

2. how to install the. src. rpm software package
Some software packages end with. src. rpm. These software packages are rpm packages that contain source code.
Compilation is required. There are two installation methods for such software packages,
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.

3. how to uninstall the rpm software package
Run the command rpm-e package name. The package name can contain the version number and other information, but cannot have a suffix. rpm.
For example, to uninstall a software 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
It cannot be in 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 some errors or warnings:
... Is needed by... this indicates that this software is required by other software and cannot be detached.
You can use rpm-e -- nodeps to force uninstall

4. how to get files in the rpm package without installing
Use tools rpm2cpio and cpio
Rpm2cpio xxx. rpm | cpio-vi
Rpm2cpio xxx. rpm | cpio-idmv
Rpm2cpio xxx. rpm | cpio -- extract -- make-directories
The parameter I is the same as the extract parameter, indicating that the file is extracted. V indicates the execution process.
D is the same as make-directory, which indicates creating a directory based on the original path of the file in the package.
M indicates the file update time.

5. how to view files and other information related to the rpm Package
All of the examples below assume that the software package mysql-3.23.54a-11 is used
1. I installed those rpm packages in my system
Rpm-qa: list all installed packages
If you want to find all installed software packages that contain a string of SQL
Rpm-qa | grep SQL

2. how to obtain the full name of a software package file
Rpm-q mysql can obtain the full name of the mysql software package installed in the system.
The version of the current software package. The information mysql-3.23.54a-11 can be obtained in this example

3. where is the file in an rpm Package installed?
Rpm-ql package name
Note that the software package name does not include the. rpm suffix.
That is to say, 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 is put, you can also use which, such
Which mysql

4. files contained in an rpm Package
For a software package that has not been installed, use rpm-qlp *****. rpm
You can also use rpm-ql *****. rpm to install a software package.

5. how can I obtain the version, usage, and other information about a software package?
For a software package that has not been installed, use rpm-qip *****. rpm
You can also use rpm-qi *****. rpm to install a software package.

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.