Yum update was interrupted by me with ctrl+c on the way, and then yum and rpm broke down.

problem description

yesterday I was updating with yum update , and I was interrupted with ctrl+c when I installed the nss-softokn-freebl-3.36.0-5.el7_5.x86_64 library. Then the yum and rpm commands won"t work. The error is as follows:

[root@centos7 caiyiheng]-sharp yum
error: Failed to initialize NSS library
error: no dbpath has been set
error: cannot open Packages database in /%{_dbpath}
CRITICAL:yum.main:

Error: rpmdb open failed
[root@centos7 caiyiheng]-sharp rpm
error: Failed to initialize NSS library

almost all yum and rpm commands are typed out to report this error, such as yum clean , yum install , rpm install and so on
.

the platform version of the problem and what methods you have tried

my system is centos7, installed in the virtual machine

[root@centos7 caiyiheng]-sharp uname -a
Linux centos7 3.10.0-229.el7.x86_64 -sharp1 SMP Fri Mar 6 11:36:42 UTC 2015 
x86_64 x86_64 x86_64 GNU/Linux

I first checked the yum log, which is shown as follows:

[root@centos7 caiyiheng]-sharp tail -f /var/log/yum.log
Sep 21 05:53:21 Installed: wget-1.14-15.el7_4.1.x86_64
Sep 21 05:53:21 Installed: lsof-4.87-5.el7.x86_64
Sep 21 05:53:22 Installed: net-tools-2.0-0.22.20131004git.el7.x86_64
Sep 26 17:28:11 Updated: libgcc-4.8.5-28.el7_5.1.x86_64
Sep 26 17:28:12 Installed: 1:grub2-common-2.02-0.65.el7.centos.2.noarch
Sep 26 17:28:13 Installed: 1:grub2-pc-modules-2.02-0.65.el7.centos.2.noarch
Sep 26 17:28:13 Installed: firewalld-filesystem-0.4.4.4-14.el7.noarch
Sep 26 17:28:14 Updated: tzdata-2018e-3.el7.noarch
Sep 26 17:28:14 Updated: ncurses-base-5.9-14.20130511.el7_4.noarch
Sep 26 17:28:15 Updated: nss-softokn-freebl-3.36.0-5.el7_5.x86_64

that"s how I know I knelt when it was time to update nss.

then searched a bunch of things on the Internet yesterday, none of which can be solved, for example: https://www.linuxquestions.or.

another example: https://serverfault.com/quest.

I also put down the corresponding rpm,

" of nss in accordance with the above missing nspr method.

then: rpm2cpio nss-softokn-freebl-3.36.0-5.el7_5.x86_64.rpm | cpio-idmv , and then copy the solved usr and etc into the / usr and / etc of the system, which is still useless.

centos official forum mentioned a similar problem, but it is certainly not quite the same as mine. I also tried that mount method, and it didn"t work: https://bugs.centos.org/view.

.

there is really nothing I can do. I also asked the same question on the stack. I hope I can have a friend to take a look at it for me. Thank you. I can"t be asked to reinstall the system. Yum still needs to be used. In addition, not to mention why not install the virtual machine provided by the operation and maintenance of Ubuntu, company, only centos.

Jul.17,2021

it is common sense that half of the software installed in yum or apt, must not be interrupted, and the forced interruption of half of the software is simply fatal.

now you can only fix broken packages manually. Look at the dependencies of nss. You may have to fix all the dependent packages manually. The solution is to replace the corrupted files with the files released by these packages, which may also be saved.

another way is to reinstall the system. You can choose not to format the hard drive and overwrite the installation directly, which will repair all the damaged files and have all the data. Of course, the modified system configuration file will still be replaced, and you may have to reconfigure it. Anyway, it's up to you to evaluate it.


my problem is the same as yours

Menu