RPM command hangs

10,071

Stop the install command and rebuild your rpm database.

You should be able to:

rm /var/lib/rpm/__db*

Then:

rpm --rebuilddb

Then attempt your installation again.

Share:
10,071

Related videos on Youtube

user95711
Author by

user95711

Updated on September 18, 2022

Comments

  • user95711
    user95711 over 1 year

    On Cent OS 5, rpm command hung on my Linux machine.

    [root@manage glib]# rpm -i libgcc-4.1.1-52.el5.i386.rpm
    
    [root@manage glib]# ps -efww | grep libgcc
    root      2020 32168  0 13:50 pts/0    00:00:00 grep libgcc
    root     14254  2974  0 13:09 pts/1    00:00:00 rpm -i libgcc-4.1.1-52.el5.i386.rpm
    

    Below is the strace:

    [root@manage glib]# strace -p 14254
    Process 14254 attached - interrupt to quit
    select(0, NULL, NULL, NULL, {0, 643179}) = 0 (Timeout)
    select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
    select(0, NULL, NULL, NULL, {1, 0})     = 0 (Timeout)
    read(4, "\0\0\0\0\1\0\0\0\0\0\0\0a\25\6\0\7\0\0\0\0\20\0\0\0\10\0\0\0\0\0\0"..., 256) = 256
    close(4)                                = 0
    open("/var/lib/rpm/Packages", O_RDONLY|O_LARGEFILE) = 4
    fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
    fstat64(4, {st_mode=S_IFREG|0644, st_size=5582848, ...}) = 0
    brk(0x821e000)                          = 0x821e000
    select(0, NULL, NULL, NULL, {0, 1000})  = 0 (Timeout)
    select(0, NULL, NULL, NULL, {0, 2000})  = 0 (Timeout)
    select(0, NULL, NULL, NULL, {0, 4000})  = 0 (Timeout)
    

    How do I fix rpm so it does not hang?

    • c4f4t0r
      c4f4t0r over 9 years
      have you some nfs mounted in your system?
    • Jeff Barnard
      Jeff Barnard over 9 years
      Maybe some pre/post install script hung? Try pstree -p `pidof -s rpm`