Mad Scientist
Posts: 4
Joined: Fri Oct 04, 2019 4:31 pm

Upgraded to Buster and get error with 'apt-get' or 'apt'

Fri Oct 04, 2019 4:47 pm

I'm getting the following error message with 'apt-get' or 'apt'. Any ideas how to fix this???

$ sudo apt-get update && sudo apt-get upgrade -y
apt-get: relocation error: /usr/lib/arm-linux-gnueabihf/libapt-private.so.0.0: symbol _ZN3URIcvNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEB5cxx11Ev version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Upgraded to Buster and get error with 'apt-get' or 'apt'

Fri Oct 04, 2019 5:18 pm

How did you do the upgrade? Fresh install or upgrade from Stretch?
What's in /etc/apt/sources.list and /etc/apt/sources.list.d/*.list?
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Mad Scientist
Posts: 4
Joined: Fri Oct 04, 2019 4:31 pm

Re: Upgraded to Buster and get error with 'apt-get' or 'apt'

Fri Oct 04, 2019 5:35 pm

Upgraded from 'stretch'.

/etc/apt/sources.list .....
deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non$
# Uncomment line below then 'apt-get update' to enable 'apt-get sourc$
#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contri$

/etc/apt/sources.list.d .....
raspi.list

User avatar
DougieLawson
Posts: 39304
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Upgraded to Buster and get error with 'apt-get' or 'apt'

Fri Oct 04, 2019 5:40 pm

Download this: http://raspbian.raspberrypi.org/raspbia ... _armhf.deb
and http://raspbian.raspberrypi.org/raspbia ... _armhf.deb

Install it with sudo dpkg -i libapt-pkg5.0_1.8.4_armhf.deb; sudo dpkg -i apt_1.8.4_armhf.deb
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Mad Scientist
Posts: 4
Joined: Fri Oct 04, 2019 4:31 pm

Re: Upgraded to Buster and get error with 'apt-get' or 'apt'

Fri Oct 04, 2019 5:52 pm

Now I'm running into this ..... (BTW, Thank you for your help!)

$ sudo dpkg -i libapt-pkg5.0_1.8.4_armhf.deb; sudo dpkg -i apt_1.8.4_armhf.deb
(Reading database ... 131706 files and directories currently installed.)
Preparing to unpack libapt-pkg5.0_1.8.4_armhf.deb ...
Unpacking libapt-pkg5.0:armhf (1.8.4) over (1.8.4) ...
dpkg: dependency problems prevent configuration of libapt-pkg5.0:armhf:
libapt-pkg5.0:armhf depends on libstdc++6 (>= 9); however:
Version of libstdc++6:armhf on system is 6.3.0-18+rpi1+deb9u1.

dpkg: error processing package libapt-pkg5.0:armhf (--install):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.28-10+rpi1) ...
Errors were encountered while processing:
libapt-pkg5.0:armhf
(Reading database ... 131706 files and directories currently installed.)
Preparing to unpack apt_1.8.4_armhf.deb ...
Unpacking apt (1.8.4) over (1.8.4) ...
dpkg: dependency problems prevent configuration of apt:
apt depends on libapt-pkg5.0 (>= 1.7.0~alpha3~); however:
Package libapt-pkg5.0:armhf is not configured yet.
apt depends on libstdc++6 (>= 9); however:
Version of libstdc++6:armhf on system is 6.3.0-18+rpi1+deb9u1.

dpkg: error processing package apt (--install):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.28-10+rpi1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Errors were encountered while processing:
apt

fruitoftheloom
Posts: 23549
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Upgraded to Buster and get error with 'apt-get' or 'apt'

Fri Oct 04, 2019 6:45 pm

Mad Scientist wrote:
Fri Oct 04, 2019 4:47 pm
I'm getting the following error message with 'apt-get' or 'apt'. Any ideas how to fix this???

$ sudo apt-get update && sudo apt-get upgrade -y
apt-get: relocation error: /usr/lib/arm-linux-gnueabihf/libapt-private.so.0.0: symbol _ZN3URIcvNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEB5cxx11Ev version APTPKG_5.0 not defined in file libapt-pkg.so.5.0 with link time reference

The Raspberry Pi Foundation do not recommend going from Stretch to Buster:

We do not recommend upgrading an existing Stretch (or earlier) system to Buster – we can’t know what changes everyone has made to their system, and so have no idea what may break when you move to Buster.

https://www.raspberrypi.org/blog/buster ... -raspbian/
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot) RaspiOS64 ARM64
Asus ChromeBox 3 Celeron is my other computer...

bjtheone
Posts: 883
Joined: Mon May 20, 2019 11:28 pm
Location: The Frozen North (AKA Canada)

Re: Upgraded to Buster and get error with 'apt-get' or 'apt'

Fri Oct 04, 2019 7:32 pm

You can likely continue down the rabbit hole of resolving dependencies, once you bottom them out you will be able to install everything and it should mostly work. You may still have issues, and certainly will have unused, unwanted leftovers from the last version of Debian. The more exactly stock your install of Stretch is, the more likely it is that an upgrade will work.

Given that SD cards are so cheap, and it is so easy to just use another one, the better approach as fruitoftheloom pointed out is to start fresh with Buster. Load it on a new/different SD card, using Etcher. Once you have it up and running, add in your extra apps and then just mount your old SD card via a USB adaptor and copy across any data you want to keep. This will likely be faster, will certainly be easier, and will ensure that you have a functional bootable system (with your old Stretch image) and all your data will be safe. Once you have everything updated to Buster and fully working you can recycle the old SD card as whatever (a spare, a backup copy of your current card, reserved for the next OS upgrade, etc)

Return to “Troubleshooting”