RedHat RPM software package usage common problem

xiaoxiao2021-03-06  40

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 ... It may be that some files to be installed may overwrite existing files, which cannot be installed correctly when it is default. Enforce installation with rpm --force -i. ... is needed by ... is not installed ... Some software required for this package You don't have this information with rpm --Nodeps -i.

Rpm -i --force - nodeps

All dependencies and file issues can be ignored, and what packages can be installed, but this forced installed package cannot guarantee full functionality.

2, how to install .src.rpm package:

Install the RPM-Build package before installing. Src.rpm package.

Some packages are ending with .SRC.rpm, such packages are RPM packs that contain source code, need to compile during installation. This type of package has two installation methods:

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 your package with your package 4. CD / usr / src / redhat / build / your-package / one directory with your packages 5. ./configure is the same as compiling normal source software, you can add parameters 6. make 7. make install

Method 2: 1. Perform rpm -i you-package.src.rpm 2. CD / usr / src / redhat / specs (first two steps and methods) 3. RPMBuild -bb your-package.specs one and you SPECS file with the same name

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, this is compiled

binary file. carried out:

RPM -i new-package.rpm is 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 it is not a 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 there will be some errors or warnings: ... is needed by ... This shows that this software is needed by other software, and it cannot be used casually.

RPM -E - Nodeps forced uninstallation.

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 | CPIO -IDMV RPM2CPIO XXX.RPM | CPI --EXTRACT --MAKE-DIRECTORIES

I and Extract: extract files. v: Indicates execution process D and make-directory: Establish a directory M: keep the file update time according to the file in the package. 5, how to view files and other information related to RPM packages:

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

1. What RPM packages are installed 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 obtain full names installed in the system, from which you can get information such as current packages. This example can be obtained in information mysql-3.23.54a-11

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

Note that the name of the package that does not include the .RPM suffix is ​​that only Mysql or MySQL-3.23.54A-11 is not mysql-3.23.54a-11.rpm. If you just want to know

The executable is there to go there, or you can use Which MySQL.

4. One RPM package contains those files?

A package that has not been installed, uses rpm -qlp ****. RPM a package already installed, 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, uses rpm -qip ****. RPM A 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 RPM -QIF `Which program name` Return to the package for the information RPM -QLF `Which program name` Return to the package list

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 the package information and a list of files.

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

Note that the method in the previous problem is to apply only to the executable program, and the following method can be used not only for executable, but also for any file. 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

Summary: The information related to the package is obtained with rpm -q, Q represents query Query, and it 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 queries in all packets; File, according to the query; P Represents package, according to package

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

6. Some relevant knowledge about the RPM package:

1. What is RPM?

RPM 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 generally have their own procedures, but there is also an intricate dependency. At the same time, you need to solve it.

The version of the package, as well as the installation, configuration, and unloading automation. In order to solve these problems, Redhat puts a better way to manage thousands of soft.

Part. This is the RPM management system. After the RPM management system is installed in the system, it is convenient to install, upgrade, and uninstall as long as it is a package that complies with the RPM file standard.

3. Isn't all Linux use RPM?

Any system requires a package management system, so many Linux use the RPM system. In addition to the RPM system, RPM is also used for RH special design TL, MANDRAKE and other systems. Due to the source of RPM

The order can be compiled on another system, so it is possible to use RPM on another system. 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. such as:

mypackage-1.1-2tl.i386.rpm

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 represents the INTEL X86 platform, which may also be SPARC.

5. What does I386 in the package file name mean?

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

I386 refers to this software package applies to the X86 architecture of Intel 80386 (AI32). I686 refers to this software package applies to a computer (IA32) of the X86 architecture of Intel 80686 or more (above Pentium PRO). 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 used backward compatible comparison to the I386 package can be used on the X86 machine. It is generally not compatible forward. But now the computer

The CPU below Pentium Pro has little use, and the usual configured machines can use the 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 installed under different systems because you need to install it.

7. Some special issues encountered when using RPM:

Q I use rpm -e **. Rpm cannot delete the RPM package A package name Do not include RPM, RPM -e package name, can contain 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 system related package version is new, some files that may not be installed can not be found. There are two solutions at this time:

1. It is a file that is the same or similar to the file functionality that needs to be found in the system file, and makes a symbolic link to the required directory. 2. It is to download the new version of the package.

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

New Post(0)