Solved: ERROR: E: Failed to install /usr/sbin/eject during RPM installation.

Today we will check how to resolve an interesting issue i encountered while installing a package on server.

I was installing realtime kernel package on one server and it had failed with below error messages.

Issue:  Failed to install /usr/sbin/eject

[root@ngelinux2 boot]# rpm -ivh /tmp/kernel-rt-3.10.0-693.76.1.rt56.676.el6rt.x86_64.rpm --force
Preparing...                ########################################### [100%]
   1:kernel-rt              ########################################### [100%]
E: Failed to install /usr/sbin/eject
mkinitrd failed
ERROR: installing kernel-rt-3.10.0-693.76.1.rt56.676.el6rt.x86_64: no space left for creating initramfs. Clean up /boot partition and re-run '/sbin/new-kernel-pkg --package kernel-rt --mkinitrd --depmod --update --dracut 3.10.0-693.76.1.rt56.676.el6rt.x86_64 '
warning: %posttrans(kernel-rt-1:3.10.0-693.76.1.rt56.676.el6rt.x86_64) scriptlet failed, exit status 1

 

Solution
a. First check /boot and cleanup old files to make sure it has enough free space.

[root@ngelinux2 boot]# ls -ltr
total 15122
-rwxr-xr-x. 1 root root 4316752 May 24  2018 vmlinuz-2.6.32-754.el6.x86_64
-rw-r--r--. 1 root root 2652834 May 24  2018 System.map-2.6.32-754.el6.x86_64
-rw-r--r--. 1 root root  108282 May 24  2018 config-2.6.32-754.el6.x86_64
-rw-r--r--. 1 root root  216063 May 24  2018 symvers-2.6.32-754.el6.x86_64.gz
-rwxr-xr-x. 1 root root 5187328 Sep 12 23:55 vmlinuz-3.10.0-693.76.1.rt56.676.el6rt.x86_64
-rw-r--r--. 1 root root 2786063 Sep 12 23:55 System.map-3.10.0-693.76.1.rt56.676.el6rt.x86_64
-rw-r--r--. 1 root root  122970 Sep 12 23:55 config-3.10.0-693.76.1.rt56.676.el6rt.x86_64
drwx------. 2 root root   12288 Nov  6 15:49 lost+found
drwxr-xr-x. 3 root root    1024 Nov  6 16:00 efi
drwxr-xr-x. 2 root root    1024 Dec 23 14:23 grub

b. Try again the last command

[root@ngelinux2 boot]# /sbin/new-kernel-pkg --package kernel-rt --mkinitrd --depmod --update --dracut 3.10.0-693.76.1.rt56.676.el6rt.x86_64
E: Failed to install /usr/sbin/eject
mkinitrd failed

c. Still failed, try to check eject binary path.

[root@ngelinux2 boot]# ls -l /usr/sbin/eject
ls: cannot access /usr/sbin/eject: No such file or directory

### Search for correct path of eject
[root@ngelinux2 boot]# find / -print | grep -i eject
/lib64/xtables/libip6t_REJECT.so
/lib64/xtables/libipt_REJECT.so
/usr/libexec/hal-storage-eject
/usr/bin/eject

d. Now create soft link of correct binary to resolve the issue.

# ln -s /usr/bin/eject  /usr/sbin/eject

Leave a Reply

Your email address will not be published.