2

I was using Ubuntu 18.10 on an Acer Nitro AN515-52, I got the following error:

initramfs unpacking failed...

After updating system, previous two kernels are also not booting due to some other different errors.

Problem: I've built and installed few softwares with certain config which I don't have right now.

Is there any way in which newer Ubuntu 19 or Ubuntu 18 can be installed so that the user data and softwares remains?

galoget
  • 2,963
Sholi
  • 33
  • 5
    Possible duplicate of How can I repair my installation? -- Similar to Windows, you can run the installer an "reinstall" -- but also like Windows, it's not the best path if your system is truly borked. You will likely spend less time doing a clean install and setting back up your software. There is also a high probability that something will be overwritten that you hoped would not be -- so you need to have everything backed up – Nmath Jul 07 '19 at 15:45
  • 1
    This may work, but you should always have good backups. And it may be better to try to resolve errors first. Over install without formatting to reuse same home data. "Dirty Install" System settings or anything in / may be overwritten with defaults. Good backups still important https://help.ubuntu.com/community/UbuntuReinstallation & http://ubuntuforums.org/showthread.php?t=1941872 – oldfred Jul 07 '19 at 15:46

1 Answers1

4

so that the user data & softwares remains.

  1. We all make backups so your question should be moot ;)
  2. Ubuntu exists with a live session version that you can use to mount your disks and extract your personal files. It allows for internet connections so you can even put files into an external source, like google drive. This allows you to completely format anything where a restore of the backup gets you your files back.
  3. The installer also allows you to mount partitions without formatting. So you can add /home without formatting, you can even add / without formatting. This will leave any personal configuration intact. Even apache and mysql configuration files are left alone if they already exist. Nevertheless: a backup should always be made.

And even then. It is generally better to ask for a fix. Ubuntu aint Windowa. In Linux almost anything can be fixed either from grub rescue or from a live session. If the message is ...

nitramfs unpacking failed.

That is NOT the whole message. It is missing the key parts (the actual error is on the next line). The generic method to regenerate the initramfs image is ...

  • Boot a live session
  • list the partitions with fdisk -l. Mount the one that is the boot (sda1 is likely the one)
  • mount these (assuming sda1):

    sudo mount /dev/sda1 /mnt
    sudo mount --bind /dev /mnt/dev
    sudo mount --bind /proc /mnt/proc
    sudo mount --bind /sys /mnt/sys
    
  • and create a chroot with sudo chroot /mnt

  • sudo su (all the other commands up the the exit need to be done as root)
  • Build a new initramfs:

    update-initramfs -c -k 3.11.0.12-generic
    update-grub
    exit
    
  • Activate the changes to grub and reset the chroot

    grub-update
    sudo umount /dev
    sudo umount /proc
    sudo umount /sys
    sudo umount /mnt
    
  • Take the usb out of the system and reboot. You should have a working system.

Rinzwind
  • 299,756