Problem updating package information

Having recently restored a system using a backup I discovered that I could not upgrade it using ‘apt-get update’ and ‘apt-get upgrade’ as I expected. The latest package lists would start to download and then the process appeared to hang at 100%…

# apt-get update
Ign http://ftp.uk.debian.org jessie InRelease
Get:1 http://ftp.uk.debian.org jessie-updates InRelease [145 kB]
Get:2 http://security.debian.org jessie/updates InRelease [63.1 kB]
Hit http://ftp.uk.debian.org jessie Release.gpg
Hit http://ftp.uk.debian.org jessie Release
  :
  :
  :
100% [Waiting for headers]
^C

I decided that since there were probably some old package lists on the system it was a good idea to delete them, and clean out the package cache.

# apt-get clean
# find /var/lib/apt/lists -type f -printf “%f\n”
ftp.uk.debian.org_debian_dists_jessie-updates_main_source_Sources.gz
ftp.uk.debian.org_debian_dists_jessie-updates_main_i18n_Translation-en.bz2
security.debian.org_dists_jessie_updates_main_binary-amd64_Packages.bz2
ftp.uk.debian.org_debian_dists_jessie_main_source_Sources.gz
ftp.uk.debian.org_debian_dists_jessie-updates_main_source_Sources.xz
security.debian.org_dists_jessie_updates_InRelease.reverify
ftp.uk.debian.org_debian_dists_jessie_main_i18n_Translation-en.bz2
security.debian.org_dists_jessie_updates_main_source_Sources.bz2
ftp.uk.debian.org_debian_dists_jessie-updates_InRelease.reverify
ftp.uk.debian.org_debian_dists_jessie-updates_main_binary-amd64_Packages.xz
ftp.uk.debian.org_debian_dists_jessie_main_source_Sources.xz
ftp.uk.debian.org_debian_dists_jessie_main_binary-amd64_Packages.gz
security.debian.org_dists_jessie_updates_main_i18n_Translation-en.bz2
ftp.uk.debian.org_debian_dists_jessie_main_binary-amd64_Packages.xz
# find /var/lib/apt/lists -type f -delete
# apt-get clean
# apt-get update
Ign http://ftp.uk.debian.org jessie InRelease
Get:1 http://ftp.uk.debian.org jessie-updates InRelease [145 kB]
  :
  :
  :
Fetched 19.5 MB in 24s (785 kB/s)
Reading package lists… Done
#

Fortunately it worked – now I can carry on and update the system!

Note – I only used ‘-printf “%f\n”‘ in the find command above to ensure that the output would fit on this page, normally I’d just use ‘- print’.

Advertisements
This entry was posted in Debian, Linux and tagged . Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s