Linux kernel update error, update-initramfs: failedb Solution
Environment:
Win7 and Ubuntu dual systems.
Background and solution:
Two days ago, I found that the/home directory was full, and then I used gparted tool in Ubuntu to re-partition the system. After partitioning, the/boot and Windows 7 drive C are mounted to the same partition/sda1, therefore, an error is reported during startup. Therefore, the system is re-partitioned and allocated 2 GB for/boot.
However, when you run apt-get, the following error is returned:
The file/boot/config-* Is Not found. The solution is to copy the file in the original/boot file and copy it.
Then a new error is reported when you run apt-get install-f:
Setting initramfs-tools (0.103ubuntu1.1 )...
Update-initramfs: deferring update (trigger activated)
Processing the trigger for initramfs-tools...
Update-initramfs: Generating/boot/initrd. img-3.11.0-12-generic
E:/usr/share/initramfs-tools/hooks/watershed failed with return 1.
Update-initramfs: failed for/boot/initrd. img-3.11.0-12-generic with 1.
Dpkg: error processing initramfs-tools (-- configure ):
The sub-process has installed the post-installation script and Returns Error 1.
An error occurred during processing:
Initramfs-tools
E: Sub-process/usr/bin/dpkg returned an error code (1)
I checked it online for half a day. There are two solutions below:
1. If/boot is full, delete the old kernel.
Run uname-a to view the current kernel version.
Run dpkg -- get-selections "grep linux to view all installed kernels and uninstall the kernel with install.
Sudo apt-get remove linux-image-2.6.24-16-generic
2. Run df-h and find that the mounted boot is not full. Read the above error carefully and find that the problem occurs mainly in watershed. It may be lost or there is no way to read it. Run:
Sudo chmod-x/usr/share/initramfs-tools/hooks/watershed
Then everything is OK.