PackageManagerTroubleshootingProcedure Results

Asked by Bruce Hyatt on 2016-09-15

Here are the results of the commands from the PackageManagerTroubleshootingProcedure page. I stopped at copying the dpkg file because there were errors there thath may indicate the problem and I hesitated to then go on to moving files.

The problem may be related to when I took my HDD from one laptop and put it in another of the same model.

Thanks in advance for any help.

- Bruce Hyatt

cat /etc/dpkg/dpkg.cfg.d/multiarch:
No such file or directory

dpkg --print-foreign-architectures:

sudo grep -R proxy /etc/apt/*:

grep proxy /etc/environment:

echo $http_proxy:

echo $ftp_proxy:

grep proxy /etc/bash.bashrc:

grep proxy ~/.bashrc:

cat /etc/apt/apt.conf:
No such file or directory

sudo fuser -vvv /var/lib/dpkg/lock

sudo fuser -vvv /var/cache/apt/archives/lock

cat /etc/lsb-release:

uname -a:
Linux HP-ProBook-6455b 3.13.0-85-generic #129-Ubuntu SMP Thu Mar 17 20:50:15 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

sudo rm /var/lib/apt/lists/lock:
done (nothing returned)

sudo rm /var/cache/apt/archives/lock:
done (nothing returned)

sudo rm /var/lib/dpkg/lock:
done (nothing returned)

sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup:
cp: error reading ‘/var/lib/dpkg/info/linux-headers-3.13.0-45-generic.list’: Input/output error
cp: failed to extend ‘/var/lib/dpkg.backup/info/linux-headers-3.13.0-45-generic.list’: Input/output error
cp: error reading ‘/var/lib/dpkg/info/linux-headers-3.13.0-45.list’: Input/output error
cp: failed to extend ‘/var/lib/dpkg.backup/info/linux-headers-3.13.0-45.list’: Input/output error
cp: error reading ‘/var/lib/dpkg/info/linux-headers-3.13.0-45-generic.md5sums’: Input/output error
cp: failed to extend ‘/var/lib/dpkg.backup/info/linux-headers-3.13.0-45-generic.md5sums’: Input/output error

Question information

English Edit question
Ubuntu apt Edit question
No assignee Edit question
Solved by:
Bruce Hyatt
Last query:
Last reply:
Bruce Hyatt (bruce-hyatt) said : #1

I somehow omitted the first result:


Support status summary of 'HP-ProBook-6455b':

You have 109 packages (4.7%) supported until June 2017 (9m)
You have 32 packages (1.4%) supported until February 2015 (9m)
You have 2040 packages (88.5%) supported until May 2019 (5y)
You have 68 packages (3.0%) supported until May 2017 (3y)

You have 6 packages (0.3%) that can not/no-longer be downloaded
You have 49 packages (2.1%) that are unsupported


sudo apt-get --reinstall install linux-headers-3.13.0-45-generic

Manfred Hampl (m-hampl) said : #3

Messages like

cp: error reading 'filename': Input/output error

usually indicate a problem on the hard disk.
I suggest that you start a live system (by booting an Ubuntu installer in the 'Try Ubuntu without installing' mode) and perform a full file system check on your hard disk partition(s).

Bruce Hyatt (bruce-hyatt) said : #4

sudo apt-get --reinstall install linux-headers-3.13.0-45-generic

returns the same error:

dpkg: unrecoverable fatal error, aborting:
 reading files list for package 'linux-headers-3.13.0-45': Input/output error
E: Sub-process /usr/bin/dpkg returned an error code (2)

I ran badblocks -v on my hard disk and it returned:

Pass completed, 210 bad blocks found. (210/0/0 errors)

I tried upgrading to 16.04 from a usb stick and it didn't work because of the out-of-date pacckages.

Will continuing with the troubleshooting procedure remedy this problem?

Manfred Hampl (m-hampl) said : #5

As long as there are "Input/output error" messages, it does not make sense to continue with the package management troubleshooting procedure.

Did you already run a full file system check (fsck)?

Bruce Hyatt (bruce-hyatt) said : #6

I followed case 4 on the Filesystem Troubleshooting page ( and shutdown and then started the system. I can't find any evidence that fsck ran though. It rebooted very quickly and /var/log/boot.log has 6 lines. /forcefsck is empty.

I'm trying to figure out how to unmount my primary HDD so I can run fsck on it. I suppose I could unmount and fsck all the directories except the root.

The easiest solution may be a fresh install. I would like to avoid having to go through all the configuration again though.

- Bruce Hyatt

Manfred Hampl (m-hampl) said : #7

You should boot a live system (by starting from an installation kit on DVD or bootable USB stick in the "Try Ubuntu without installing" mode) and perform a full file system check.

Bruce Hyatt (bruce-hyatt) said : #8

My installation has 3 partitions:
sda1 - boot
sda2 - ext(4?)
sda5 - swap

From a live system, running fsck -n on sda1 returns "clean." On sda2 it returns "attempt to read block from filesystem resulted in short read.... I guess the problem is there.

I tried fsck -y and fsck -a and got the same message. dumpe2fs /dev/sda2 | grep supeblock returned the same thing plus "couldn't find valid filesystem superblock."

I suspect there's nothing else left but a fresh install.

Manfred Hampl (m-hampl) said : #9

Maybe you can recover with commands like those in

As a first check you could try
dumpe2fs -o superblock=32768 /dev/sda2 | grep superblock
(or other candidate block numbers for superblock backups)

Bruce Hyatt (bruce-hyatt) said : #10

For some reason, the partition shows as being a dos partition!

From the referenced page, the command mke2fs -n /dev/sda returned "found a dos partition table in /dev/sda. proceed anyway?" to which I responded yes. It then says that the partition is "apparently in use by the system and won't make a filesystem here." This is while running on a live usb stick.

fsck.msdos -v returns "logical sector size is zero."

The command dumpe2fs -o superblock=32768 /dev/sda2 | grep superblock returns "invalid argument... couldn't find valid filesystem superblock."

Manfred Hampl (m-hampl) said : #11

"found a dos partition table..." does not tell anything about the partitions as such, but just informs that the partition table (where information about the partitions is stored) has a certain format.

The command mke2fs has to be executed against the partition, not against the whole disk (or the partition table); correct parameter would be

mke2fs -n /dev/sda2

Bruce Hyatt (bruce-hyatt) said : #12

I made a USB stick with Parted Magic and ran the command dumpe2fs -o superblock=32768 /dev/sda2 | grep superblock for all the backup superblock candidates and they all returned "couldn't find valid filesystem superblock.

I also ran e2fsck -b block_number /dev/sda2 command described in the linuxexpresso link above, for all the same superblock numbers, and it returned "the superblock could not be read or does not describe a valid ext2/ext3/ext4 filesystem...."

The Parted Magic help files I've found so far aren't very helpful. Does anyone know of other utilities it contains that might help? Thanks.

Manfred Hampl (m-hampl) said : #13

This does not look good at all. shows some potential programs for recovering data from broken disks and partitions.

Another approach might be to examine the first few blocks of the partition (with od or similar dump programs) and matching it with the expected layout of an ext4 (2) file system to identify what might be broken, and eventually identifying correct block size, backup superblocks etc.

Bruce Hyatt (bruce-hyatt) said : #14

Manfred, thanks very much for your help but I wound up trying to do a fresh install of 16.04. It failed though, I assume because of this disk error. Fortunately I had another identical disk drive and I slapped it in and installed Ubuntu on that.