• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS / RHEL 6,7 : How to recover an interrupted yum package installation

by admin

For any reason, if the yum transaction was interrupted before it could complete, you would get an incomplete installation of the package. This implies that you have few dependent packages being installed and not all. There are 2 ways to recover from an interrupted yum transaction:

  • force reinstall of the package
  • Rollback and reinstall package

Warnings

– Do not say yes to any transaction without checking and cross-checking what it would remove; system libraries that are removed can be problematic. make sure you have a valid backup of the system before proceeding.
– if using the yum history undo command, forgetting to check the packages removed can break the system into a state where nothing will run.

Identifying the interrupted yum transaction

You can check the list of transactions on the system with:

# yum history

There will be one transaction listed with * which corresponds to the one interrupted before completion. Various other flags with their meanings are listed below for your reference:

> - The rpmdb was changed, outside yum, after the transaction.
< - The rpmdb was changed, outside yum, before the transaction.
* - The transaction aborted before completion.
# - The transaction completed, but with a non-zero status.
E - The transaction completed fine, but had warning/error output during the transaction.
P - The transaction completed fine, but problems already existed in the rpmdb.
s - The transaction completed fine, but --skip-broken was enabled and had to skip some packages.

Force reinstall failed yum transaction

Once that ID has been identified, you can try to do a force reinstall of the failed yum transaction. To do so use the redo force-reinstall option with yum history.

# yum history redo force-reinstall [transaction ID]

here,
transaction ID – is the id of the transaction .

Rollback and reinstall package

Alternatively you may undo the yum transaction and then redo it using the same yum transaction ID :

# yum history undo [transaction ID]
# yum history redo [transaction ID]

Filed Under: CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. mknod Command Examples in Linux
  2. CentOS / RHEL : How to install and start the Apache httpd service
  3. How to use mdadm to create a software mirror on top of multipath devices
  4. Linux OS service ‘portmap’
  5. cewl: command not found
  6. tvservice: command not found
  7. htop (interactive process viewer) Linux Performance Monitoring tool
  8. Beginners Guide to Udev in Linux
  9. createrepo Command Examples in Linux
  10. Integrate Linux Servers with Active Directory using Samba, Winbind, and Kerberos

You May Also Like

Primary Sidebar

Recent Posts

  • raw: command not found
  • raw Command Examples in Linux
  • rankmirrors Command Examples in Linux
  • radeontop: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright