This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
aix:rpm_install [2021/01/01 21:22] 127.0.0.1 external edit |
aix:rpm_install [2025/06/03 18:05] (current) manu [RPM DB corrupt] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== RPM: install, list and uninstall ====== | ====== RPM: install, list and uninstall ====== | ||
+ | |||
+ | Packages sources : | ||
+ | http://www.perzl.org/aix/ | ||
Install / Update an RPM package (option i instead U for install only, it's better to use U in any case): | Install / Update an RPM package (option i instead U for install only, it's better to use U in any case): | ||
- | <code> | + | <cli prompt='#'> |
# rpm -Uhv httpd-2.2.15-1.aix5.1.ppc.rpm | # rpm -Uhv httpd-2.2.15-1.aix5.1.ppc.rpm | ||
- | </code> | + | </cli> |
force options: - -nodeps (ignore dependency) , - -ignoreos (to install a package build with an earlier version of AIX) | force options: - -nodeps (ignore dependency) , - -ignoreos (to install a package build with an earlier version of AIX) | ||
+ | Downgrade a package | ||
+ | <cli prompt='#'> | ||
+ | # rpm -Uvh --oldpackage [downloaded_lower_version_package] | ||
+ | </cli> | ||
List rpm packages installed: | List rpm packages installed: | ||
- | <code> | + | <cli prompt='#'> |
# rpm -qa | # rpm -qa | ||
- | </code> | + | </cli> |
List files into an RPM package installed: | List files into an RPM package installed: | ||
- | <code> | + | <cli prompt='#'> |
- | # rpm -ql zip-3.0-1 | + | # rpm -qlv zabbix-agent |
- | /opt/freeware/bin/zip | + | -rwxr-xr-x 1 root system 1457 Oct 19 15:44 /etc/rc.d/init.d/zabbix-agent |
- | /opt/freeware/bin/zipcloak | + | lrwxrwxrwx 1 root system 22 Oct 19 15:44 /etc/rc.d/rc2.d/Kzabbix-agent -> ../init.d/zabbix-agent |
- | /opt/freeware/bin/zipnote | + | lrwxrwxrwx 1 root system 22 Oct 19 15:44 /etc/rc.d/rc2.d/Szabbix-agent -> ../init.d/zabbix-agent |
- | /opt/freeware/bin/zipsplit | + | -rw-r--r-- 1 root system 15575 Oct 19 15:44 /etc/zabbix/zabbix_agentd.conf |
- | /opt/freeware/doc/zip-3.0 | + | drwxr-xr-x 2 root system 0 Oct 19 15:44 /etc/zabbix/zabbix_agentd.d |
- | /opt/freeware/doc/zip-3.0/CHANGES | + | -rwxr-xr-x 1 root system 6341227 Oct 19 15:44 /opt/freeware/bin/zabbix_get |
- | /opt/freeware/doc/zip-3.0/LICENSE | + | -rwxr-xr-x 1 root system 7522635 Oct 19 15:44 /opt/freeware/bin/zabbix_sender |
- | /opt/freeware/doc/zip-3.0/README | + | -rw-r--r-- 1 root system 4901 Oct 19 15:44 /opt/freeware/man/man1/zabbix_get.1 |
- | /usr/bin/zip | + | -rw-r--r-- 1 root system 14962 Oct 19 15:44 /opt/freeware/man/man1/zabbix_sender.1 |
- | /usr/bin/zipcloak | + | -rw-r--r-- 1 root system 3899 Oct 19 15:44 /opt/freeware/man/man8/zabbix_agentd.8 |
- | /usr/bin/zipnote | + | -rwxr-xr-x 1 root system 9719766 Oct 19 15:44 /opt/freeware/sbin/zabbix_agentd |
- | /usr/bin/zipsplit | + | lrwxrwxrwx 1 root system 33 Oct 19 15:44 /usr/bin/zabbix_get -> ../../opt/freeware/bin/zabbix_get |
- | </code> | + | lrwxrwxrwx 1 root system 36 Oct 19 15:44 /usr/bin/zabbix_sender -> ../../opt/freeware/bin/zabbix_sender |
+ | lrwxrwxrwx 1 root system 37 Oct 19 15:44 /usr/sbin/zabbix_agentd -> ../../opt/freeware/sbin/zabbix_agentd | ||
+ | drwxr-xr-x 2 zabbix zabbix 0 Oct 19 15:44 /var/log/zabbix | ||
+ | drwxr-xr-x 2 zabbix zabbix 0 Oct 19 15:44 /var/run/zabbix | ||
+ | </cli> | ||
List package from which the file depend: | List package from which the file depend: | ||
- | <code> | + | <cli prompt='#'> |
# rpm -qf /usr/bin/mysql | # rpm -qf /usr/bin/mysql | ||
mysql-3.23.52-3 | mysql-3.23.52-3 | ||
- | </code> | + | </cli> |
Uninstall an rpm package: | Uninstall an rpm package: | ||
- | <code> | + | <cli prompt='#'> |
# rpm -e zip-3.0-1 | # rpm -e zip-3.0-1 | ||
- | </code> | + | </cli> |
- | Remove duplicate entry of rpm package: | + | To extract RPM files from a package => use CPIO from freeware |
- | <code> | + | <cli prompt='#'> |
- | # rpm -e --justdb <package-version> | + | [root@aix01]/export/softs/zabbix/zabbix_agent_5.0.17-1# rpm2cpio zabbix-agent-5.0.17-1.aix7.2.ppc.rpm | /opt/freeware/bin/cpio -idmv |
- | </code> | + | ./etc/rc.d/init.d/zabbix-agent |
+ | ./etc/rc.d/rc2.d/Kzabbix-agent | ||
+ | ./etc/rc.d/rc2.d/Szabbix-agent | ||
+ | ./etc/zabbix/zabbix_agentd.conf | ||
+ | ./etc/zabbix/zabbix_agentd.d | ||
+ | ... | ||
+ | </cli> | ||
+ | Check rpm package checksum | ||
+ | <cli prompt='#'> | ||
+ | # rpm -Kvv libqb-2.0.2-1.db2pcmk.el8.x86_64.rpm | ||
+ | D: loading keyring from pubkeys in /var/lib/rpm/pubkeys/*.key | ||
+ | D: couldn't find any keys in /var/lib/rpm/pubkeys/*.key | ||
+ | D: loading keyring from rpmdb | ||
+ | D: serialize failed, using private dbenv | ||
+ | D: opening db environment /var/lib/rpm cdb:private:0x401 | ||
+ | D: opening db index /var/lib/rpm/Packages 0x400 mode=0x0 | ||
+ | D: locked db index /var/lib/rpm/Packages | ||
+ | D: opening db index /var/lib/rpm/Name 0x400 mode=0x0 | ||
+ | D: read h# 431 Header SHA1 digest: OK (7607620a7fc71d534fe59a60dece8de02703e63c) | ||
+ | D: added key gpg-pubkey-d88e42b4-52371eca to keyring | ||
+ | D: read h# 437 Header SHA1 digest: OK (22824a5fcbad49190bcc2dd45d06b4b53aad2447) | ||
+ | D: added key gpg-pubkey-fd431d51-4ae0493b to keyring | ||
+ | D: read h# 438 Header SHA1 digest: OK (2355c07f9978587c537d385c0bdd9353214f7032) | ||
+ | D: added key gpg-pubkey-2fa658e0-45700c69 to keyring | ||
+ | D: read h# 442 Header SHA1 digest: OK (dd737a402556b7653c2bc971f343532046e26384) | ||
+ | D: added key gpg-pubkey-352c64e5-52ae6884 to keyring | ||
+ | D: read h# 457 Header SHA1 digest: OK (a2d8377102268dd4cf467cd46d9413c29832e110) | ||
+ | D: added key gpg-pubkey-a14fe591-578876fd to keyring | ||
+ | D: read h# 835 Header SHA1 digest: OK (cd1fc24b8ab1b1eec4021a4e5828eddd4554adb0) | ||
+ | D: added key gpg-pubkey-00f97f56-467e318a to keyring | ||
+ | D: read h# 890 Header SHA1 digest: OK (6fd848e1a8354d69e3f3728c8717e4ecbf325def) | ||
+ | D: added key gpg-pubkey-a663d36e-3cd9959a to keyring | ||
+ | D: read h# 924 Header SHA1 digest: OK (f4c664d12065958014b7271dfa93fda80055d732) | ||
+ | D: added key gpg-pubkey-06d62707-582074e8 to keyring | ||
+ | D: Using legacy gpg-pubkey(s) from rpmdb | ||
+ | D: Expected size: 118112 = lead(96)+sigs(4404)+pad(4)+data(113608) | ||
+ | D: Actual size: 118112 | ||
+ | libqb-2.0.2-1.db2pcmk.el8.x86_64.rpm: | ||
+ | Header SHA1 digest: OK (6c728acd3bb8c2fa1f6aa63dd3b5f1c1f7e2c6c0) | ||
+ | MD5 digest: OK (5dbaf4cdeeb948a011927e29ac62165f) | ||
+ | D: closed db index /var/lib/rpm/Name | ||
+ | D: closed db index /var/lib/rpm/Packages | ||
+ | D: closed db environment /var/lib/rpm | ||
- | ====== RPM: informations about an RPM package before install ====== | + | # rpm -K libqb-2.0.2-1.db2pcmk.el8.x86_64.rpm |
+ | libqb-2.0.2-1.db2pcmk.el8.x86_64.rpm: sha1 md5 OK | ||
+ | </cli> | ||
+ | ====== RPM: informations about an RPM package before install ====== | ||
| | ||
List files into RPM package: | List files into RPM package: | ||
- | <code> | + | <cli prompt='#'> |
# rpm -qpl freetype2-2.3.11-1.aix5.1.ppc.rpm | # rpm -qpl freetype2-2.3.11-1.aix5.1.ppc.rpm | ||
/opt/freeware/doc/freetype2-2.3.11 | /opt/freeware/doc/freetype2-2.3.11 | ||
Line 58: | Line 114: | ||
/opt/freeware/lib/libfreetype.a | /opt/freeware/lib/libfreetype.a | ||
/usr/lib/libfreetype.a | /usr/lib/libfreetype.a | ||
- | </code> | + | </cli> |
List RPM package description: | List RPM package description: | ||
- | <code> | + | <cli prompt='#'> |
# rpm -qpi rpm2/freetype2-2.3.11-1.aix5.1.ppc.rpm | # rpm -qpi rpm2/freetype2-2.3.11-1.aix5.1.ppc.rpm | ||
Name : freetype2 Relocations: (not relocateable) | Name : freetype2 Relocations: (not relocateable) | ||
Line 80: | Line 136: | ||
The library is available as 32-bit and 64-bit. | The library is available as 32-bit and 64-bit. | ||
- | </code> | + | </cli> |
- | Extract .spec file from an rpm package: | + | List requirements to install an RPM package: |
- | <code> | + | <cli prompt='#'> |
- | rpm2cpio {FullNameOfRPM} | cpio -iumd {NameOfRPM.spec} | + | |
- | </code> | + | |
- | + | ||
- | Extract all files from an rpm package: | + | |
- | <code> | + | |
- | root@timesrv:/tmp# rpm2cpio /tmp/tsm/TIVsm-BA.x86_64.rpm | cpio -idmv | + | |
- | </code> | + | |
- | + | ||
- | List requirements to install an RPM package (rpm -qpR): | + | |
- | <code> | + | |
# rpm --requires -qp freetype2-2.3.11-1.aix5.1.ppc.rpm | # rpm --requires -qp freetype2-2.3.11-1.aix5.1.ppc.rpm | ||
zlib | zlib | ||
libc.a(shr.o) | libc.a(shr.o) | ||
libz.a(libz.so.1) | libz.a(libz.so.1) | ||
- | </code> | + | </cli> |
Print the scripts (postinstall, preinstall, unistall) contained into an RPM package: | Print the scripts (postinstall, preinstall, unistall) contained into an RPM package: | ||
- | <code> | + | <cli prompt='#'> |
# rpm --scripts -qp httpd-2.2.15-1.aix5.1.ppc.rpm | # rpm --scripts -qp httpd-2.2.15-1.aix5.1.ppc.rpm | ||
preinstall script (through /bin/sh): | preinstall script (through /bin/sh): | ||
Line 116: | Line 162: | ||
/usr/sbin/rmuser -p apache || : | /usr/sbin/rmuser -p apache || : | ||
/usr/sbin/rmgroup apache || : | /usr/sbin/rmgroup apache || : | ||
- | </code> | + | </cli> |
====== RPM: create a package ====== | ====== RPM: create a package ====== | ||
- | <code> | + | Compile your libraries and binaries and put them on the relative target path starting to /opt/freeware/src/packages/BUILD |
- | Se mettre sur 1 machine AIX5.2 (car les .rpm ont une compatibilité ascendante) | + | |
- | Créer un fichier .spec dans /opt/freeware/src/packages/SPECS | + | Create a spec file with the files names |
+ | <cli prompt='#'> | ||
+ | [root@labo]/opt/freeware/src/packages# cat SPECS/libssh2\-1.11.1.spec | ||
+ | Name: libssh2 | ||
+ | Version: 1.11.1 | ||
+ | Release: 2 | ||
+ | Summary: A library implementing the SSH2 protocol | ||
- | Ex : logrorate-3.5.9.spec | + | Group: System Environment/Libraries |
+ | License: BSD | ||
+ | URL: https://app-bldns01-h.oi.bdl.lu/doku.php?id=aix:libssh2_compile | ||
+ | Source0: https://github.com/libssh2/libssh2.git | ||
+ | BuildRequires: zlib-devel | ||
+ | BuildRequires: pkg-config, make | ||
+ | BuildRequires: libgcc >= 6.3.0-1 | ||
+ | Requires: zlib | ||
+ | Requires: libgcc >= 8.3.0-1 | ||
+ | |||
+ | %description | ||
+ | libssh2 is a library implementing the SSH2 protocol as defined by | ||
+ | Internet Drafts: SECSH-TRANS(22), SECSH-USERAUTH(25), | ||
+ | SECSH-CONNECTION(23), SECSH-ARCH(20), SECSH-FILEXFER(06)*, | ||
+ | SECSH-DHGEX(04), and SECSH-NUMBERS(10). | ||
+ | |||
+ | The library is available as 32-bit and 64-bit. | ||
+ | |||
+ | %files | ||
+ | /opt/freeware/lib/libssh2.a | ||
+ | /opt/freeware/lib64/libssh2.a | ||
+ | |||
+ | %changelog | ||
+ | * Tue Jun 04 2024 - 1.11.1-1 | ||
+ | - Build custom | ||
+ | </cli> | ||
+ | |||
+ | Test package creation, and adapt the file location (depnding from RPM generation!) | ||
+ | <cli prompt='#'> | ||
+ | [root@labo]/opt/freeware/src/packages# /usr/bin/rpmbuild -bb SPECS/libssh2-1.11.1.spec | ||
+ | Processing files: libssh2-1.11.1-2.ppc | ||
+ | error: File not found: /var/tmp/libssh2-1.11.1-2.ppc/opt/freeware/lib/libssh2.a | ||
+ | error: File not found: /var/tmp/libssh2-1.11.1-2.ppc/opt/freeware/lib64/libssh2.a | ||
+ | |||
+ | RPM build errors: | ||
+ | File not found: /var/tmp/libssh2-1.11.1-2.ppc/opt/freeware/lib/libssh2.a | ||
+ | File not found: /var/tmp/libssh2-1.11.1-2.ppc/opt/freeware/lib64/libssh2.a | ||
+ | |||
+ | |||
+ | [root@labo]/opt/freeware/src/packages# mkdir -p /var/tmp/libssh2-1.11.1-2.ppc/opt/freeware/lib | ||
+ | [root@labo]/opt/freeware/src/packages# mkdir -p /var/tmp/libssh2-1.11.1-2.ppc/opt/freeware/lib64/ | ||
+ | [root@labo]/opt/freeware/src/packages# cp BUILD/opt/freeware/lib/libssh2.a /var/tmp/libssh2-1.11.1-2.ppc/opt/freeware/lib | ||
+ | [root@labo]/opt/freeware/src/packages# cp BUILD/opt/freeware/lib64/libssh2.a /var/tmp/libssh2-1.11.1-2.ppc/opt/freeware/lib64 | ||
+ | </cli> | ||
+ | |||
+ | Now you are ready to build the RPM package | ||
+ | <cli prompt='#'> | ||
+ | [root@systemh]/opt/freeware/src/packages# /usr/bin/rpmbuild -bb SPECS/libssh2\-1.11.1.spec | ||
+ | Processing files: libssh2-1.11.1-2.ppc | ||
+ | warning: Deprecated external dependency generator is used! | ||
+ | Finding Provides: /usr/opt/rpm/lib/rpm/find-provides | ||
+ | Finding Requires(interp): | ||
+ | Finding Requires(rpmlib): | ||
+ | Finding Requires(verify): | ||
+ | Finding Requires(pre): | ||
+ | Finding Requires(post): | ||
+ | Finding Requires(preun): | ||
+ | Finding Requires(postun): | ||
+ | Finding Requires(pretrans): | ||
+ | Finding Requires(posttrans): | ||
+ | Finding Requires: /usr/opt/rpm/lib/rpm/find-requires | ||
+ | Finding Conflicts: | ||
+ | Finding Obsoletes: | ||
+ | Finding Recommends: | ||
+ | Finding Suggests: | ||
+ | Finding Supplements: | ||
+ | Finding Enhances: | ||
+ | Provides: libssh2 = 1.11.1-2 libssh2.a(libssh2.so.1) | ||
+ | Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 | ||
+ | Requires: libc.a(shr.o) libc.a(shr_64.o) libcrypto.a(libcrypto.so.3) libgcc_s.a(shr.o) | ||
+ | Wrote: /opt/freeware/src/packages/RPMS/ppc/libssh2-1.11.1-2.aix7.2.ppc.rpm | ||
+ | Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.DJB7ea | ||
+ | + umask 022 | ||
+ | + cd /opt/freeware/src/packages/BUILD | ||
+ | + /bin/rm -rf /var/tmp/libssh2-1.11.1-2.ppc | ||
+ | + RPM_EC=0 | ||
+ | + jobs -p | ||
+ | + exit 0 | ||
+ | [root@systemh]/opt/freeware/src/packages# ll /opt/freeware/src/packages/RPMS/ppc/libssh2-1.11.1-2.aix7.2.ppc.rpm | ||
+ | 684 -rw-r--r-- 1 root system 697152 Jun 4 17:23 /opt/freeware/src/packages/RPMS/ppc/libssh2-1.11.1-2.aix7.2.ppc.rpm | ||
+ | [root@systemh]/opt/freeware/src/packages# rpm -qpl /opt/freeware/src/packages/RPMS/ppc/libssh2-1.11.1-2.aix7.2.ppc.rpm | ||
+ | /opt/freeware/lib/libssh2.a | ||
+ | /opt/freeware/lib64/libssh2.a | ||
+ | </cli> | ||
+ | |||
+ | Another example of spec file | ||
+ | |||
+ | create a spec file .spec dans /opt/freeware/src/packages/SPECS | ||
+ | |||
+ | Ex : logrorate-3.5.9.spec | ||
+ | <code> | ||
Summary : A utility for rotate log following different parmeters. | Summary : A utility for rotate log following different parmeters. | ||
Name : logrotate | Name : logrotate | ||
Line 189: | Line 330: | ||
mv $latest latest | mv $latest latest | ||
done | done | ||
+ | </cli> | ||
+ | |||
+ | ====== ERRORS ====== | ||
+ | |||
+ | ===== YUM lua_newuserdata ===== | ||
+ | |||
+ | After upgrading the rpm package db4, RPMDB is corrupt | ||
+ | <cli prompt='#'> | ||
+ | root@devsrv - /mnt/rpm # yum update | ||
+ | There was a problem importing one of the Python modules | ||
+ | required to run yum. The error leading to this problem was: | ||
+ | |||
+ | rtld: 0712-001 Symbol lua_newuserdata was referenced | ||
+ | from module /usr/opt/rpm/lib/librpmio.so(), but a runtime definition | ||
+ | of the symbol was not found. | ||
+ | |||
+ | Please install a package which provides this module, or | ||
+ | verify that the module is installed correctly. | ||
+ | |||
+ | It's possible that the above module doesn't match the | ||
+ | current version of Python, which is: | ||
+ | 2.7.18 (default, Dec 15 2022, 05:12:43) | ||
+ | [GCC 8.3.0] | ||
+ | |||
+ | If you cannot solve this problem yourself, please go to | ||
+ | the yum faq at: | ||
+ | http://yum.baseurl.org/wiki/Faq | ||
+ | </cli> | ||
+ | |||
+ | uninstall the packages yum (rpm -qa | grep yum) | ||
+ | <code> | ||
+ | yum-metadata-parser-1.1.4-2.ppc | ||
+ | yum-3.4.3-8.noarch | ||
+ | </code> | ||
+ | |||
+ | Download and install the DNF bundle instead from https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/ezinstall/ppc/ | ||
+ | |||
+ | <cli prompt='#'> | ||
+ | root@devsrv - /mnt/dnf_bundle_aix_71_72_v8# ./install_dnf.sh -d | ||
</cli> | </cli> | ||