Cannot update Ubuntu software, multiple package manager errors

Asked by slowtrain

Following the instructions at the following link, I am enclosing a copy of what my terminal shows for the troubleshooting tests. I have been trying to update my software for about a week, but have been unable to do so. What follows shows the problems I've been having (even after wiping my archives and apt list clean). The first major problem below seems to be bzip2 errors followed by an error msg saying it is unable to parse the package file i18n_Index.

#Trouble shooting instructions:

https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure

#OUTPUT FROM TERMINAL

root@OptiPlex-990:/var/cache/apt/archives# sudo grep -R proxy /etc/apt/*
root@OptiPlex-990:/var/cache/apt/archives# sudo fuser -vvv /var/lib/dpkg/lock
root@OptiPlex-990:/var/cache/apt/archives# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.1 LTS"
root@OptiPlex-990:/var/cache/apt/archives# uname -a
Linux OptiPlex-990 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:33:09 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
root@OptiPlex-990:/var/cache/apt/archives# sudo rm /var/lib/apt/lists/lock
root@OptiPlex-990:/var/cache/apt/archives# sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
root@OptiPlex-990:/var/cache/apt/archives# sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
root@OptiPlex-990:/var/cache/apt/archives# sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
root@OptiPlex-990:/var/cache/apt/archives# sudo mv /var/lib/dpkg/available /var/lib/dpkg/available-bad
root@OptiPlex-990:/var/cache/apt/archives# sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
root@OptiPlex-990:/var/cache/apt/archives# sudo rm -rf /var/lib/dpkg/updates/*
root@OptiPlex-990:/var/cache/apt/archives# sudo rm -rf /var/lib/apt/lists
root@OptiPlex-990:/var/cache/apt/archives# sudo rm /var/cache/apt/*.bin
root@OptiPlex-990:/var/cache/apt/archives# sudo mkdir /var/lib/apt/lists
root@OptiPlex-990:/var/cache/apt/archives# sudo mkdir /var/lib/apt/lists/partial
root@OptiPlex-990:/var/cache/apt/archives# LANG=C;sudo apt-get clean
root@OptiPlex-990:/var/cache/apt/archives# LANG=C;sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to read /var/cache/apt/archives/partial/ - opendir (2: No such file or directory)
root@OptiPlex-990:/var/cache/apt/archives# LANG=C;sudo apt-get --purge autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up bzip2 (1.0.6-1) ...
root@OptiPlex-990:/var/cache/apt/archives# LANG=C;sudo apt-get update -o APT::Cache-Limit=100000000
Ign http://archive.ubuntu.com precise InRelease
Ign http://archive.canonical.com precise InRelease
Ign http://archive.ubuntu.com precise-updates InRelease
Get:1 http://archive.canonical.com precise Release.gpg [198 B]
Ign http://archive.ubuntu.com precise-security InRelease
Get:2 http://archive.canonical.com precise Release [7078 B]
Get:3 http://archive.ubuntu.com precise Release.gpg [198 B]
Get:4 http://archive.canonical.com precise/partner Sources [4475 B]
Get:5 http://archive.ubuntu.com precise-updates Release.gpg [198 B]
Get:6 http://archive.ubuntu.com precise-security Release.gpg [198 B]
Get:7 http://archive.canonical.com precise/partner amd64 Packages [7406 B]
Get:8 http://archive.canonical.com precise/partner i386 Packages [5944 B]
Get:9 http://archive.ubuntu.com precise Release [49.6 kB]
Ign http://archive.canonical.com precise/partner TranslationIndex
Get:10 http://archive.ubuntu.com precise-updates Release [49.6 kB]
Get:11 http://archive.ubuntu.com precise-security Release [49.6 kB]
Ign http://archive.canonical.com precise/partner Translation-en
Get:12 http://archive.ubuntu.com precise/main amd64 Packages [1273 kB]
Get:13 http://archive.ubuntu.com precise/restricted amd64 Packages [8452 B]
Get:14 http://archive.ubuntu.com precise/universe amd64 Packages [4786 kB]
Get:15 http://archive.ubuntu.com precise/main i386 Packages [1274 kB]
Get:16 http://archive.ubuntu.com precise/restricted i386 Packages [8431 B]
Get:17 http://archive.ubuntu.com precise/universe i386 Packages [4796 kB]
Get:18 http://archive.ubuntu.com precise/main TranslationIndex [3706 B]
Get:19 http://archive.ubuntu.com precise/multiverse TranslationIndex [2676 B]
Get:20 http://archive.ubuntu.com precise/restricted TranslationIndex [151 kB]
Get:21 http://archive.ubuntu.com precise/universe TranslationIndex [9930 B]
Get:22 http://archive.ubuntu.com precise-updates/main amd64 Packages [3564 B]
99% [22 Packages bzip2 0 B] [Waiting for headers]bzip2: (stdin) is not a bzip2 file.
Get:23 http://archive.ubuntu.com precise-updates/restricted amd64 Packages [2605 B]
99% [23 Packages bzip2 0 B] [Waiting for headers]bzip2: (stdin) is not a bzip2 file.
Get:24 http://archive.ubuntu.com precise-updates/universe amd64 Packages [2461 B]
99% [24 Packages bzip2 0 B] [Waiting for headers]bzip2: (stdin) is not a bzip2 file.
Get:25 http://archive.ubuntu.com precise-updates/multiverse amd64 Packages [2850 B]
99% [25 Packages bzip2 0 B] [Waiting for headers]bzip2: (stdin) is not a bzip2 file.
Get:26 http://archive.ubuntu.com precise-updates/main i386 Packages [180 kB]
Get:27 http://archive.ubuntu.com precise-updates/restricted i386 Packages [3969 B]
Get:28 http://archive.ubuntu.com precise-updates/universe i386 Packages [48.6 kB]
Get:29 http://archive.ubuntu.com precise-updates/multiverse i386 Packages [2188 B]
Get:30 http://archive.ubuntu.com precise-updates/main TranslationIndex [186 kB]
E: Unable to parse package file /var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_precise-updates_main_i18n_Index (1)
root@OptiPlex-990:/var/cache/apt/archives# sudo dpkg --configure -a
root@OptiPlex-990:/var/cache/apt/archives# sudo dpkg --clear-avail
root@OptiPlex-990:/var/cache/apt/archives# LANG=C;sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@OptiPlex-990:/var/cache/apt/archives# LANG=C;sudo apt-get --fix-missing install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@OptiPlex-990:/var/cache/apt/archives# LANG=C;sudo apt-get update -o APT::Cache-Limit=100000000 && sudo apt-get dist-upgrade
Ign http://archive.canonical.com precise InRelease
Ign http://archive.ubuntu.com precise InRelease
Hit http://archive.canonical.com precise Release.gpg
Ign http://archive.ubuntu.com precise-updates InRelease
Ign http://archive.ubuntu.com precise-security InRelease
Hit http://archive.ubuntu.com precise Release.gpg
Hit http://archive.canonical.com precise Release
Hit http://archive.ubuntu.com precise-updates Release.gpg
Hit http://archive.canonical.com precise/partner Sources
Hit http://archive.ubuntu.com precise-security Release.gpg
Hit http://archive.canonical.com precise/partner amd64 Packages
Hit http://archive.ubuntu.com precise Release
Hit http://archive.canonical.com precise/partner i386 Packages
Hit http://archive.ubuntu.com precise-updates Release
Ign http://archive.canonical.com precise/partner TranslationIndex
Hit http://archive.ubuntu.com precise-security Release
Hit http://archive.ubuntu.com precise/main amd64 Packages
Ign http://archive.canonical.com precise/partner Translation-en
Hit http://archive.ubuntu.com precise/restricted amd64 Packages
Hit http://archive.ubuntu.com precise/universe amd64 Packages
Get:1 http://archive.ubuntu.com precise/multiverse amd64 Packages [119 kB]
Hit http://archive.ubuntu.com precise/main i386 Packages
Hit http://archive.ubuntu.com precise/restricted i386 Packages
Hit http://archive.ubuntu.com precise/universe i386 Packages
Get:2 http://archive.ubuntu.com precise/multiverse i386 Packages [121 kB]
Hit http://archive.ubuntu.com precise/main TranslationIndex
Hit http://archive.ubuntu.com precise/multiverse TranslationIndex
Get:3 http://archive.ubuntu.com precise/restricted TranslationIndex [2596 B]
Get:4 http://archive.ubuntu.com precise/universe TranslationIndex [2922 B]
Get:5 http://archive.ubuntu.com precise-updates/main amd64 Packages [417 kB]
Get:6 http://archive.ubuntu.com precise-updates/restricted amd64 Packages [8215 B]
Get:7 http://archive.ubuntu.com precise-updates/universe amd64 Packages [151 kB]
Get:8 http://archive.ubuntu.com precise-updates/multiverse amd64 Packages [8948 B]
Get:9 http://archive.ubuntu.com precise-updates/main i386 Packages [425 kB]
100% [9 Packages bzip2 0 B] [Waiting for headers] 40.5 kB/s 0s
bzip2: Data integrity error when decompressing.
 Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

