2

I was in the middle of upgrading to Bullseye from Buster when my SSH session failed, and I couldn't ssh into the machine anymore. I rebooted it, and now am presented with this problem.

I have attempted --fix-broken but it just outputs the same thing over and over again. I think I would want to install the baseline version of packages for bullseye I should be set, I have nothing mission critical going on here, just am unsure how to untangle the currently installed packages.

pi@pihole:~ $ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
 bsdmainutils : Depends: ncal but it is not installed
 libc-bin : Depends: libc6 (< 2.29) but 2.31-13+rpi1+deb11u2 is installed
 libc-dev-bin : Depends: libc6 (< 2.29) but 2.31-13+rpi1+deb11u2 is installed
 libc6-dbg : Depends: libc6 (= 2.28-10+rpt2+rpi1) but 2.31-13+rpi1+deb11u2 is installed
 libc6-dev : Depends: libc6 (= 2.28-10+rpt2+rpi1) but 2.31-13+rpi1+deb11u2 is installed
 locales : Depends: libc-bin (> 2.31) but 2.28-10+rpt2+rpi1 is installed
 openssh-sftp-server : Depends: openssh-client (= 1:7.9p1-10+deb10u2+rpt1) but 1:8.4p1-5+b1 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

Looking at the policy for libc6:

pi@pihole:~ $ apt policy libc6
libc6:
  Installed: 2.31-13+rpi1+deb11u2
  Candidate: 2.31-13+rpt2+rpi1+deb11u2
  Version table:
     2.31-13+rpt2+rpi1+deb11u2 500
        500 http://archive.raspberrypi.org/debian bullseye/main armhf Packages
 *** 2.31-13+rpi1+deb11u2 500
        500 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages
        100 /var/lib/dpkg/status

And same for libc-bin:

pi@pihole:~ $ apt policy libc-bin
libc-bin:
  Installed: 2.28-10+rpt2+rpi1
  Candidate: 2.31-13+rpt2+rpi1+deb11u2
  Version table:
     2.31-13+rpt2+rpi1+deb11u2 500
        500 http://archive.raspberrypi.org/debian bullseye/main armhf Packages
     2.31-13+rpi1+deb11u2 500
        500 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf Packages
 *** 2.28-10+rpt2+rpi1 100
        100 /var/lib/dpkg/status

Current /etc/apt/sources.list && /etc/apt/sources.list.d/raspi.list:

pi@pihole:~ $ cat /etc/apt/sources.list
deb http://raspbian.raspberrypi.org/raspbian/ bullseye main contrib non-free rpi

---

pi@pihole:~ $ cat /etc/apt/sources.list.d/raspi.list
deb http://archive.raspberrypi.org/debian/ bullseye main
5
  • Were you doing a manual upgrade? Do you have a backup of your buster system?
    – Seamus
    Jan 6, 2022 at 9:34
  • @Seamus nay ;( - but the system is mostly working just apt is borked Jan 6, 2022 at 23:12
  • Backups are so convenient with image-utils... you have officially run out of excuses :)
    – Seamus
    Jan 7, 2022 at 0:39
  • 1
    @dalanmiller Have you found a solution? I have exactly the same problem.
    – doydoy44
    Jan 24, 2022 at 18:47
  • According to a post elsewhere: "Installing gcc-8-base (sudo apt install gcc-8-base) appeared to do the trick for me" (unix.stackexchange.com/a/592703/33071)
    – John U
    Aug 2 at 14:55

1 Answer 1

1

Just had the same issue and I would recommend starting from scratch. So a clean image with bullseye instead of upgrading from buster. It was kinda horrible what was left of it...after trying to upgrade. If you want to repair the system manually, do the following:

For me almost everything got uninstalled (sudo, bash, vim, ssh etc) and I managed to get it working by the following lines:

sudo passwd # to make sure you have a password on root, just did this before removal 
sudo su # to make sure you are a privileged user and stay for this session

sed -i 's/bullseye/buster/' /etc/apt/sources.list 
sed -i 's/bullseye/buster/' /etc/apt/sources.list.d/raspi.list
cd /root
apt-get download libc6=2.28-10+rpt2+rpi # syntax is 'package:arch=version'
dpkg -i ./libc6_2.28-10+rpt2+rpi1_armhf.deb #if it complains, try to find the root cause and download / install that package.

The following packages will be DOWNGRADED:
  libc6
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove.
Do you want to continue? [Y/n] yes

after this you can continue install / fix the environment.

Also check /var/log/apt/ directory for everything that has happened ;)

Your Answer

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

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