Open Source Development

Power Open Source Development

Explore the open source tools and capabilities for building and deploying modern applications on IBM Power platforms including AIX, IBM i, and Linux.


#Power


#Power

 View Only
  • 1.  RPM db v4 packages not visible after upgrading from v3

    Posted Thu January 16, 2020 06:52 AM

    Originally posted by: Daniel.Stachowiak


    Hello,

     

    After upgrade to TL5 we could see missing packages in rpmdb.

    Before upgrade we could see the packages in rpm v3:

    # rpm --dbpath /opt/IBM/GSMA/rpmdb -qa
    gsmaSharedUtilities-10.0.1.0-9.noarch
    gsma_TDW_Reporter-10.1.0.3-1.noarch
    gsma_LDSDB2-10.1.0.3-6.noarch

     

    After update we couldn't see any installed packages (version of rpm v4):

    # rpm --dbpath /opt/IBM/GSMA/rpmdb -qa
    there is no output

    # lslpp -l | grep -i rpm
    rpm.rte 4.13.0.3 COMMITTED RPM Package Manager
    rpm.rte 4.13.0.3 COMMITTED RPM Package Manager

     

    GSMA support advised to follow this instruction, but this is applicable to rpm version 4.13.0.1/2

    As you must have seen in the shared forum post, there. was a procedure for migration of data:The steps as below:
    1. Download the ifix with the following link:
    ftp://testcase.software.ibm.com/fromibm/aix/IJ04082s2a.180215.epkg
    sftp anonymous@testcase.software.ibm.com://fromibm/aix/IJ04082s2a.180215.epkg
    2. Compress the package: compress IJ04082s2a.180215.epkg
    3. Apply the package: emgr -e IJ03033m1a.180116.epkg.Z
    4. Create the virtual packages: # /tmp/create_virt_tmppath.sh <db path>
    5. Install the virtual packages: # /tmp/install_virtuals_tmppath.sh <db path>The scripts were included as a part of the ifix

    IF the fix is not applicable to your RPM version, I recommend you to open PMR to AIX Support and ask what is the procedure for migration of RPM database for your PRM 4.13.0.3

     

    Is there any way to 'migrate' rpm database from version 3 to version 4 to be able to see installed packages?


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 2.  Re: RPM db v4 packages not visible after upgrading from v3

    Posted Thu January 16, 2020 07:18 AM

    Originally posted by: sangameshm


    Since rpm doesn't have information about the dbpath used, it wasn't able to convert to the newer database.

     

    To convert database to the newer format, better option instead of ifix is to run the below command manually which ships along with rpm.rte-4.13.0.3.

    Please take backup of your existing database files before running the command.

    LIBPATH=/opt/freeware/lib/rpm40:/opt/freeware/lib:/usr/lib:/lib /opt/freeware/rpm40/bin/rpmdb --define '_dbpath /tmp/db_path' --rebuilddb --rcfile=/opt/freeware/lib/rpm40/rpmrc

    Replace the /tmp/db_path with your /opt/IBM/GSMA/rpmdb path.

     

    Thanks,

    Sangamesh


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 3.  Re: RPM db v4 packages not visible after upgrading from v3

    Posted Fri January 17, 2020 01:41 AM

    Originally posted by: Daniel.Stachowiak


    Hello Sangamesh,

    Thank you for fast answer.

    Your command worked on one server but is failing on two others with similar configuration.

    # freeware/rpm40/bin/rpmdb --define '_dbpath /opt/IBM/GSMA/rpmdb' --rebuilddb --rcfile=/opt/freeware/lib/rpm40/rpmrc                                                                                      <
    error: failed to replace old database with new database!
    error: replace files in /opt/IBM/GSMA/rpmdb with files from /opt/IBM/GSMA/rpmdbrebuilddb.39321682 to recovererror: failed to remove directory /opt/IBM/GSMA/rpmdbrebuilddb.39321682: File exists
     

    Do you happen to know what might be wrong?


    #AIXOpenSource
    #AIX-Open-Source-Software


  • 4.  Re: RPM db v4 packages not visible after upgrading from v3

    Posted Fri January 17, 2020 04:50 AM

    Originally posted by: sangameshm


    I guess some previous run might have exited in the middle.

    You can try adding "-vv" option which would give more information about the command it is running.

     

    Two of the most interesting output  in this case which displays in the beginning is.

     

    D: rebuilding database /tmp/db_path into /tmp/db_pathrebuilddb.6422720
    D: creating directory /tmp/db_pathrebuilddb.6422720

     

    Thanks,

    Sangamesh


    #AIXOpenSource
    #AIX-Open-Source-Software


  • 5.  Re: RPM db v4 packages not visible after upgrading from v3

    Posted Fri January 17, 2020 05:47 AM

    Originally posted by: Daniel.Stachowiak


    Command run with debug mode is not giving any more tips:

    D: rebuilding database /opt/IBM/GSMA/rpmdb into /opt/IBM/GSMA/rpmdbrebuilddb.31326224
    D: creating directory /opt/IBM/GSMA/rpmdbrebuilddb.31326224
    D: opening old database with dbapi 3
    D: opening db index /opt/IBM/GSMA/rpmdb/Packages rdonly mode=0x0
    D: closed db index /opt/IBM/GSMA/rpmdb/Packages
    D: opening db file /opt/IBM/GSMA/rpmdb/packages.rpm mode 0x0
    D: opening new database with dbapi 3
    D: opening db index /opt/IBM/GSMA/rpmdbrebuilddb.31326224/Packages create mode=0x102
    D: locked db index /opt/IBM/GSMA/rpmdbrebuilddb.31326224/Packages
    D: +++ 1 gsma_TDW_Reporter-10.0.0.0-0
    D: opening db index /opt/IBM/GSMA/rpmdbrebuilddb.31326224/Name create mode=0x102
    D: adding "gsma_TDW_Reporter" to Name index.
    D: opening db index /opt/IBM/GSMA/rpmdbrebuilddb.31326224/Basenames create mode=0x102
    D: adding 40 entries to Basenames index.
    D: opening db index /opt/IBM/GSMA/rpmdbrebuilddb.31326224/Group create mode=0x102
    D: adding "GSMA" to Group index.
    D: opening db index /opt/IBM/GSMA/rpmdbrebuilddb.31326224/Requirename create mode=0x102
    D: adding 6 entries to Requirename index.
    D: opening db index /opt/IBM/GSMA/rpmdbrebuilddb.31326224/Providename create mode=0x102
    D: adding 1 entries to Providename index.
    D: +++ 2 gsmaSharedUtilities-10.0.0.0-2
    D: adding "gsmaSharedUtilities" to Name index.
    D: adding 163 entries to Basenames index.
    D: adding "GSMA" to Group index.
    D: adding 5 entries to Requirename index.
    D: adding 4 entries to Providename index.
    D: +++ 3 gsma_LDSDB2-10.0.0.0-5
    D: adding "gsma_LDSDB2" to Name index.
    D: adding 180 entries to Basenames index.
    D: adding "GSMA" to Group index.
    D: adding 7 entries to Requirename index.
    D: adding 1 entries to Providename index.
    D: closed db file /opt/IBM/GSMA/rpmdb/packages.rpm
    D: closed db index /opt/IBM/GSMA/rpmdbrebuilddb.31326224/Providename
    D: closed db index /opt/IBM/GSMA/rpmdbrebuilddb.31326224/Requirename
    D: closed db index /opt/IBM/GSMA/rpmdbrebuilddb.31326224/Group
    D: closed db index /opt/IBM/GSMA/rpmdbrebuilddb.31326224/Basenames
    D: closed db index /opt/IBM/GSMA/rpmdbrebuilddb.31326224/Name
    D: closed db index /opt/IBM/GSMA/rpmdbrebuilddb.31326224/Packages
    error: failed to replace old database with new database!
    error: replace files in /opt/IBM/GSMA/rpmdb with files from /opt/IBM/GSMA/rpmdbrebuilddb.31326224 to recoverD: removing directory /opt/IBM/GSMA/rpmdbrebuilddb.31326224
    error: failed to remove directory /opt/IBM/GSMA/rpmdbrebuilddb.31326224: Do not specify an existing file.


    #AIX-Open-Source-Software
    #AIXOpenSource


  • 6.  Re: RPM db v4 packages not visible after upgrading from v3

    Posted Fri January 17, 2020 07:51 AM

    Originally posted by: sangameshm


    database files seems to have been created fine in the /opt/IBM/GSMA/rpmdbrebuilddb.31326224

    It is failing in moving them to original /opt/IBM/GSMA/rpmdb path. Not sure why it's failing.

    As it said may be moving files from /opt/IBM/GSMA/rpmdbrebuilddb.31326224 to /opt/IBM/GSMA/rpmdb manually would work.

     

    As always make sure you have your old database files backed up.

    Thaks,

    Sangamesh

     


    #AIXOpenSource
    #AIX-Open-Source-Software


  • 7.  Re: RPM db v4 packages not visible after upgrading from v3

    Posted Wed January 22, 2020 06:01 AM

    Originally posted by: Daniel.Stachowiak


    Thank you Sangamesh.

    We have moved files manually as you suggested and fixed the permissions (from root to respective users).


    #AIX-Open-Source-Software
    #AIXOpenSource