2

Hi I had this problem on the raspberry pi B+ with wheezy OS version. Since nothing worked out I decided to update the OS by changing the ppas from Wheezy to Stretch.

It updated partially but it did not completed it: some packages remain to be upgraded, dist-upgraded or removed. However if I try any apt command I get the following error:

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

So I try to run sudo dpkg --configure -a but first it hangs on here:

setting up apache2 (2.4.10-10+deb8u11) ...
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) 
insserv: warning: current start runlevel(s) (empty) of script `apache2' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `apache2' overrides LSB defaults (0 1 6).

So I interrupted it with CTRL+C. After that it hangs on here

 subprocess installed post-installation script was interrupted
Setting up python-support (1.0.15) ...
Setting up nfs-common (1:1.2.8-9) ...
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
insserv: warning: current start runlevel(s) (empty) of script `nfs-common' overrides LSB defaults (S).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6 S) of script `nfs-common' overrides LSB defaults (0 1 6).

I again interrupt it and finally it hangs on here:

 subprocess installed post-installation script was interrupted
Setting up udisks2 (2.1.3-5) ...

How can I complete the upgrade?

4
  • It will be safer and perhaps quicker to copy the files you want from the SD card and then re-write it with an up to date image.
    – joan
    Commented Mar 7, 2018 at 11:52
  • I thought of that but I wanted to keep it as last option. Commented Mar 7, 2018 at 12:22
  • 1
    Upgrades that skip a whole version are not a good idea. You should have upgraded to jessie, then to stretch. If you keep independent backups of your own stuff synced, and a list of at least some of the major pieces of software you installed, doing a complete fresh install is faster, easier, and less prone to error than upgrading.
    – goldilocks
    Commented Mar 7, 2018 at 13:35
  • Actually I tried that first!! Commented Mar 7, 2018 at 14:39

2 Answers 2

4

I do not recommended to upgrade Raspbian from Wheezy (Debian 7) to Raspbian Stretch (Debian 9) and skip Raspbian Jessie (Debian 8).

Fyi: table of Debian releases

Option 1: upgrade from 7 to 8 to 9

Backup first. Then upgrade from Wheezy to Jessie (i.e. like described here) and afterwards from Jessie to Stretch.

Option 2: abandon 7, skip 8, install 9

Backup your old Wheezy and all needed data, format the SD card and install Stretch (like described here). This way you will get a stable OS.

Weighing up

Both options can result in comparable effort, but it is difficult to say from here. If there are only a few projects running on Wheezy and it is simple to redo all needed changes after a new installation, I would vote for option 2. And based on my experiences I do not think that an upgrade from 7 to 8 to 9 will finish without errors.

Maybe you have a second SD card and want to try both options. And like always: please do a backup first :-)

0
1

I have been in the same situation, and while it is possible to fix it, it is most likely not worth it due to the amount of manual labour. First of all, you will need to upgrade a number of packages and their dependencies manually using dpkg and a number or force options to overwrite system packages and accept broken dependencies. This also involves manually getting the package files and their dependencies ahead of time since you may lose the ability to do so during the process. You also won’t be able to reboot until it’s done because during the manual upgrade the system will not be bootable.

The task at hand involves getting a list of base packages which amongst others contain the kernel, systemd, libc, apt, dpkg and basic userland. Those, and their dependencies will need to be force-installed over the old ones before you can continue. Next will be running apt upgrade and dist-upgrade to find out what broken packages are left, and finding them and their minimal dependencies, and force-installing them over as well. You continue this loop of apt upgrade, dist-upgrade and manual installs until apt reports no remaining packages. Next, you check dpkg -l for old packages that have no stretch version and don’t do anything and remove those. Then you reboot and it might work, if not, standard recovery using install media plus the chroot recovery shell will apply.

1
  • .Thanks. I will format the sd. It comforts me somebody else tried it. Commented Mar 8, 2018 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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