20

I have created a USB stick with a persistent Ubuntu 16.04 (release version). I tried a couple of ways, using Startup Disk Creator and MultiSystem, but I get the same end result.

When I boot into the USB and do 'apt-get update', all is well. When I try 'apt-get dist-upgrade' I get:

** (appstreamcli:2761): CRITICAL **: Error while moving old database out of the way. AppStream cache update failed.

The only reference to this error message I can find is https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1561472 but would appear to be fixed, at least fixed by the time the release version of Ubuntu 16.04.

Aside: I want to test Unity8, which includes installing software. I don't have a spare computer, so I thought a persistent USB would do the trick.

Any takers?

  • 2
    Does rm -rf /var/lib/apt/lists /var/cache/apt; apt update; apt clean help? – Olathe Apr 24 '16 at 9:44
  • This has happened to me on one occasion with a non-persistent Live USB. For me, running sudo rm -rf /var/lib/apt/lists was enough to get apt update and a subsequent install working again, albeit with that same error about the "CD-ROM" not having a Release file. – mwfearnley May 29 '16 at 11:48
  • 1
    Could you please open a new question if you have a new or follow-up question? If you tack hardly related questions onto existing questions you're broadening their scope which makes them harder to answer. On top of that it likely invalidates existing answers. I took the liberty to remove the follow-up question. Thanks. – David Foerster Mar 30 '17 at 13:16
  • 2
    I've got exactly the same error when doing sudo apt-get update, and the solutions here didn't help: I've tried removing /var/lib/apt/lists and /var/cache/apt and this didn't resolve the issue. Permissions for /var/cache/app-info/xapian/default were already set up correctly. What did help is cd /var/cache/app-info/xapian; sudo mv default default_old; sudo mv default_old default. This is explained here: bugs.launchpad.net/ubuntu/+source/appstream/+bug/1601971 (comment #11). – fiktor Dec 31 '17 at 0:48
28

This also happened to me using 16.04.1 live Ubuntu persistent USB stick.

uncledave's solution didn't work at first, but as suggested, changing the rights was the final solution.

Then I've found answer #11 from daniel-gimpelevich for bug 1601971 The following commands helped me repair apt-get update

sudo chmod -R a+rX,u+w /var/cache/app-info/xapian/default

How did I guess that 755 is the right mask? The difference between

ls -ld /var/cache/app-info/xapian
drwxr-xr-x 1 root root 4096 Nov 19 20:35 /var/cache/app-info/xapian/

and

ls -ld /var/cache/app-info/xapian/default
drw-r--r-- 2 root root 4096 Jul 19 20:54 /var/cache/app-info/xapian/default

After this apt-get update ran fine.

sudo apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [95.7 kB]      
Fetched 190 kB in 0s (312 kB/s)                                                
Reading package lists... Done

Note1 Upgrading a live persistent USB stick this way is not suggested it will cause issues if too many packages are installed/upgraded.

Note2 It's a better idea to install Ubuntu directly to the USB stick if you want to use it as a bootable "Swiss Army Knife".

  • The quality of this answer is great. Keep it up :) – ThatGuy Nov 19 '16 at 22:17
  • // , I can confirm this works on 16.04.3 LTS on a live USB drive on a Dell XPS. – Nathan Basanese Aug 13 '17 at 22:52
  • this work for me.. in WSL too .. thnx for the info.. – Buddhika Chaturanga Sep 3 '17 at 10:18
2

A google search led me to this link: on github

I've tried this command and it works for me:

chmod 777 /var/cache/app-info/xapian/default -R

  • 6
    Please don't recommend 0777 a.k.a. “please-hack-my-system-and-destroy-my-data” permissions for no apparent reason! There's almost never a reason to do that because it can be avoided with more sensible modifications like changing (group) ownership. See linux64kb's answer for reference. −1 – David Foerster Mar 30 '17 at 13:12
  • // , @uncledave, does 0755 work as well? You've reached ~20k people, btw. – Nathan Basanese Aug 13 '17 at 22:52
  • 1
    @NathanBasanese 755 works for sure – linux64kb Apr 24 '18 at 19:17
1

On my persistent live USB with 16.04.1, Just typed

sudo -i

Then as root did

sudo apt-get update And all was fine. Then

exit

And back to my original path ubuntu@ubuntu.

0

On my system (based on ubuntu xenial) this was the initial perms layout:

drwxr-xr-x 2 root root 4096 Sep 28 12:32 /var/cache/app-info/xapian/default/

Note, the group did not have 'w' access. The fix was

chmod g+w /var/cache/app-info/xapian/default

, so no dangers here (as in c0m3h4ckm3 :) )

-1

I don't know how to fix this problem properly, but calling apt-get dist-upgrade twice is working for me, I'm able to reproduce it on an installed Ubuntu though (at the first call there will be the error, but the second call works).

  • Tried that - it "fixed" it, but then when I tried to repeat the process, got the same error. So no banana. The suggestion by Olathe above helped, but then lead to another error...see comment above. – Bernmeister Apr 24 '16 at 13:53

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.