Kali Upgrade AS_APPSTREAM_METADATA_PATHS error

Android Tester
2 min readSep 9, 2020

--

This all started when I picked up an old laptop lying around hoping to set it up for better purposes. It had an older version of Kali installed. Generally I’m hesitant to change anything that’s working as I try to go with, “if it’s working, don’t try fixing” philosophy :)

However, after attempting to install a few packages I noticed they would fail due to unmet dependencies or obsolete packages. So I started the Kali upgrade process. First I made sure the sources.list contains the latest as documented here: https://www.kali.org/docs/general-use/updating-kali/

Then I ran the usual apt update commands first:

sudo apt-get update
sudo apt-get upgrade -y

This ran without any issues. However this was not sufficient to run the packages I needed, soI attempted the distro upgrade to the latest version with:

sudo apt update
sudo apt full-upgrade -y

This is where things started going south. After half and hour or so of downloading packages, installing them, the system started complaining about the following issue:

appstreamcli: symbol lookup error: appstreamcli: undefined symbol: AS_APPSTREAM_METADATA_PATHS
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh-cache > /dev/null; fi'

After googling around a fair bit, it seems that my system was holding onto some older versions of appstreamcli packages. I listed them with the following command:

dpkg -l | grep -i appstream

It listed several packages such as:

  • appstream
  • libappstream-glib8
  • libappstream4

I wanted to leave just ‘libappstream4’ and remove the rest. So I removed the first two with:

apt-get remove --purge libappstream-glib8
apt-get remove --purge appstream

Once them were removed, I reinstalled the appstream package I needed (libappstream4) with:

apt-get install --reinstall libappstream4

Now I could run ‘apt-get update’ without any issues. I rebooted my machine for good measure and continued the upgrade attempt with:

apt update
apt full-upgrade -y

This still gave some warning about couple of packages. I tried remove them first with ‘apt-get remove..’ as above but this failed due to dependency issues. So instead I used aptitude which handled the dependencies better:

aptitude remove wpscan
aptitude remove ruby-cms-scanne
aptitude remove initramfs-tools

The ‘wpscan’ package was mainly responsible for several ruby package related issues. Once I removed them as above, I could upgrade without any issues by running ‘apt update; apt full-upgrade -y;’ commands shown above.

I tried re-installing wpscan later on but kept running into the same issue. For the moment I did not need wpscan and there were not upgrade errors with my Kali install, which was what I was after.

--

--