Get:10 http://archive.ubuntu.com precise-updates/restricted i386 Packages [8218 B]
100% [10 Packages bzip2 0 B] [Waiting for headers] 40.5 kB/s 0s
bzip2: (stdin): trailing garbage after EOF ignored
Get:11 http://archive.ubuntu.com precise-updates/universe i386 Packages [151 kB]
100% [11 Packages bzip2 0 B] [Waiting for headers] 40.5 kB/s 0s
bzip2: Data integrity error when decompressing.
 Input file = (stdin), output file = (stdout)

It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.

You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.

Get:12 http://archive.ubuntu.com precise-updates/multiverse i386 Packages [9930 B]
100% [12 Packages bzip2 0 B] [Waiting for headers] 40.5 kB/s 0s
bzip2: (stdin): trailing garbage after EOF ignored
Get:13 http://archive.ubuntu.com precise-updates/main TranslationIndex [3564 B]
Get:14 http://archive.ubuntu.com precise-updates/multiverse TranslationIndex [2605 B]
Get:15 http://archive.ubuntu.com precise-updates/restricted TranslationIndex [2461 B]
Get:16 http://archive.ubuntu.com precise-updates/universe TranslationIndex [2850 B]
Get:17 http://archive.ubuntu.com precise-security/main amd64 Packages [180 kB]
Get:18 http://archive.ubuntu.com precise-security/restricted amd64 Packages [3969 B]
Get:19 http://archive.ubuntu.com precise-security/universe amd64 Packages [48.6 kB]
Get:20 http://archive.ubuntu.com precise-security/multiverse amd64 Packages [2188 B]
Get:21 http://archive.ubuntu.com precise-security/main i386 Packages [186 kB]
Get:22 http://archive.ubuntu.com precise-security/restricted i386 Packages [3968 B]
Get:23 http://archive.ubuntu.com precise-security/universe i386 Packages [48.7 kB]
Get:24 http://archive.ubuntu.com precise-security/multiverse i386 Packages [2357 B]
Get:25 http://archive.ubuntu.com precise-security/main TranslationIndex [73 B]
Get:26 http://archive.ubuntu.com precise-security/multiverse TranslationIndex [71 B]
Get:27 http://archive.ubuntu.com precise-security/restricted TranslationIndex [71 B]
Get:28 http://archive.ubuntu.com precise-security/universe TranslationIndex [73 B]
Get:29 http://archive.ubuntu.com precise/main Translation-en [726 kB]
Get:30 http://archive.ubuntu.com precise/multiverse Translation-en [93.4 kB]
Get:31 http://archive.ubuntu.com precise/restricted Translation-en [2395 B]
Get:32 http://archive.ubuntu.com precise/universe Translation-en [3341 kB]
Get:33 http://archive.ubuntu.com precise-updates/main Translation-en [206 kB]
Get:34 http://archive.ubuntu.com precise-updates/multiverse Translation-en [5606 B]
Get:35 http://archive.ubuntu.com precise-updates/restricted Translation-en [2048 B]
Get:36 http://archive.ubuntu.com precise-updates/universe Translation-en [89.7 kB]
Get:37 http://archive.ubuntu.com precise-security/main Translation-en [88.6 kB]
Get:38 http://archive.ubuntu.com precise-security/multiverse Translation-en [995 B]
Get:39 http://archive.ubuntu.com precise-security/restricted Translation-en [978 B]
Get:40 http://archive.ubuntu.com precise-security/universe Translation-en [30.3 kB]
Fetched 6264 kB in 36s (174 kB/s)
W: Failed to fetch gzip:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_precise-updates_main_binary-i386_Packages Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_precise-updates_restricted_binary-i386_Packages Hash Sum mismatch

