gzip error when updating packages

Bug #59353 reported by Caroline Ford
26
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

This is on the forums here (http://www.ubuntuforums.org/showthread.php?t=245059&highlight=gzip)

It is random and it looks like something (possibly a time out) corrupts the file so that updating always fails. Other repositories will work fine, even those which are also archive.ubuntu or security.ubuntu.

When running update-manager an affected repository will fail with:

http://security.ubuntu.com/ubuntu/dists/dapper-security/main/binary-i386/Packages.gz: Sub-process gzip returned an error code (1)

I can't be much more precise as to the trigger but the solution posted in the forums (using a blank sources.list, running sudo apt-get update, reinstating sources.list and running sudo apt-get update again) clears up the problem.

Revision history for this message
Rocco Stanzione (trappist) wrote :

Setting this as confirmed, since it has two duplicates and I experienced this in Dapper - but not since the upgrade to Edgy.

Changed in apt:
status: Unconfirmed → Confirmed
Revision history for this message
Ali Najand (ali-najand) wrote :

This is more likely to be a coonection problem than a bug. The reason this problem happens is that apt keeps the partial downloads in /var/lib/apt/lists/partial/ and sometimes because of some faulty connection to the internet some parts of the list the repositories (in gzip format) cannot be downloaded properly.
The easiest way to solve this problem is to remove all contents of the partial folder by a simple command:

sudo rm -v /var/lib/apt/lists/partial/*

and then try to update the apt again.

Can someone check it out and send us the results?

Revision history for this message
Chris Wagner (chris-wagner) wrote :

A connection problem should not leave a computer in an unusable state. So, this is certainly a bug. The question is, who's bug is it? I would say it could only be apt's responsibility.

One possible solution... Since apt can't know for sure that the official Packages.gz (as it is in the repository) is not corrupt, it can't guarantee that another re-download of the archive won't result in the same issue over and over. So, perhaps apt could move the original archive to another location (e.g., Packages.gz.bak), re-download the archive from the repository, and compare the two; if they are identical, it's likely a problem with the repository, and apt could give up with a message indicating so. That'd be some work though...

Revision history for this message
Caroline Ford (secretlondon) wrote : Re: [Bug 59353] Re: gzip error when updating packages

Oh it's definitely caused by connection problems - the problem is that
it doesn't recover from it. However many times you try and update
afterwards it will never succeed unless you fiddle with the sources file.

Revision history for this message
Caroline Ford (secretlondon) wrote :

I admit to knowing nothing of the mechanics - but it seems to me the
problem is how apt deals with partial files. As apt appears to know how
big the file is when it starts downloading it should be able to identify
partial downloads. A certain % of these will not allow downloads to
resume when interrupted - the majority will continue where they left off.

Maybe it could be as simple as removing so many bytes from the end of
the file before resuming?

Revision history for this message
Ali Najand (ali-najand) wrote :

I agree with that. The problem is that the way apt deals with partial files. Maybe a practical solution is like making it to remove the partial data of Packages.gz every time the update process fails with similar reasons. And probably, an additional task to comment out the repositories that do not work for a specified number of times.

Revision history for this message
cmnorton (octopusgrabbus) wrote :

I have also received this error while upgrading from 6.06 to 6.10.

Failed to fetch http://archive.ubuntu.com/ubuntu/dists/edgy/universe/binary-i386/Packages.gz Sub-process gzip returned an error code (1)

If you would like me to attach portions of logs, I would be happy to do so.

Are there any workarounds?

I tried the suggestion above for removing partial packages

sudo rm -v /var/lib/apt/lists/partial/*

and then re-ran gksu "update-manager -c -d"

and I still got the same error.

Thanks.
Charles Norton

Revision history for this message
Caroline Ford (secretlondon) wrote :

The only work round I know of is to edit your sources.list file. You comment out the failing entry with a #, and then run apt-get update from the command line. Go back to sources.list and remove the #. When you run apt-get update again it should have repaired itself.

Revision history for this message
cmnorton (octopusgrabbus) wrote :

Caroline:

Many thanks for getting back to me. I will do this when I get back to work, and will also try another suggestion on the Edge Upgrade Common Problems site -- http://www.debianadmin.com/ubuntu-edgy-upgrade-common-problems-with-solutions.html -- about fixing the "future warning".

cmn

Charles M. Norton
Database Programmer/Systems Integrator
LPIC-1 Certified August 2007

----- Original Message ----
From: Caroline Ford <email address hidden>
To: <email address hidden>
Sent: Saturday, September 22, 2007 4:33:46 PM
Subject: [Bug 59353] Re: gzip error when updating packages

The only work round I know of is to edit your sources.list file. You
comment out the failing entry with a #, and then run apt-get update from
the command line. Go back to sources.list and remove the #. When you run
apt-get update again it should have repaired itself.

--
gzip error when updating packages
https://bugs.launchpad.net/bugs/59353
You received this bug notification because you are a direct subscriber
of the bug.

Revision history for this message
cmnorton (octopusgrabbus) wrote :

I am still getting the same general error:
Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/edgy/universe/binary-i386/Packages.gz Sub-process gzip returned an error code (1)

I am attaching my sources.list file, from which I have commented out two at the bottom. This is failing on the 21st file(?). I am not quite sure how to map the failure on the last load to what is in sources.list. Any help would be appreciated.

Thanks.
cmn

Revision history for this message
cmnorton (octopusgrabbus) wrote :

By using a combination of removing the partially downloaded files and incrementally commenting out stuff in sources.list, I did get a successful upgrade to 6.10. Thank you for the help and support, especially the incremental upgrade part.

Revision history for this message
Thomas Kluyver (takluyver) wrote :

I'll confirm that this problem still exists as of Feisty. The workaround (clear out /var/lib/apt/lists/partial/) worked, but it should do that automatically.

Revision history for this message
Michael Carr (michaelcarr) wrote : Re: "gzip error (1)" when updating packages.gz via a System update to ubuntu 7.04

The solution quoted below worked great for my:
packages.gz gzip error (1)
when doing a system update for ubuntu 7.04

I read several discussions, but the below solution seemed to be the most straight forward and least risky -- and it worked!!!

(Being really new to ubuntu, I would never have found this site if a Linux-Buddy hadn't sent me the link. Using the ubuntu provided help links and tools I got nowhere -- things like being referred to: search.ubuntu.com and it never being online are frustrating to say the least. But that is the way all things in the world are at times.)

Thanks to you, HymnToLife, and my good friend Mark Ahlstrom at the KTC Meditation Center.

Yours in Life,

Michael Carr

...

Quote:
http://ubuntuforums.org/showthread.php?p=3686478#post3686478

Originally Posted by HymnToLife

Try this :

backup your sources.list :

Code:
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup

open the old one in gedit with

Code:
gksudo gedit /etc/apt/sources.list

and delete everything so it's blank, then save it, close gedit and run

Code:
sudo apt-get update

then copy back your old sources.list

Code:
sudo mv /etc/apt/sources.list_backup /etc/apt/sources.list

run sudo apt-get update again and see how it goes

Revision history for this message
Jim Dagit (jimdagit) wrote :

I have ran into this bug in Edgy while trying to do some updates. It occurred twice at the same place while trying to update. I thought it might be due to a slow modem speed 9600. I have not tried changing the source yet.
Jim

Revision history for this message
AotearoanBlue (aotearoanblue) wrote :

commenting the erroneous line and running apt-get and then again uncommenting the line - doesn't work. I'm back to square one. When I commented the line, the apt-get worked fine though.

Revision history for this message
Yoishi (cyril-largouet) wrote :

Hi,

I had the same problem too.
But none of the solutions given above solved my problem.

Finally, one thing helped me : reading the files in the /var/lib/apt/lists/partial folder (instead of deleting them).
They told me to check out my DNS informations and gave me IP adresses supposed to be the good ones.
Even if I was able to ping www.google.com and other adresses, it's only when I changed my DNS that the probem was solved.

I don't really understand what append (maybe a cache somewhere) but be aware of your DNS informations too if you have this problem (/etc/resolv.conf).

Please excuse my bad english, I'm French.
Best regards.

Revision history for this message
Julian Andres Klode (juliank) wrote :

Connection issue.

Changed in apt (Ubuntu):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.