I have an absolutely fresh install of Ubuntu 12.04 on a USB drive, made using the 64-bit PC (i386) Desktop image. By "fresh" I mean that all I have done is remove the casper-rw file and replace it with a large partition to increase persistence.
(Note: I already know I will not have these problems on 14.04 or 15.04; however, I need to use a tool that is only supported on 12.04, so upgrading is not an option.)
Apt-get update gives the following warnings, but since they are warnings rather than errors, I left them unchecked. They are not the subject of my question, unless they are part of the problem, but are provided in case they are important. The system's self-reported solution (run apt-get update) is obviously wrong because that is what generated the errors.
Fetched 3,253 kB in 16s (196 kB/s)
Reading package lists... Done
W: Duplicate sources.list entry cdrom://Ubuntu 12.04.5 LTS _Precise Pangolin_ - Release amd64 (20140807.1)/ precise/main i386 Packages (/var/lib/apt/lists/Ubuntu%2012.04.5%20LTS%20%5fPrecise%20Pangolin%5f%20-%20Release%20amd64%20(20140807.1)_dists_precise_main_binary-i386_Packages)
W: Duplicate sources.list entry cdrom://Ubuntu 12.04.5 LTS _Precise Pangolin_ - Release amd64 (20140807.1)/ precise/restricted i386 Packages (/var/lib/apt/lists/Ubuntu%2012.04.5%20LTS%20%5fPrecise%20Pangolin%5f%20-%20Release%20amd64%20(20140807.1)_dists_precise_restricted_binary-i386_Packages)
W: Duplicate sources.list entry cdrom://Ubuntu 12.04.5 LTS _Precise Pangolin_ - Release amd64 (20140807.1)/ trusty/main i386 Packages (/var/lib/apt/lists/Ubuntu%2012.04.5%20LTS%20%5fPrecise%20Pangolin%5f%20-%20Release%20amd64%20(20140807.1)_dists_trusty_main_binary-i386_Packages)
W: Duplicate sources.list entry cdrom://Ubuntu 12.04.5 LTS _Precise Pangolin_ - Release amd64 (20140807.1)/ trusty/restricted i386 Packages (/var/lib/apt/lists/Ubuntu%2012.04.5%20LTS%20%5fPrecise%20Pangolin%5f%20-%20Release%20amd64%20(20140807.1)_dists_trusty_restricted_binary-i386_Packages)
W: Duplicate sources.list entry cdrom://Ubuntu 12.04.5 LTS _Precise Pangolin_ - Release amd64 (20140807.1)/ vivid/main i386 Packages (/var/lib/apt/lists/Ubuntu%2012.04.5%20LTS%20%5fPrecise%20Pangolin%5f%20-%20Release%20amd64%20(20140807.1)_dists_vivid_main_binary-i386_Packages)
W: Duplicate sources.list entry cdrom://Ubuntu 12.04.5 LTS _Precise Pangolin_ - Release amd64 (20140807.1)/ vivid/restricted i386 Packages (/var/lib/apt/lists/Ubuntu%2012.04.5%20LTS%20%5fPrecise%20Pangolin%5f%20-%20Release%20amd64%20(20140807.1)_dists_vivid_restricted_binary-i386_Packages)
W: You may want to run apt-get update to correct these problems
More troubling, and the actual problem, is that apt-get dist-upgrade exits with actual errors. The complete output of the second invocation (i.e., just the problematic parts) is:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
6 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up linux-image-3.13.0-55-generic (3.13.0-55.94~precise1) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
initrd.img(/boot/initrd.img-3.13.0-55-generic ) points to /boot/initrd.img-3.13.0-55-generic (/boot/initrd.img-3.13.0-55-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-3.13.0-55-generic.postinst line 491.
vmlinuz(/boot/vmlinuz-3.13.0-55-generic ) points to /boot/vmlinuz-3.13.0-55-generic (/boot/vmlinuz-3.13.0-55-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-3.13.0-55-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 3.13.0-55-generic /boot/vmlinuz-3.13.0-55-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.13.0-55-generic /boot/vmlinuz-3.13.0-55-generic
update-initramfs: Generating /boot/initrd.img-3.13.0-55-generic
cryptsetup: WARNING: failed to detect canonical device of overlayfs
cryptsetup: WARNING: could not determine root device from /etc/fstab
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.13.0-55-generic /boot/vmlinuz-3.13.0-55-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.13.0-55-generic /boot/vmlinuz-3.13.0-55-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.13.0-55-generic /boot/vmlinuz-3.13.0-55-generic
/usr/sbin/grub-probe: error: cannot find a device for / (is /dev mounted?).
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.13.0-55-generic.postinst line 1025.
dpkg: error processing linux-image-3.13.0-55-generic (--configure): subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-generic-lts-trusty: linux-image-generic-lts-trusty depends on linux-image-3.13.0-55-generic; however: Package linux-image-3.13.0-55-generic is not configured yet.
dpkg: error processing linux-image-generic-lts-trusty (--configure): dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic-lts-trusty: linux-generic-lts-trusty depends on linux-image-generic-lts-trusty; however: Package linux-image-generic-lts-trusty is not configured yet.
dpkg: error processing linux-generic-lts-trusty (--configure): dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-signed-image-3.13.0-55-generic: linux-signed-image-3.13.0-55-generic depends on linux-image-3.13.0-55-generic (= 3.13.0-55.94~precise1); however: Package linux-image-3.13.0-55-generic is not configured yet.
dpkg: error processing linux-signed-image-3.13.0-55-generic (--configure):
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-signed-image-generic-lts-trusty: linux-signed-image-generic-lts-trusty depends on linux-signed-image-3.13.0-55-generic; however: Package linux-signed-image-3.13.0-55-generic is not configured yet.
dpkg: error processing linux-signed-image-generic-lts-trusty (--configure): dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-signed-generic-lts-trusty: linux-signed-generic-lts-trusty depends on linux-signed-image-generic-lts-trusty; however: Package linux-signed-image-generic-lts-trusty is not configured yet.
dpkg: error processing linux-signed-generic-lts-trusty (--configure): dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-image-3.13.0-55-generic
linux-image-generic-lts-trusty
linux-generic-lts-trusty
linux-signed-image-3.13.0-55-generic
linux-signed-image-generic-lts-trusty
linux-signed-generic-lts-trusty
E: Sub-process /usr/bin/dpkg returned an error code (1)
I am at a loss for what to do when upgrades go wrong to that extent on a fresh system; I'm not even sure what most of those things are.
(Edit: The tool I referenced above is the Nvidia Nsight Eclipse for the specific purpose of cross-compiling code with my laptop as host and an Nvidia Jetson development board as the target. My understanding is that only Ubuntu 12.04 is supported.)