W: Failed to fetch gzip:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_precise-updates_universe_binary-i386_Packages Hash Sum mismatch

W: Failed to fetch bzip2:/var/lib/apt/lists/partial/archive.ubuntu.com_ubuntu_dists_precise-updates_multiverse_binary-i386_Packages Hash Sum mismatch

E: Some index files failed to download. They have been ignored, or old ones used instead.
root@OptiPlex-990:/var/cache/apt/archives# find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;

/etc/apt/sources.list.d/jconti-gnome3-oneiric.list

     1 # deb http://ppa.launchpad.net/jconti/gnome3/ubuntu oneiric main
     2 # deb-src http://ppa.launchpad.net/jconti/gnome3/ubuntu oneiric main

/etc/apt/sources.list.d/webupd8team-themes-oneiric.list

     1 # deb http://ppa.launchpad.net/webupd8team/themes/ubuntu oneiric main
     2 # deb-src http://ppa.launchpad.net/webupd8team/themes/ubuntu oneiric main

/etc/apt/sources.list

     1 # deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Release amd64 (20111012)]/ dists/oneiric/main/binary-i386/
     2
     3 # deb cdrom:[Ubuntu 11.10 _Oneiric Ocelot_ - Release amd64 (20111012)]/ oneiric main restricted
     4
     5 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
     6 # newer versions of the distribution.
     7 deb http://archive.ubuntu.com/ubuntu precise main restricted
     8
     9 ## Major bug fix updates produced after the final release of the
    10 ## distribution.
    11 deb http://archive.ubuntu.com/ubuntu precise-updates main restricted
    12
    13 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    14 ## team. Also, please note that software in universe WILL NOT receive any
    15 ## review or updates from the Ubuntu security team.
    16 deb http://archive.ubuntu.com/ubuntu precise universe
    17 deb http://archive.ubuntu.com/ubuntu precise-updates universe
    18
    19 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    20 ## team, and may not be under a free licence. Please satisfy yourself as to
    21 ## your rights to use the software. Also, please note that software in
    22 ## multiverse WILL NOT receive any review or updates from the Ubuntu
    23 ## security team.
    24 deb http://archive.ubuntu.com/ubuntu precise multiverse
    25 deb http://archive.ubuntu.com/ubuntu precise-updates multiverse
    26
    27 ## N.B. software from this repository may not have been tested as
    28 ## extensively as that contained in the main release, although it includes
    29 ## newer versions of some applications which may provide useful features.
    30 ## Also, please note that software in backports WILL NOT receive any review
    31 ## or updates from the Ubuntu security team.
    32
    33 deb http://archive.ubuntu.com/ubuntu precise-security main restricted
    34 deb http://archive.ubuntu.com/ubuntu precise-security universe
    35 deb http://archive.ubuntu.com/ubuntu precise-security multiverse
    36
    37 ## Uncomment the following two lines to add software from Canonical's
    38 ## 'partner' repository.
    39 ## This software is not part of Ubuntu, but is offered by Canonical and the
    40 ## respective vendors as a service to Ubuntu users.
    41 deb http://archive.canonical.com/ubuntu precise partner
    42 deb-src http://archive.canonical.com/ubuntu precise partner
    43
    44 ## This software is not part of Ubuntu, but is offered by third-party
    45 ## developers who want to ship their latest software.
    46 # deb http://extras.ubuntu.com/ubuntu precise main
    47 # deb-src http://extras.ubuntu.com/ubuntu precise main
    48

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Why are you adding the Gnome3 PPA. You already have Gnome3. Also try running this. It will run the package fix right. You have tried to retype the command and it hasn't gone right. Also, you are root so why are you using sudo?

