1

I believe my internal disk has failed but I am not entirely sure. In order to detect this, and until I can replace it, I made a persistent live disk off an external hard drive.

I tested that it preserves any files I write to it, but I noticed I cannot install anything. I get this error when I try to install something:

Do you want to continue? [Y/n] Y
Setting up linux-image-5.0.0-36-generic (5.0.0-36.39~18.04.1) ...
Setting up initramfs-tools (0.130ubuntu3.9) ...
/usr/sbin/update-initramfs: 6: /usr/sbin/update-initramfs: cannot create /cdrom/casper/vmlinuz: Read-only file system
dpkg: error processing package initramfs-tools (--configure):
 installed initramfs-tools package post-installation script subprocess returned error exit status 2
Processing triggers for linux-image-5.0.0-36-generic (5.0.0-36.39~18.04.1) ...
/etc/kernel/postinst.d/initramfs-tools:
/usr/sbin/update-initramfs: 6: /usr/sbin/update-initramfs: cannot create /cdrom/casper/vmlinuz: Read-only file system
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 2
dpkg: error processing package linux-image-5.0.0-36-generic (--configure):
 installed linux-image-5.0.0-36-generic package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 initramfs-tools
 linux-image-5.0.0-36-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

Any advice on how to install programs on a persistent live disk would be really appreciated. The disk has Ubuntu 18.04.

Is it still trying to use my internal HDD for anything? If yes that may be a problem also because it is encrypted.

Thanks!

1
  • Things may go smoother if you remove your internal drive first. I have had good luck using mkusb for installing to external drives. Choose Persistent rather than Live install or do a Full install like to internal drive. Commented Nov 18, 2019 at 4:13

1 Answer 1

0

In the copy of the screen are missing the lines preceding:

Do you want to continue? [Y/n] Y
Setting up linux-image-5.0.0-36-generic (5.0.0-36.39~18.04.1) ...
Setting up initramfs-tools (0.130ubuntu3.9) ...

This leads me to believe you entered sudo apt upgrade. You can't do this with a persistent USB.

You can only do:

sudo apt update
sudo apt install <package_name>

Where <package_name> is not a linux kernel package such as linux_image or linux_header.

The problem is not based on your encrypted HDD because a Live USB will not see your HDD or any other drives / partitions until they are manually mounted.

Additionally make sure automatic upgrades are turned off in systems settings. From time to time use:

apt list --upgradable

Only select those packages with sudo apt upgrade <package_name> when they are not related to initramfs, grub, linux_image or linux_header. There may be other packages as well that should not be upgraded.

2
  • I did apt upgrade before. Then I tried to do update and it did not work. Now I was just trying to install vim. Pretty much any program I try to install now gives me that error. Can I reverse the upgrade?
    – yldm
    Commented Nov 18, 2019 at 2:52
  • @yldm No you can't reverse an apt upgrade that I know of. Best to start over. Commented Nov 18, 2019 at 2:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .