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, 2016 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, 2016 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. Mar 30, 2017 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, 2017 at 0:48

5 Answers 5


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/


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 :) Nov 19, 2016 at 22:17
  • // , I can confirm this works on 16.04.3 LTS on a live USB drive on a Dell XPS. Aug 13, 2017 at 22:52
  • this work for me.. in WSL too .. thnx for the info.. Sep 3, 2017 at 10:18

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 Mar 30, 2017 at 13:12
  • // , @uncledave, does 0755 work as well? You've reached ~20k people, btw. Aug 13, 2017 at 22:52
  • 1
    @NathanBasanese 755 works for sure
    – linux64kb
    Apr 24, 2018 at 19:17

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


And back to my original path ubuntu@ubuntu.


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 :) )


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. Apr 24, 2016 at 13:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .