rpm
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| rpm [2012/04/12 19:11] – [SPEC file sections explained] k2patel | rpm [2020/08/10 02:35] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| 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:// | Many hints information taken from original site [[http:// | ||
| + | ==== RPM Common Command ==== | ||
| + | |||
| + | ^ Syntax ^Description^ | ||
| + | | rpm -ivh {rpm-file} | Install the package | | ||
| + | | rpm -Uvh {rpm-file} | Upgrade package | | ||
| + | | rpm -ev {package} | Erase/ | ||
| + | | rpm -ev --nodeps {package} | Erase/ | ||
| + | | rpm -qa | Display list all installed packages | | ||
| + | | rpm -qi {package} | Display installed information along with package version and short description | | ||
| + | | rpm -qf {/ | ||
| + | | rpm -qc {pacakge-name} | Display list of configuration file(s) for a package | | ||
| + | | rpm -qcf {/ | ||
| + | | 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: | ||
| </ | </ | ||
| + | ==== Something i come across ==== | ||
| + | If you wanna override marco from OS you can define value at '' | ||
| + | <code bash> | ||
| + | %define _mandir /usr/man | ||
| + | </ | ||
| ==== Sample RPM ==== | ==== Sample RPM ==== | ||
| <code bash | sample.spec> | <code bash | sample.spec> | ||
| Line 216: | Line 239: | ||
| [[http:// | [[http:// | ||
| + | ==== 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 | ||
| + | %preun | ||
| + | %postun | ||
| + | | ||
| + | %triggerun | ||
| + | %triggerpostun | ||
| + | </ | ||
| + | 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: | ||
| </ | </ | ||
| + | |||
| + | ==== Error on Building ==== | ||
| + | === module: command not found === | ||
| + | Try running following command and then execute rpmbuild will resolve the issue. | ||
| + | <code bash> | ||
| + | source / | ||
| + | </ | ||
| ==== MOCK ==== | ==== MOCK ==== | ||
| Line 267: | Line 314: | ||
| </ | </ | ||
| + | == Building SRPM == | ||
| + | <code bash> | ||
| + | mock -r epel-6-x86_64 --spec icinga-web.spec --sources=../ | ||
| + | </ | ||
| ==== Copying Files ==== | ==== Copying Files ==== | ||
| <note important> | <note important> | ||
| Line 292: | Line 343: | ||
| In general case result will be stored in '/ | In general case result will be stored in '/ | ||
| - | ==== RPM Spec File Information | + | ==== SPEC file Overview |
| This is mostly from following URL [[http:// | This is mostly from following URL [[http:// | ||
| <code text> | <code text> | ||
| - | SPEC file overview | ||
| Other useful guides: | Other useful guides: | ||
| Line 812: | Line 862: | ||
| Also see Packaging/ | Also see Packaging/ | ||
| </ | </ | ||
| + | |||
| + | ==== Custom Built RPM ==== | ||
| + | |||
| + | [[http:// | ||
rpm.1334257887.txt.gz · Last modified: 2020/08/10 02:29 (external edit)
