This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
aix:rpm_install [2021/11/03 15:48] manu |
aix:rpm_install [2025/06/03 18:05] (current) manu [RPM DB corrupt] |
||
---|---|---|---|
Line 10: | Line 10: | ||
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: | ||
Line 46: | Line 50: | ||
<cli prompt='#'> | <cli prompt='#'> | ||
# rpm -e zip-3.0-1 | # rpm -e zip-3.0-1 | ||
+ | </cli> | ||
+ | |||
+ | To extract RPM files from a package => use CPIO from freeware | ||
+ | <cli prompt='#'> | ||
+ | [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 | ||
+ | ./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 -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> | </cli> | ||
Line 110: | Line 166: | ||
====== 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 182: | Line 333: | ||
====== ERRORS ====== | ====== 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> | ||
===== RPM DB corrupt ===== | ===== RPM DB corrupt ===== |