RPM package uses a common problem

xiaoxiao2021-03-06  160

This FAQ answers the following questions

1. How to install uninstalling using the RPM package

2. How to query about the RPM package

3. Some special issues when using RPM

4. Some knowledge about RPM packages

At the same time, it is recommended to read the essence -> Application Software -> Software Package Management -> RPM Questions Solutions "," Everyone to do rpm "

1. How to install the RPM package

The installation of the RMP package can be done using the program RPM. 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, generally placed in the current directory.

The following warnings or prompts may appear during installation:

... conflict with ... may be that some files to be installed may overwrite

File, the default, in such cases, it is not possible to install correctly.

RPM --force -i forced installation

... Is Needed by ...

... Is Not Installed ... Some software you need this package you are not installed

RPM --Nodeps -i to ignore this information

That is, rpm -i --force --Node can ignore all dependencies and file issues, what packages

Can be installed, but this forced installation package cannot guarantee full functionality

2. How to install .src.rpm package

Some packages are ending with .src.rpm, such packages are RPM packs that contain source code, at installation

Need to compile. This type of software package has two installation methods,

method one:

Execute rpm -i your-package.src.rpm

2. CD / USR / SRC / RedHat / Specs

3. rpmbuild -bp your-package.specs a SPECS file with your package

4. CD / USR / SRC / RedHat / Build / Your-Package / One Directory with your package

5. ./configure, the same as compiling normal source software, you can add parameters

6. Make

7. make install

Method Two:

Execute rpm -i you-package.src.rpm

2. CD / USR / SRC / RedHat / Specs

The first two steps and methods

3. rpmbuild -bb your-package.specs a SPECS file with your packages

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.

Perform rpm -i new-package.rpm can be installed.

3. How to uninstall the RPM package

Use the command rpm -e package name, the package name can contain the version number and other information, but can not have suffix.rpm

For example, uninstalling packages 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't 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 some errors or warnings:

... Is Needed by ... This shows that this software is needed by other software, and it cannot be uninstalled casually.

Can be enforced with rpm -e --Nodeps

4. How to do not install but get the file in the RPM package

Tools RPM2CPIO and CPIO

RPM2CPIO XXX.RPM | CPIO -VI

RPM2CPIO XXX.RPM | CPI -IDMV

RPM2CPIO XXX.rpm | CPIO --EXTRACT --MAKE-DIRECTORIES

Parameters I and Extract are the same, indicating extracted files. v represents the instruction execution process

D and make-directory are the same, indicating that the directory is established according to the original path in the package.

m represents the update time of keeping the file.

5. How to view files related to RPM packages and other information

All of the following examples are assumed to use the software package Mysql-3.23.54A-11

1. I have installed those RPM packages in my system.

RPM -QA lectures all installed packages

If you want to find all installed packages containing a string SQL

RPM -QA | GREP SQL

2. How to get a full name of a file for a package

RPM -Q MySQL can get the full name of the MySQL package installed in the system, from which you can get

The current package of packages, etc. This example can be obtained in information mysql-3.23.54a-11

3. The file in an RPM package is installed there?

RPM-QL package name

Note that this is the name of a package that does not include. Rpm suffix.

That is to say, only mysql or mysql-3.23.54a-11 is not mysql-3.23.54a-11.rpm.

If you just want to know that the executive is going there, you can use Which, such as

Which mysql

4. An RPM package contains those files

A package that has not been installed, using rpm -qlp ****. Rpm

An already installed package, you can also use rpm -ql ****. Rpm

5. How do I get related information about a package, use and other related information?

A package that has not been installed, using rpm -qip ****. Rpm

An already installed package, you can also use rpm -qi ****. Rpm

6. Which package is installed in a program, or which package contains this program

RPM -QF `Which program name` Return to the full name of the package

RPM -QIF `Which program name` Return to package information

RPM -QLF `Which program name` Return to the file list of package

