Rpm: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=Internal= | =Internal= | ||
* [[Linux#Commands|Linux]] | * [[Linux#Commands|Linux]] | ||
=Overview= | =Overview= | ||
=List of Packages and Versions Installed= | =List of Packages and Versions Installed= | ||
<syntaxhighlight lang='bash'> | |||
< | |||
rpm -qa | rpm -qa | ||
</ | </syntaxhighlight> | ||
=Query a Specific Package= | =Query a Specific Package= | ||
<syntaxhighlight lang='bash'> | |||
< | |||
rpm -q <package-name-without-version> | rpm -q <package-name-without-version> | ||
</ | </syntaxhighlight> | ||
This will display the specific package(s) installed on the system, including version information. | This will display the specific package(s) installed on the system, including version information. | ||
More details can be obtained as follows: | More details can be obtained as follows: | ||
==Query for Package Information== | ==Query for Package Information== | ||
<syntaxhighlight lang='bash'> | |||
< | |||
rpm -q -i <full-package-name-including-version> | rpm -q -i <full-package-name-including-version> | ||
</ | </syntaxhighlight> | ||
Example: | Example: | ||
<syntaxhighlight lang='bash'> | |||
< | |||
rpm -q -i dell-system-update-1.4.0-17.02.00.x86_64 | rpm -q -i dell-system-update-1.4.0-17.02.00.x86_64 | ||
</ | </syntaxhighlight> | ||
==Query for Files Installed by the Package== | ==Query for Files Installed by the Package== | ||
<syntaxhighlight lang='bash'> | |||
rpm -q -l <full-package-name-including-version> | |||
</syntaxhighlight> | |||
Example: | |||
<syntaxhighlight lang='bash'> | |||
rpm -q -l dell-system-update-1.4.0-17.02.00.x86_64 | |||
</syntaxhighlight> | |||
=Installing a Package= | |||
<syntaxhighlight lang='bash'> | |||
rpm -i yum-3.2.22-37.el5.noarch.rpm | |||
</syntaxhighlight> | |||
< | If the package has unsatisfied references, it will report them, and obviously they will need to be installed first. | ||
==Changing the Location during Installation== | |||
</ | Without any argument, the installation will be made into the directory intended by the package creator. To change the destination, use | ||
<syntaxhighlight lang='bash'> | |||
--prefix NEWPATH | |||
</syntaxhighlight> | |||
that works for relocatable binary packages, where NEWPATH will be the new installation prefix. The package builder must first design their package to give users this freedom. | |||
To find whether a package is relocatable or not: | |||
= | <syntaxhighlight lang='bash'> | ||
rpm -qi <pagckage-name> | grep Relocations | |||
</syntaxhighlight> | |||
=Updating a Package= | =Updating a Package= | ||
<syntaxhighlight lang='bash'> | |||
rpm -U | |||
rpm -Uvh | |||
</syntaxhighlight> | |||
=Removing a Package= | =Removing a Package= | ||
< | <syntaxhighlight lang='bash'> | ||
rpm -e <package-name> | rpm -e <package-name> | ||
</ | </syntaxhighlight> |
Latest revision as of 20:44, 1 January 2024
Internal
Overview
List of Packages and Versions Installed
rpm -qa
Query a Specific Package
rpm -q <package-name-without-version>
This will display the specific package(s) installed on the system, including version information.
More details can be obtained as follows:
Query for Package Information
rpm -q -i <full-package-name-including-version>
Example:
rpm -q -i dell-system-update-1.4.0-17.02.00.x86_64
Query for Files Installed by the Package
rpm -q -l <full-package-name-including-version>
Example:
rpm -q -l dell-system-update-1.4.0-17.02.00.x86_64
Installing a Package
rpm -i yum-3.2.22-37.el5.noarch.rpm
If the package has unsatisfied references, it will report them, and obviously they will need to be installed first.
Changing the Location during Installation
Without any argument, the installation will be made into the directory intended by the package creator. To change the destination, use
--prefix NEWPATH
that works for relocatable binary packages, where NEWPATH will be the new installation prefix. The package builder must first design their package to give users this freedom.
To find whether a package is relocatable or not:
rpm -qi <pagckage-name> | grep Relocations
Updating a Package
rpm -U
rpm -Uvh
Removing a Package
rpm -e <package-name>