Page 1 of 1

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

Posted: Fri Oct 04, 2019 4:47 pm
by Mad Scientist
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

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

Posted: Fri Oct 04, 2019 5:18 pm
by DougieLawson
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?

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

Posted: Fri Oct 04, 2019 5:35 pm
by Mad Scientist
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

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

Posted: Fri Oct 04, 2019 5:40 pm
by DougieLawson
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

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

Posted: Fri Oct 04, 2019 5:52 pm
by Mad Scientist
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

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

Posted: Fri Oct 04, 2019 6:45 pm
by fruitoftheloom
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/

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

Posted: Fri Oct 04, 2019 7:32 pm
by bjtheone
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)