Note that this is not quotation, but it is the key in the upper left corner of the keyboard.

You can also use rpm -qilf, and output software package information and list list.

7. Which package is installed in a file, or which package contains this file?

Note that the method in the previous problem is only applicable to executable programs, and the following method can not only

Used for executable, or for ordinary any files. The premise is to know this file name.

First get the full path to this program, you can use WHEREIS or WHICH, then use 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

to sum up:

Getting the information related to the package uses rpm -q, Q represents query Query, which can be followed by other options, such as

i represents Info, obtain information of the package;

l Represents List, obtain a list of files;

a represents all, execute a query in all packets;

f represents File, according to the relevant query; P Represents package, query according to the package

The required query conditions can be generated using GREP, or generate from the command line in "` `"

6. Some relevant knowledge about the RPM package

What is RPM?

RPM is REDHAT PACKAGEMENT, is one of the invention of redhat

2. Why do I need RPM?

Under an operating system, you need to install a package that implements various functions. These packages are generally

Program, but there is also an intricate dependency. At the same time, you need to solve the version of the package, and install,

Automation issues for configuring, unloading. In order to solve these problems, Redhat puts forward for your own system.

Good ways to manage thousands of software. This is the RPM management system. RPM management system is installed in the system

Later, as long as it is a package that complies with the RPM file standard, it can be easily installed, upgrade, and uninstall.

3. Is all Linux use RPM?

Any system requires a package management system, so many Linux use the RPM system. But the RPM system is special for RH

But TL, Mandrake, etc. also use rpm. Since rpm's source program can be compiled in other systems,

Therefore, it is possible to use RPM on other systems.

In addition to rpm, other systems also have their own package management programs, such as Debian's DEB package,

Slakware also has its own package management system

4. Why is the file name of the 4.RPM package?

The file name of the RPM package contains version information, operating system information, hardware requirements, etc. of this package.

For example, mypackage-1.1-2tl.i386.rpm, where mypackage is the name of the package registered in the system

1.1 is the version number of the software, 2 is the issuance number, TL represents the TL operating system, may also be RH, etc. i386

For the Intel X86 platform, it may also be SPARC.

5. What is the meaning of I386, i686 in the package file name?

In the file name of the RPM package, not only includes the software name, version information, but also the applicable hardware architecture

Information.

I386 refers to this package to apply a computer for an X86 architecture over Intel 80386 (Ai32)

I686 refers to the software package to apply the X86 architecture of Intel 80686 or more (above Pentium PRO) (IA32)

NOARCH means that this package is unrelated to the hardware architecture, which can be universal.

The program of the I686 package is usually optimized for the CPU, so it is compatible with backward compatibility, the i386 package is

The x86 machine can be used. It is generally not compatible forward. But now the computer, the CPU below the Pentium Pro has little

Use, usually configured machines can use I686 package

6. Can the RPM package issued by different operating systems can be mixed?

For a binary RPM package that has been compiled into binary, it is generally not mixed due to the operating system environment.

For software packs issued in src.rpm, you can usually be in different due to local compilation of the need to install,

Install under the system.

7. Some special issues encountered when using RPM

Q I use rpm -e **. Rpm cannot delete the RPM package

A package name does not include rpm,

RPM -E package name, can include the version number and other information, but can not have suffix.rpm

Q Is there a tool for reading a RPM file under the system of MS?

A Wincmd with rpm plugins .....

Q Can I upgrade the RPM package installed by FTP installation?

A can. RPM -IVH ftp: // xxxxxxxx / path2somerpm

Q rpm has too much package version when installed?

A Sometimes because the installed software package is too old, and the version related package version is relatively new, it may be necessary

Some files that have been installed can not be found. At this time, there are two solutions.

The first is to find the same or similar files in the system file, and make a symbolic link to

Under the directory you need.

The second is to download the new version of the package.

转载请注明原文地址:https://www.9cbs.com/read-128216.html

New Post(0)