Share This:

It can be useful to manually run yum or blyum with the repodata and includes from the command line to get a better picture of what might be happening during analysis or inspect the repodata or perform any other troubleshooting steps.  The following steps can be taken to accomplish this:

 

 

Setup the Metadata

First, you must locate the metadata you want to test with and stage it on the target server in the correct location.

 

For 8.9.01 and below

The metadata files are not preserved by default.  To preserve them, run the Patching Job with the DEBUG_MODE_ENABLED property set to true.  The metadata will be preserved on the appserver in the NSH/tmp/debug/<apppserver name> directory on the application server.  For example: if the Job Name is 'RedHat Analysis' and it was run against the target 'red6-88.example.com' on Jun 11 you should see a directory:

<install dir>/NSH/tmp/debug/application_server/RedHat Analysis/Sat Jun 11 09-26-57 EDT 2016/red6-88.example.com

that contains:

analysis_err.log analysis_log.log analysis_res.log installed_rpms.log repo repodata.tar.gz yum_analysis.res yum.conf yum.err.log yum.lst

on the application server.

 

Inspect the yum.conf and look at the value of the cachedir setting.  On the target system, create the cachedir. 

 

Copy the entire contents of the red6-88.example.com directory to the target system (or any system you want to test these files on) into the directory you just created.

 

For 8.9.01 and later

If the STAGING_DIR and TRANSACTIONS_DIR directories on the target are on the same disk partition, than the metadata files from the three most recent job runs are kept in <rscd install>/Transactions/analysis_archive on the target system without needing to set DEBUG_MODE_ENABLED.  If STAGING_DIR and TRANSACTIONS_DIR are on different partitions, then metadata is not retained in the analysis_archive directory, and you will need to follow the instructions above to retain the metadata.

 

Identify the run from the analysis_archive directory you want to test with, inspect the yum.conf in that run for the cachedir.  Create the cachedir and copy the contents of <rscd install>/Transactions/analysis_archive/<job run> to the directory you just created.

 

 

After performing either procdeure above, you should have a directory like /var/tmp/stage/LinuxCatalog_2002054_red6-88.example.com that contains

analysis_err.log analysis_log.log analysis_res.log installed_rpms.log repo repodata.tar.gz yum_analysis.res yum.conf yum.err.log yum.lst

and possibly some other files or directories depending on the version of Linux and what include or exclude options were used in the job.

 

Running yum

 

Older versions of BSA/TSSA on RedHat 6 and below use blyum to run analysis, which is a version of yum provided with the RSCD install.  If you are using 8.9.01 or below on RedHat 6, replace any calls to yum with <rscd install>/bin/blyum.

 

Enter the cachedir directory you created and copied the metadata files into.  Run yum using the configuration and metadata supplied by TSSA:

yum -c yum.conf -C update 

 

if an include list was used you can run:

 

yum -c yum.conf -C update `cat rpm-includes.lst.old`

or

yum -c yum.conf -C update `cat parsed-include.lst.old`

 

if the parsed list exists.  The parsed include list will not contain any rpms that are installed on the target and in the include list. 

The parsed-include.lst was added in recent BSA versions to handle the situation where yum decides to update the rpm to the latest one in the catalog instead of leaving it alone when the include list contains the exact version of an rpm already installed on the system.

 

The above are the commands run during the analysis phase of a Patching Job.  You can step through the commands and output to help investigate any problems encountered during the run.

 

You can also use the above process to copy the metadata from the target system to another system and run queries against the metadata or run analysis with the same metadata and options against a test system.  for example you could run:

yum -c yum.conf -C search <rpmname>

or

yum -c yum.conf -C info <rpmname>

 

to determine if a particular rpm is in the metadata or not.