In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
The rpm command manual and the operation method of viewing the installation path of the rpm installation package. In view of this problem, this article introduces in detail the corresponding analysis and solutions, hoping to help more partners who want to solve this problem to find a more simple and easy way.
Rpm-qpl xxxxxx.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, which is usually placed in the current directory.
The following warnings or prompts may appear during installation:
... Conflict with... It may be that some files in the package to be installed may overwrite the existing ones.
Files that cannot be installed correctly by default can be used
Rpm-- force-I can be installed forcefully
... Is needed by...
... Is not installed... Some of the software required by this package is available if you don't have it installed.
Rpm-- nodeps-I to ignore this information
In other words, rpm-I-- force-- nodeps can ignore all dependencies and file problems, what package
Can be installed, but this forced installation of the software package is not guaranteed to fully function
two。 How to install the .src.rpm package
Some packages, which end with .src.rpm, are rpm packages that contain source code and are installed at the time of installation
Needs to be compiled. There are two ways to install this kind of software package
Method 1:
1. Execute rpm-I your-package.src.rpm
2. Cd / usr/src/redhat/SPECS
3. Rpmbuild-bp your-package.specs an specs file with the same name as your software package
4. Cd / usr/src/redhat/BUILD/your-package/ a directory with the same name as your software package
5. / configure this step is the same as compiling ordinary source 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 one.
3. Rpmbuild-bb your-package.specs an specs file with the same name as your software package
At this point, in / usr/src/redhat/RPM/i386/ (depending on the package, it could be i686, no arch, etc.)
In this directory, there is a new rpm package, and this is the compiled binary.
Execute rpm-I new-package.rpm to complete the installation.
3. How to uninstall the rpm package
Use the command rpm-e package name, which can contain information such as the version number, but cannot have the suffix. rpm
For example, to uninstall the 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
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 errors or warnings:
... Is needed by... This shows that this software is needed by other software and cannot be uninstalled casually.
You can use rpm-e-- nodeps to force uninstall
4. How to get the files in the rpm package without installing
Use the 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 extract, which indicates that the file is extracted. V indicates the execution process
D is the same as make-directory, which means that the directory is established according to the original path of the files in the package.
M indicates the time to keep the file updated.
5. How to view files and other information related to rpm packages
All of the following examples assume the use of the package mysql-3.23.54a-11
1. Those rpm packages are installed on my system
Rpm-qa will list all installed packages
If you want to find all installed packages that contain a string sql
Rpm-qa | grep sql
two。 How to get the full file name of a software package
Rpm-Q mysql can get the full name of the mysql software package installed in the system, from which you can get
Information such as the version of the current package. In this example, you can get the information mysql-3.23.54a-11.
3. Where are the files in a rpm package installed?
Rpm-ql package name
Note that here is the name of the package that does not include the .rpm suffix.
That means 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, you can also use which, such as
Which mysql
4. A rpm package contains those files
An uninstalled software package, using rpm-qlp *. Rpm
A software package that has already been installed can also be used with rpm-ql *. Rpm
5. How to get information about the version, purpose and so on of a software package?
An uninstalled software package, using rpm-qip *. Rpm
A software package that has already been installed can also be used with rpm-qi *. Rpm
6. Which package is installed for a program, or which package contains the program
Rpm-qf `which program name` returns the full name of the software package
Rpm-qif `which program name` returns information about the software package
Rpm-qlf `which program name` returns the file list of the package
Notice that this is not the quotation mark, but `, the key in the upper left corner of the keyboard.
You can also use rpm-qilf to output package information and file list
7. Which package installed a file, or which package contains this file
Note that the method in the previous question only applies to executable programs, while the following method can not only
For executable programs, can also be used for any ordinary file. As long as you know the file name.
First get the full path to the program, using whereis or which, and 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:
To get the information related to the software package, use rpm-Q _ Q _ Q to indicate the query query, followed by other options, such as
I stands for info and gets the information of the software package.
L stands for list and gets a list of files
A stands for all and executes queries in all packages
F stands for file and makes relevant queries according to the file.
P stands for package and is queried according to the software package
The required query conditions can be generated using grep or from the command line in "``"
6. Some knowledge about rpm software package
1. What is rpm?
Rpm, or RedHat Package Management, is one of the inventions of RedHat.
two。 Why do you need rpm
Under an operating system, you need to install software packages that implement various functions. These software packages generally have their own
Programs, but also have intricate dependencies. At the same time, you also need to solve the version of the software package and install it.
Configuration, uninstall automation problems. In order to solve these problems, RedHat proposed a
A better way to manage hundreds of thousands of software. This is the RPM management system. The rpm management system is installed in the system.
In the future, any packaged program that conforms to the rpm file standard can be easily installed, upgraded, and uninstalled.
3. Do all linux use rpm?
Any system requires a package management system, so many linux use rpm systems. But the rpm system is dedicated to RH.
But systems such as TL,Mandrake also use rpm. Because the source program of rpm can be compiled on other systems
So it is possible to use rpm on other systems as well
In addition to rpm, some other systems also have their own package management programs, such as debian's deb package
Slakware also has its own package management system.
Why is the file name of the 4.rpm package so long?
The file name of the rpm package contains version information of the package, operating system information, hardware requirements, and so on.
For example, mypackage-1.1-2TL.i386.rpm, where mypackage is the name of the software package registered in the system
1. 1 is the version number of the software, 2 is the release number, and TL indicates that it is used in the TL operating system, possibly RH, and so on. I386 means
For intel x86 platforms, and possibly sparc and so on.
5. What is the meaning of i386 in the file name of the software package
The file name of the rpm package contains not only the software name and version information, but also the applicable hardware architecture.
It's a message.
I386 refers to computers (AI32) with x86 architecture above intel 80386.
I686 refers to computers with x86 architecture (IA32) with intel 80686 or above (Pentium pro or above).
Noarch means that this software package is independent of hardware architecture and can be used in general.
I686 software packages are usually optimized for CPU, so backward compatibility comparison is used for i386 packages in the
It can be used on x86 machines. Forward is generally incompatible. However, in today's computers, there are very few CPU below Pentium pro.
Yes, usually configured machines can use i686 software packages
6. Can rpm packages issued by different operating systems be mixed?
Generally, rpm packages that have been compiled into binary cannot be mixed due to different operating system environments.
For packages distributed in src.rpm, because they need to be compiled locally at installation time, you can usually use different
Installed under the system.
7. Some special problems encountered when using rpm
Q I can't delete the rpm package with rpm-e * * .rpm
A package name does not include rpm
Rpm-e package name, which can contain information such as version number, but cannot have the suffix. rpm
Does Q have a tool to read RPM files under MS's system?
A wincmd with rpm plugins.
Q can I install and upgrade the rpm package through ftp installation?
A Yes. Rpm-ivh
Ftp://xxxxxxxx/PATH2SomeRPM
What if the existing package version of Q rpm is too high when it is installed?
A sometimes because the installed package is too old and the version of the relevant package in the system is relatively new, you may need to
Some files that the installed package depends on will not be found. There are two solutions.
The first is to find files in the system files that have the same or similar functions as the files you need, and make a symbolic link to the
Under the directory you need.
The following is how I know how to specify the installation path when installing a rpm package under Linux, many of which I learned online. Please give me a lot of advice.
The following options can be done the way you want.
-- prefix
This sets the installation prefix to for
Relocatable packages.
-- relocate =
For relocatable packages, translates the files that
Would be put in to.
-- badreloc
To be used in conjunction with-- relocate, this
Forces the relocation even if the package isn't
Relocatable.
-- noorder
Don't reorder the packages for an install. The list
Of packages would normally be reordered to satisfy
Dependancies.
RPM Command Manual
I. installation
Command format:
Rpm-I (or-- install) options file1.rpm... FileN.rpm
Parameters:
File1.rpm... The file name of the RPM package that fileN.rpm will install
Detailed options:
-h (or-- hash) output hash token (``#'') during installation
-- test only tests the installation, not the actual installation.
-- percent outputs the progress of installation as a percentage.
-- excludedocs does not install documentation files in the package
-- includedocs installation documentation
-- replacepkgs forces reinstallation of already installed packages
-- replacefiles replaces files belonging to other software packages
Force ignores conflicts between software packages and files
-- noscripts does not run pre-installation and post-installation scripts
-- prefix installs the package to the path specified by
-- ignorearch does not verify the structure of the package
-- ignoreos does not check the operating system on which the package is running
-- nodeps does not check dependency relationships
-- ftpproxy is used as a FTP proxy
-- ftpport specifies that the port number of FTP is
General option
-v display additional information
-vv displays debugging information
-- root asks RPM to take the specified path as the "root directory", so that both the pre-installer and the post-installer will be installed in this directory
-- rcfile sets rpmrc file to
-- dbpath sets the path where the RPM data inventory is located
2. Delete
Command format:
Rpm-e (or-- erase) options pkg1... PkgN
Parameters.
Pkg1... PkgN: the package to be deleted
Detailed option
-- test only performs deleted tests
-- noscripts does not run pre-installation and post-installation scripts
-- nodeps does not check for dependencies
General option
-vv displays debugging information
-- root asks RPM to take the specified path as the "root directory", so that both the pre-installer and the post-installer will be installed in this directory
-- rcfile sets rpmrc file to
-- dbpath sets the path where the RPM data inventory is located
III. Upgrade
Command format
The code is as follows:
Rpm-U (or-- upgrade) options file1.rpm... FileN.rpm
Parameters.
File1.rpm... Name of the fileN.rpm software package
Detailed option
-h (or-- hash) output hash token (``#'') during installation
-- oldpackage allows "upgrade" to an older version
-- test only tests for upgrades
-- excludedocs does not install documentation files in the package
-- includedocs installation documentation
-- replacepkgs forces reinstallation of already installed packages
-- replacefiles replaces files belonging to other software packages
Force ignores conflicts between software packages and files
-- percent outputs the progress of installation as a percentage.
-- noscripts does not run pre-installation and post-installation scripts
-- prefix installs the package to the path specified by
-- ignorearch does not verify the structure of the package
-- ignoreos does not check the operating system on which the package is running
-- nodeps does not check dependency relationships
-- ftpproxy is used as a FTP proxy
-- ftpport specifies that the port number of FTP is
General option
-v display additional information
-vv displays debugging information
-- root asks RPM to take the specified path as the "root directory", so that both the pre-installer and the post-installer will be installed in this directory
-- rcfile sets rpmrc file to
-- dbpath sets the path where the RPM data inventory is located
IV. Inquiry
Command format:
The code is as follows:
Rpm-Q (or-- query) options
Parameters:
Pkg1... PkgN: query installed software packages
Detailed option
-p (or ``-'') query the files of the software package
-f query which software package it belongs to
-a query for all installed software packages
-- whatprovides query functional software packages
-g query the software packages belonging to the group
-- whatrequires queries all software packages that require functionality
Information option
Displays the full identity of the software package
-I display the summary information of the software package
-l displays a list of files in the package
-c display a list of profiles
-d displays a list of document files
-s displays a list of files in the package and displays the status of each file
-- scripts displays installation, uninstall and verification scripts
-- queryformat (or-- qf) displays query information in a user-specified manner
-- dump displays all verified information for each file
-- provides displays the functions provided by the software package
-- requires (or-R) displays the functions required by the software package
General option
-v display additional information
-vv displays debugging information
-- root asks RPM to take the specified path as the "root directory", so that both the pre-installer and the post-installer will be installed in this directory
-- rcfile sets rpmrc file to
-- dbpath sets the path where the RPM data inventory is located
5. Verify the installed software packages
Command format:
The code is as follows:
Rpm-V (or-- verify, or-y) options
Parameters.
Pkg1... The name of the package to be verified by pkgN
Package option
-p Verify against package file
-f check the software package to which it belongs
-a Verify verifies all software packages
-g verify all software packages belonging to the group
Detailed option
-- noscripts does not run verification scripts
-- nodeps does not verify dependencies
-- nofiles does not verify file attributes
General option
-v display additional information
-vv displays debugging information
-- root asks RPM to take the specified path as the "root directory", so that both the pre-installer and the post-installer will be installed in this directory
-- rcfile sets rpmrc file to
-- dbpath sets the path where the RPM data inventory is located
Verify the files in the software package
Syntax:
The code is as follows:
Rpm-K (or-- checksig) options file1.rpm... FileN.rpm
Parameters:
File1.rpm... File name of the fileN.rpm package
Checksig-- detail options
-- nopgp does not verify PGP signature
General option
-v display additional information
-vv displays debugging information
-- rcfile sets rpmrc file to
7. Other RPM options
-- rebuilddb rebuilds RPM database
-- initdb creates a new RPM database
-- quiet reduces output as much as possible
-- help displays help files
-- version displays the current version of RPM
On the rpm command manual and view the rpm installation package installation path of the operation of the question is shared here, I hope the above content can be of some help to you, if you still have a lot of doubts have not been solved, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.