AIX Open Source

 View Only

AIX Open Source Support Tips - Remove all RPMs from system and install DNF

By Jan Harris posted Wed May 25, 2022 06:44 PM

  
The AIX Toolbox team recommends using DNF (the next-generation replacement for YUM) to install and manage Open Source software packages and dependencies from the AIX Toolbox. Some users are not able to install AIX Toolbox packages due to conflicting files from non-Toolbox sources.  There is a way to clean the database, then install DNF.

Important!!!!!  This is an unsupported method, provided as a 'last resort option' to possibly avoid the need to reinstall the operating system.  

  • All /opt/freeware packages and related files will be removed. 
  • It is recommended to make a system backup, or JFS2 snapshot of /opt before proceeding.



1) Recommended: Make a system backup, or JFS2 snapshot of /opt before proceeding.

2) Download the destroyRPMS ro remove all all RPMS installed on the system.
  • https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/contrib/destroyRPMS

3) Download the dnf install script.
  • https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/ezinstall/ppc/dnf_aixtoolbox.sh

4) Run the destroyRPMS script.
# chmod +x destroyRPMS
# ./destroyRPMS

WARNING:
This script removes all RPMS installed on the system,
removes the RPM database, and removes the rpm.rte install
image. It also removes root configuration for GNOME and KDE.
You should exit KDE and GNOME and run this from a root console.

You will most likely see several error messages because all RPMS
are being clobbered in no particular order, so removal of dependencies
may cause some deinstall scripts to fail and many 'directory not
empty' messages to appear. Since your goal is removal of all RPMS,
these errors should not be of concern.

Proceed to destroy all RPMs on the system? y/(n) y

<... installation output....>

PLEASE NOTE:
Your rpms have been removed, but rpm.rte did not deinstall.
Most likely this means that you have another installp fileset that
lists rpm.rte as a dependency.
If you really want to remove rpm.rte, you will need to deinstall those
dependencies as well. If you do not, then you still have rpm.rte
installed, but it is now non-functional. To make it functional again,
simply reinstall rpm.rte with the force option. For example, change
to the directory where you have the rpm.rte image and run:
installp -qacXFd rpm.rte all


Your rpms have been removed, but the /opt/freeware and /usr/opt/freeware
directories (one is just a symbolic link) have been left present.
You may want to look through these directories for any files you may have
created yourself. If there is nothing that you want to save, you can now
remove these directories and any remaining contents within.


Now, in steps 5-8, prepare to run the dnf_aixtoolbox.sh script.
The current rpm.rte file set is not complete, since many files and directories were removed. For example, the lppchk -c returns errors:
# lppchk -c rpm.rte
lppchk: File /usr/opt/freeware/src/packages/SRPMS could not be located.
lppchk: File /usr/opt/freeware/src/packages/RPMS/noarch could not be located.
lppchk: File /usr/opt/freeware/src/packages could not be located.
lppchk: File /usr/opt/freeware/info could not be located.
lppchk: File /usr/opt/freeware/src/packages/RPMS could not be located.
lppchk: File /usr/opt/freeware/src could not be located.
lppchk: File /usr/opt/freeware/src/packages/RPMS/ppc could not be located.
lppchk: File /usr/opt/freeware/src/packages/SPECS could not be located.
lppchk: File /usr/opt/freeware/src/packages/RPMS/powerpc could not be located.
lppchk: File /usr/opt/freeware/src/packages/SOURCES could not be located.
lppchk: File /usr/opt/freeware/src/packages/BUILD could not be located.
 

5) The AIX-rpm virtual package was removed, so re-create with the updtvpkg command.
# /usr/sbin/updtvpkg

***Go to #6 if this command fails.


6) If updtvpkg fails, or you have more rpm command errors, simply reinstall rpm.rte so the ./dnf_aixtoolbox.sh can run.

Download the latest rpm.rte (This applies to 71 or 72, only.  For 7.3, reinstall the rpm.rte from your install media)
  • https://public.dhe.ibm.com/aix/freeSoftware/aixtoolbox/INSTALLP/ppc/rpm.rte
Change directories to the download directory and install.
# installp -qaXFY -d . rpm.rte

The rpm.rte installation script will call /usr/sbin/updtvpkg.

7) Check free space, increase if required.
# df

Expected:
/tmp >= 340MB
/opt >= 500MB
/var >= 500MB

8) Run the dnf_aixtoolbox.sh script.
# chmod +x dnf_aixtoolbox.sh
# ./dnf_aixtoolbox.sh -d

<... installation output....>

dnf installed successfully.
Please run 'dnf update' to update packages to the latest level.

Please note, RPM packages are downloaded in dnf cache /var/cache/dnf.
RPM packages install files go under the path /opt.
Hence it is recommended to always keep at least 512MB of free space in /var & /opt to avoid any download and installation/update failures.


9) Update dnf.
# dnf update



​​​
0 comments
56 views

Permalink