0

Whenever I try to run the command sudo apt-get update throws an error:

Hit:1 https://desktop-download.mendeley.com/download/apt stable InRelease
Hit:2 https://linux.teamviewer.com/deb stable InRelease                                             
Hit:3 http://dl.google.com/linux/chrome/deb stable InRelease                                        
Hit:4 http://security.ubuntu.com/ubuntu bionic-security InRelease                                   
Hit:5 http://us.archive.ubuntu.com/ubuntu bionic InRelease                                     
Hit:6 https://qgis.org/debian bionic InRelease                           
Hit:7 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease       
AppStream system cache was updated, but problems were found: Metadata files have errors: /var/lib/app-info/yaml/us.archive.ubuntu.com_ubuntu_dists_bionic-updates_universe_dep11_Components-amd64.yml.gz, /var/lib/app-info/yaml/us.archive.ubuntu.com_ubuntu_dists_bionic-updates_main_dep11_Components-amd64.yml.gz, /var/lib/app-info/yaml/security.ubuntu.com_ubuntu_dists_bionic-security_universe_dep11_Components-amd64.yml.gz, /var/lib/app-info/yaml/security.ubuntu.com_ubuntu_dists_bionic-security_main_dep11_Components-amd64.yml.gz
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'
E: Sub-process returned an error code

I tried so many solutions suggested on this forum but nothing worked for me. When I tried apt install --reinstall libappstream4 appstream I got following

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 2 reinstalled, 0 to remove and 0 not upgraded.
Need to get 125 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 appstream amd64 0.12.0-3ubuntu1 [27.6 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 libappstream4 amd64 0.12.0-3ubuntu1 [97.2 kB]
Fetched 125 kB in 0s (7,261 kB/s)     
(Reading database ... 426325 files and directories currently installed.)
Preparing to unpack .../appstream_0.12.0-3ubuntu1_amd64.deb ...
Unpacking appstream (0.12.0-3ubuntu1) over (0.12.0-3ubuntu1) ...
Preparing to unpack .../libappstream4_0.12.0-3ubuntu1_amd64.deb ...
Unpacking libappstream4:amd64 (0.12.0-3ubuntu1) over (0.12.0-3ubuntu1) ...
Setting up libappstream4:amd64 (0.12.0-3ubuntu1) ...
Setting up appstream (0.12.0-3ubuntu1) ...
AppStream system cache was updated, but problems were found: Metadata files have errors: /var/lib/app-info/yaml/us.archive.ubuntu.com_ubuntu_dists_bionic-updates_universe_dep11_Components-amd64.yml.gz, /var/lib/app-info/yaml/us.archive.ubuntu.com_ubuntu_dists_bionic-updates_main_dep11_Components-amd64.yml.gz, /var/lib/app-info/yaml/security.ubuntu.com_ubuntu_dists_bionic-security_universe_dep11_Components-amd64.yml.gz, /var/lib/app-info/yaml/security.ubuntu.com_ubuntu_dists_bionic-security_main_dep11_Components-amd64.yml.gz
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...

& for : appstreamcli refresh --force It gave :

AppStream system cache was updated, but problems were found: Metadata files have errors: /var/lib/app-info/yaml/us.archive.ubuntu.com_ubuntu_dists_bionic-updates_universe_dep11_Components-amd64.yml.gz, /var/lib/app-info/yaml/us.archive.ubuntu.com_ubuntu_dists_bionic-updates_main_dep11_Components-amd64.yml.gz, /var/lib/app-info/yaml/security.ubuntu.com_ubuntu_dists_bionic-security_universe_dep11_Components-amd64.yml.gz, /var/lib/app-info/yaml/security.ubuntu.com_ubuntu_dists_bionic-security_main_dep11_Components-amd64.yml.gz

Further I tried rm -rf /var/lib/app-info/yaml/* but error still persistent. Even I tried sudo apt-get purge libappstream3 but it gave an error E: Unable to locate package libappstream3 I saw some solutions like here but there is nothing in /var/cache/app-info/xmls for my system. Thanks for any help in advance.

Ajay
  • 101

0 Answers0