wget https://dl.dropbox.com/u/8850924/fixpackage; chmod +x ./fixpackage; sudo ./fixpackage

Revision history for this message
slowtrain (pmuhl830) said :
#2

Just tried reinstalling all software that comes up in synaptic when I search for bzip2, just in case my bzip2 is corrupted.

That runs successfully, then I cleaned my apt lists and apt archive partial and tried to apt-get update and apt-get upgrade. Update fetches its files but I still get two bzip2 error messages. Upgrade doesn't show any bzip2 errors. But, after a few successful downloads, I start getting a string of messages such as:

Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/a/apparmor/apparmor_2.7.102-0ubuntu3.4_amd64.deb Size mismatch

And, yes, I've previously tried switching servers and cleaning up my apt list, but continue to get the error above.

I suspect the problem has something to do with this machine, because I have a laptop, also with an i7 chip and using ubuntu for amd64, that was able to upgrade yesterday without complaints. The machine w/ the problem was upgraded several weeks ago from ubuntu 11.10, while the laptop has always been 12.04.

Revision history for this message
slowtrain (pmuhl830) said :
#3

Hi actionparsnip:

Thanks for your time!

I have tried each of the commands in fixpackage--in fact, they are in my copy of my terminal output. These commands do not solve my problem.

I once upon a time had added gnome3 PPA--didn't realize it was already installed. What you are seeing are some leftover files from that, but gnome3 PPA is not active in my sources.list, so should not be affecting my downloads.

