This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
rpm [2013/10/28 19:25] k2patel [MOCK] |
rpm [2020/08/10 02:35] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== RPM ====== | ====== RPM ====== | ||
+ | |||
+ | * [[ Python packages to rpm ]] | ||
Package management system few tips / trick to build / modify / work with packages. \\ | Package management system few tips / trick to build / modify / work with packages. \\ | ||
Many hints information taken from original site [[http://rpm.org/ | RPM]] | Many hints information taken from original site [[http://rpm.org/ | RPM]] | ||
+ | ==== RPM Common Command ==== | ||
+ | |||
+ | ^ Syntax ^Description^ | ||
+ | | rpm -ivh {rpm-file} | Install the package | | ||
+ | | rpm -Uvh {rpm-file} | Upgrade package | | ||
+ | | rpm -ev {package} | Erase/remove/ an installed package | | ||
+ | | rpm -ev --nodeps {package} | Erase/remove/ an installed package without checking for dependencies | | ||
+ | | rpm -qa | Display list all installed packages | | ||
+ | | rpm -qi {package} | Display installed information along with package version and short description | | ||
+ | | rpm -qf {/path/to/file} | Find out what package a file belongs to i.e. find what package owns the file | | ||
+ | | rpm -qc {pacakge-name} | Display list of configuration file(s) for a package | | ||
+ | | rpm -qcf {/path/to/file} | Display list of configuration files for a command | | ||
+ | | rpm -qa --last | Display list of all recently installed RPMs | | ||
+ | | rpm -qpR {.rpm-file} | Find out what dependencies a rpm file has | | ||
+ | | rpm -qR {package} | ::: | | ||
+ | | rpm -qR bash | ::: | | ||
==== How to Print .spec file from RPM ==== | ==== How to Print .spec file from RPM ==== | ||
Line 125: | Line 143: | ||
</code> | </code> | ||
+ | ==== Something i come across ==== | ||
+ | If you wanna override marco from OS you can define value at ''top'' of the spec file. | ||
+ | <code bash> | ||
+ | %define _mandir /usr/man | ||
+ | </code> | ||
==== Sample RPM ==== | ==== Sample RPM ==== | ||
<code bash | sample.spec> | <code bash | sample.spec> | ||
Line 216: | Line 239: | ||
[[http://rpm.org/wiki/Docs#PackagerDocumentation | RPM Official]] | [[http://rpm.org/wiki/Docs#PackagerDocumentation | RPM Official]] | ||
+ | ==== Scriptlets ==== | ||
+ | |||
+ | Normally, rpm has scriptlets inside the spec file that are | ||
+ | ran at install time. These are: | ||
+ | <code bash> | ||
+ | %pre - Run before rpm files are installed. | ||
+ | %post - Run after rpm files are installed. | ||
+ | %preun - Run before rpm files are erased. | ||
+ | %postun - Run after rpm files are erased. | ||
+ | %triggerin - Install trigger. | ||
+ | %triggerun - uninstall trigger | ||
+ | %triggerpostun - postuninstall trigger. | ||
+ | </code> | ||
+ | The scripts are normally bash scripts, but you can change the interpreter | ||
+ | with the -p option. | ||
+ | |||
+ | Also, as they are bash scripts you can call external scripts from these. | ||
==== General RPM Command ==== | ==== General RPM Command ==== | ||
Line 223: | Line 263: | ||
</code> | </code> | ||
+ | |||
+ | ==== Error on Building ==== | ||
+ | === module: command not found === | ||
+ | Try running following command and then execute rpmbuild will resolve the issue. | ||
+ | <code bash> | ||
+ | source /etc/profile.d/modules.sh | ||
+ | </code> | ||
==== MOCK ==== | ==== MOCK ==== | ||
Line 815: | Line 862: | ||
Also see Packaging/RPMMacros and RPM Guide chapter 9. | Also see Packaging/RPMMacros and RPM Guide chapter 9. | ||
</code> | </code> | ||
+ | |||
+ | ==== Custom Built RPM ==== | ||
+ | |||
+ | [[http://rpm.k2patel.in|my repository]] |