1

I asked on StackOverflow but was redirected here .

I'm afraid I made a kind of a booboo.

While performing an apt-get upgrade (there were about 160+ packages in queue) I accidentally logged out, thus aborting the upgrade midway. Now I can't restart the upgrade.

apt-get upgrade says there are no packages to upgrade...

apt-get update gives errors:

W: Failed to fetch http://security.debian.org/dists/wheezy/updates/main/binary-armel/Packages  Hash Sum mismatch

W: Failed to fetch http://security.debian.org/dists/wheezy/updates/contrib/binary-armel/Packages  Hash Sum mismatch

W: Failed to fetch http://security.debian.org/dists/wheezy/updates/non-free/binary-armel/Packages  Hash Sum mismatch

[several more of these... and ending in: ]
E: Some index files failed to download. They have been ignored, or old ones used instead.
E: Couldn't rebuild package cache

Full output is here on pastebin

I tried these without success:

  • apt-get -f install

Output:

Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  • dpkg --configure -a

No output

  • rm -vf /var/lib/apt/lists/*; rm -vf /var/lib/apt/lists/partial/*; apt-get update

Same errors as above.

  • dpkg-reconfigure -a

Eventually aborts after this:

[ ok ] Stopping acpid (via systemctl): acpid.service.
[ ok ] Starting acpid (via systemctl): acpid.service.
[ ok ] Stopping apache2 (via systemctl): apache2.service.
[ ok ] Starting apache2 (via systemctl): apache2.service.
gpg: key B98321F9: "Squeeze Stable Release Key <debian-release@lists.debian.org>" not changed
gpg: key 473041FA: "Debian Archive Automatic Signing Key (6.0/squeeze) <ftpmaster@debian.org>" not changed
gpg: key 65FFB764: "Wheezy Stable Release Key <debian-release@lists.debian.org>" not changed
gpg: key 46925553: "Debian Archive Automatic Signing Key (7.0/wheezy) <ftpmaster@debian.org>" not changed
gpg: key 518E17E1: "Jessie Stable Release Key <debian-release@lists.debian.org>" not changed
gpg: key 2B90D010: "Debian Archive Automatic Signing Key (8/jessie) <ftpmaster@debian.org>" not changed
gpg: key C857C906: "Debian Security Archive Automatic Signing Key (8/jessie) <ftpmaster@debian.org>" not changed
gpg: Total number processed: 7
gpg:              unchanged: 7
[ ok ] Stopping avahi-daemon (via systemctl): avahi-daemon.service.
[ ok ] Reloading dbus configuration (via systemctl): dbus.service.
[ ok ] Starting avahi-daemon (via systemctl): avahi-daemon.service.
update-alternatives: using /usr/share/man/man7/bash-builtins.7.gz to provide /usr/share/man/man7/builtins.7.gz (builtins.7.gz) in auto mode
update-initramfs: deferring update (trigger activated)
[ ok ] Starting loadcpufreq (via systemctl): loadcpufreq.service.
[ ok ] Starting cpufrequtils (via systemctl): cpufrequtils.service.
[ ok ] Stopping cron (via systemctl): cron.service.
[ ok ] Starting cron (via systemctl): cron.service.
[ ok ] Starting dbus (via systemctl): dbus.service.
update-initramfs: deferring update (trigger activated)
update-initramfs: deferring update (trigger activated)
update-initramfs: deferring update (trigger activated)
Regenerating fonts cache... done.
udev active, skipping device node creation.
update-initramfs: deferring update (trigger activated)
dpkg-query: error: --status needs a valid package name but 'gcc-4.7-base' is not: ambiguous package name 'gcc-4.7-base' with more than one installed instance

Use --help for help about querying packages.
/usr/sbin/dpkg-reconfigure: gcc-4.7-base is not installed

I don't know how to find out what was installed and what was not.

Any tips how to recover from this are very welcome!

1

This probably should be moved to superuser or such, but since you already were re-directed...

First I would suggest to run such things in a screen session. That will keep the update going when you log out or the connection dies:

screen -S upd

To de-tach the session press CTRL a then press d

To re-attach the session type:

screen -r upd

It will be helpful to also paste the output of the things you listed which you tried without success.

Some suggestions:

  • did you try to switch the repository
  • did you recursively remove /var/lib/apt/lists/*
  • did you mkdir /var/lib/apt/lists/partial

I got my suggestions from: https://askubuntu.com/questions/41605/trouble-downloading-packages-list-due-to-a-hash-sum-mismatch-error/

Edit: judging from the info you added you may need to force remove gcc-4.7-base and then re-install it and repeat dpkg-reconfigure -a. If it then fails for another package repeat this process until it succeeds, then re-run apt-get (dist-)upgrade.

  • I switched from us to nl repository. Problem remains. – Mausy5043 Nov 28 '15 at 8:01
  • I did rm -rf /var/lib/apt/lists; mkdir /var/lib/apt/lists/partial. Problem remains. – Mausy5043 Nov 28 '15 at 8:03
  • See my edited answer. – aseq Nov 30 '15 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.