0

Thank you for reading this.

I am having difficulties updating installing packages on a raspberry pi.

Disclaimer: I am a massive linux noob, please be gentle.

Note: I am doing this over SSH, in case this has something to do with it.
My raspberry pi used to run on jessie, but I updated it to bullseye, which (may have) lead to the problem.

My problem

Since pip wasn't installing anything, (SSL errors) I looked it up and found out I might have to upgrade openssl, but it wouldn't work.

I tried this with many other packages and got the same issues.

Whenever I wanted to install anything after the upgrade, I would get "Unmet dependencies"
I looked it up and tried apt install -f and the same with apt upgrade openssl -f

But I would always get

E: Sub-process /usr/bin/dpkg returned an error code (1)

Here is an example, when installing vim:

pi@raspberrypi:~ $ sudo apt-get install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
dpkg-dev : Depends: libdpkg-perl (= 1.20.9) but 1.18.25 is to be installed
            Recommends: build-essential but it is not going to be installed
  vim : Depends: vim-common (= 2:8.2.2434-3) but 2:7.4.488-7+deb8u4 is to be installed
        Depends: vim-runtime (= 2:8.2.2434-3) but it is not going to be installed
        Depends: libgpm2 (>= 1.20.7) but 1.20.4-6.1 is to be installed
        Depends: libtinfo6 (>= 6) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
pi@raspberrypi:~ $ sudo apt --fix-broken install

... Lots of lines of output, log can be found here

Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I found online I could probably update dpkg, but I'm not completely sure on how to do that. dpkg at this point is completely unusable, even downloading the latest dpkg and loading it with dpkg -i new_dpkg.deb won't do anything.

So did I screw up my system, or is it just PEBKAC?

If it's the former, how would I go about fixing it?

Many thanks in advance and sorry for the noob question


Other info:

os-release, sources.txt, dpkg configure a: here

Edit: I think it may have to do with the sources.txt, make sure to click the link above

7
  • Your question and its links show a mix of debian (or raspbian) 8 ("2:7.4.488-7+deb8u4"), 9 ("but 1.18.25 is to be installed") , and 11 (link shows PRETTY_NAME="Debian GNU/Linux 11 (bullseye)" ). Something is wrong in your question itself. When dist upgrading, you have to upgrade one version at a time: 8-> 9 -> 10 -> 11, not 9 -> 11. I'm not sure if there are 10 parts too.
    – A.B
    Jun 29, 2021 at 21:44
  • I know, on the site that showed me how to upgrade, initially i tried to upgrade from jessie to stretch, then to buster, but I think I messed it up and acccidentally skipped both stretch and buster and went to bullseye. Do you think this could be the issue? Would I have to reinstall it?
    – m-doescode
    Jun 29, 2021 at 21:47
  • With good knowledge it's salvageable. But with the statement "I am a massive linux noob", you'd rather do a backup of your data and reinstall.
    – A.B
    Jun 29, 2021 at 21:49
  • Yeah, you're right. Thankfully, I haven't touched it in years and barely have any data on it. So a reinstall would be feasable. I was just wondering if there was an easier way. Thank you for letting me know.
    – m-doescode
    Jun 29, 2021 at 21:51
  • For one dist upgrade problem between 2 releases yes, but you have potentially a mix of problems between 4 releases.
    – A.B
    Jun 29, 2021 at 21:53

1 Answer 1

2

Your question and its links show a mix of multiple releases of Debian/Raspbian either in current state or configured repository sources with clashing package versions:

and apparently no trace of version 10.

Distribution upgrades should be done one step at a time: 8 -> 9 -> 10 -> 11, and not be attempted before the previous upgrade is completed without remaining issues. Here it appears 8 -> 9 wasn't complete but was nevertheless followed by an attempt to upgrade to bullseye (soon to be released as version 11 but not officially released) and it appears also without a step at version 10.

Repairing multiple layers of problems caused by this appears not worth the trouble. You should consider backing up important data and user accounts and reinstalling directly (eg: with Raspberry Pi OS 10), and then putting back former data (which might require adapting to newer versions) and user accounts.

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.