I was copying and pasting commands, which is why sudo shows up when I'm root. You're right there's no need for that, but there's no harm either, or so I believe.

Revision history for this message
slowtrain (pmuhl830) said :
#4

Ok, for what it's worth, I seem to have 'solved' my problem. I just kept re-running apt-get upgrade. I noticed that packages that were on earlier runs indicated as "Size mismatch" were being completed and moved out of the partial folder. So, I just had to re-run apt-get upgrade enough times that all the software was downloaded. Then it installed.

While this gets me fresh software, it doesn't prevent this from happening again the next time I need software. So, it's a workaround, but it also concerns me that this is happening--could it be that something is corrupted in the system? Have I been hacked? etc.

Revision history for this message
slowtrain (pmuhl830) said :
#5

I guess the other issue is that I don't know that I have all the latest packages because apt-get update had bzip problems with some of the files it was trying to download.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#6

The commands delete all the package lists which you had then redownloads fresh versions. It'll be ok from now on.

Revision history for this message
slowtrain (pmuhl830) said :
#7

Hi again actionparsnip: In the past week, I've repeatedly erased my package lists and redownloaded fresh versions. The problems persisted. And, after running those commands as shown in my initial post above, I get the bzip2 error, the Hash Sum mismatches, and the 'unable to parse the package file i18n_Index' error. I seem to have been able to get around the hash sum problems by repeatedly running apt-get upgrade until it finally was able to download all the packages and install them, but with the bzip2 errors, I don't know that I have all updates and expect another round of problems the next time I have to get updates.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#8

I suggest you report a bug

Can you help with this problem?

Provide an answer of your own, or ask slowtrain for more information if necessary.

To post a message you must log in.