Skip to content

apt-get update fails in Ubuntu 16.04 #640

Closed

Description

@paladox

Activity

  1. alexanderwhatley commented on Jul 11, 2016

    @alexanderwhatley

    I don't believe Ubuntu 16.04 is supported by WSL right now.

  2. Manouchehri commented on Jul 11, 2016

    @Manouchehri
    Contributor

    It's still working fine here.

    ubuntu@DESKTOP-3RQO5S5:/mnt/c/Users/Dave/Desktop$ sudo apt-get update
    sudo: unable to resolve host DESKTOP-3RQO5S5
    Hit:1 mirror://mirrors.ubuntu.com/mirrors.txt xenial InRelease
    Hit:2 mirror://mirrors.ubuntu.com/mirrors.txt xenial-updates InRelease
    Hit:3 mirror://mirrors.ubuntu.com/mirrors.txt xenial-backports InRelease
    Hit:4 mirror://mirrors.ubuntu.com/mirrors.txt xenial-security InRelease
    Reading package lists... Done
    ubuntu@DESKTOP-3RQO5S5:/mnt/c/Users/Dave/Desktop$ sudo apt-get upgrade
    sudo: unable to resolve host DESKTOP-3RQO5S5
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Calculating upgrade... Done
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  3. alexanderwhatley commented on Jul 11, 2016

    @alexanderwhatley

    David Manouchehri (@Manouchehri) do you get Ubuntu 16.04 when you run lsb_release -a?

  4. benhillis commented on Jul 11, 2016

    @benhillis
    Member

    David Manouchehri (@Manouchehri) Unrelated, but if do "sudo rm /etc/hosts" and restart bash.exe does the sudo: unable to resolve host DESKTOP-3RQO5S5 error message go away?

  5. Manouchehri commented on Jul 11, 2016

    @Manouchehri
    Contributor
  6. Manouchehri commented on Jul 12, 2016

    @Manouchehri
    Contributor

    Ben Hillis (@benhillis): Yep, that fixed it as expected. Thanks.

  7. Manouchehri commented on Jul 12, 2016

    @Manouchehri
    Contributor

    Alexander Whatley (@alexanderwhatley):

    ubuntu@DESKTOP-3RQO5S5:~$ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 16.04 LTS
    Release:        16.04
    Codename:       xenial
    ubuntu@DESKTOP-3RQO5S5:~$ uname -a
    Linux DESKTOP-3RQO5S5 3.4.0+ #1 PREEMPT Thu Aug 1 17:06:05 CST 2013 x86_64 x86_64 x86_64 GNU/Linux
  8. TaffyMadeThat commented on Jul 14, 2016

    @TaffyMadeThat

    I'm having the same issue, this is what my konsole displays:

    kubuntu@kubuntu:~$ sudo apt-get install
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
    kubuntu@kubuntu:~$ sudo apt-get update
    Ign:1 cdrom://Kubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1) xenial InRelease
    Hit:2 cdrom://Kubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1) xenial Release
    Hit:4 http://archive.ubuntu.com/ubuntu xenial InRelease                                
    Get:5 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB]            
    Hit:6 http://archive.ubuntu.com/ubuntu xenial-updates InRelease                    
    Fetched 94.5 kB in 0s (155 kB/s)                                                   
    
    ** (appstreamcli:27258): CRITICAL **: Error while moving old database out of the way.
    AppStream cache update failed.
    Reading package lists... Done
    
    

    Could someone offer any solution?

  9. AskeFC commented on Jul 14, 2016

    @AskeFC

    I did an "strace appstreamcli refresh-index" and saw a permission denied during rename of /var/cache/app-info/xapian/default.
    So I did "chmod 777 /var/cache/app-info/xapian/default -R" and that fixed it for me.

  10. paladox commented on Jul 14, 2016

    @paladox
    Author

    Aske Færch Christensen (@AskeFC) hi, thanks that worked.

  11. TaffyMadeThat commented on Jul 14, 2016

    @TaffyMadeThat

    For others who may come across this thread, you may get "You might need superuser permissions to perform this action." to which you can put "sudo" (spacebar) Aske Færch Christensen (@AskeFC) 's codes.

  12. Manouchehri commented on Jul 14, 2016

    @Manouchehri
    Contributor

    Aske Færch Christensen (@AskeFC) 777 permissions are a really bad idea. If you need to run several commands as root, just run sudo -i to get root.

  13. electron0zero commented on Aug 5, 2016

    @electron0zero

    David Manouchehri (@Manouchehri)
    how did you got Ubuntu 16.04 ?, i got WSL with anniversary update.
    mine is 14.04, how do i upgrade to 16.04.

    electron@DELL-PC:~$ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description: Ubuntu 14.04.5 LTS
    Release: 14.04
    Codename: trusty
    electron@DELL-PC:~$

  14. adamkruszewski commented on Aug 12, 2016

    @adamkruszewski

    David Manouchehri (@Manouchehri) Unrelated, but if do "sudo rm /etc/hosts" and restart bash.exe does the sudo: unable to resolve host DESKTOP-3RQO5S5 error message go away?

    I think it is better just to add DESKTOP-3RQO5S5 to the line that states:
    127.0.0.1 localhost
    just make it look like:
    127.0.0.1 localhost DESKTOP-3RQO5S5
    It should make it work without loosing /etc/hosts (basically we are learning apps that DESKTOP03RQO5S5 is an alias for localhost).

  15. jonstanley commented on Sep 23, 2016

    @jonstanley

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

    ... appears to be the safer fix for this issue, since in WSL you are already root...

  16. 34 remaining items

  17. tara-raj commented on May 29, 2018

    @tara-raj

    Ubuntu 16.04 is now supported in the Microsoft Store. For additional issues with app packages please file a separate issue. Thanks

  18. therealkenc commented on May 30, 2018

    @therealkenc

    That Ubuntu 16.04 is available in the Store is unrelated to the perennially unaddressed issue of:

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

    Which is almost certainly dupe #1529 as suggested by Ben's post, but we don't have enough specificity to actually mark it as such.

  19. JOrion9999 commented on May 30, 2018

    @JOrion9999

    actually it sort of is an answer ... if you bother to look up to my comment made April 13... if you delete Ubuntu completely from your system and remove the windows subsystem for Linux, reboot .. then install the Linux subsystem again reboot once more and go to the store to install Ubuntu ... it works without this issue.

    If you want it fixed .. then just delete it and install it from the Windows store as suggested and its fixed .. most likely the reason you are still seeing it is because the original was actually 14.04 ... the 14.04 was probably updated to 16.04 but was not designed to or some leftover stuff from 14.04 is causing issues with 16.04 ... deleting the old "broken" version and reinstalling it with the now "official" version from the Windows store will solve this issue in this thread

  20. cacsar commented on May 30, 2018

    @cacsar

    And if you look one above that comment you'll see my assertion that I installed 16.04 from the store (around Christmas 2017 on a brand new Surface Book 2) rather than upgrading. Now if there's been some fix since then that involves doing a reinstall that's something else.

    I don't have this problem on 18.04 installed from the store, but that doesn't indicate the underlying issue may not still exist on new installs of 16.04 or 18.04 since the underlying issue may not be 100% reliable repro.

    I'm now on the April(?) 2018 update of Win 10/ 10.0.17134.

  21. JOrion9999 commented on May 30, 2018

    @JOrion9999

    well if you were seeing it with the store version and never installed the original borked version ... then it has to be something with your install or hardware ... or maybe I have been lucky with my two versions of hardware since I reinstalled it and since I upgraded my PC .. once I got rid of the original version that wasn't from the store and reinstalled linux subsystem and then installed the 16.04 from the store ... I have never had the issue again since.

  22. akatangus commented on May 30, 2018

    @akatangus

    appstreamcli —version
    AppStream CLI tool version: 0.10.1

    If you don't see this, its borked, If they fixed the package with the "new" version fine, but simply updating Appstream fixes the issue. My comment prior to tara-raj has the whole process on the third party blog.

  23. therealkenc commented on May 30, 2018

    @therealkenc

    actually it sort of is an answer ...

    Agreed. Alright we'll call this tag external. It isn't, really, because Real Linux does not manifest the error reported by paladox in 2016, and nothing has changed in WSL since then with respect to the error. If someone has a link to the PR that addressed the problem with AppStream that would be instructive.

    The error cited in the blog is:

    AppStream cache update completed, but some metadata was ignored due to errors.
    

    If the PR fixes our Error while moving old database out of the way woes then party hat 🎉 and I won't look a gift horse in the mouth. I haven't seen the problem lately either, so I can't confirm one way or the other.

  24. added
    external
    on May 30, 2018
  25. jiceorange commented on Feb 6, 2019

    @jiceorange

    The above discussion was helpful for me. I upgraded appstreamcli and I think that the permissions issue has gone away (at version 0.10.6).

    I am also having a problem where do-release-upgrade (trying to go from 16.04 to 18.04) is failing wihtout an error. I hoped that this fix would help, but it has not.

    See #3489 for a discussion.

  26. trusktr commented on Feb 17, 2019

    @trusktr

    What are the correct safe permissions for /var/cache/app-info/xapian/default?

    (Or, in other words, if we blindly ran sudo chmod 777 /var/cache/app-info/xapian/default -R, what permissions should we change it (and subfiles) back to? 😆)

    My guess is sudo chmod o-w /var/cache/app-info/xapian/default -R. EDIT: Nope, sudo chmod o-w /var/cache/app-info/xapian/default -R resulted in the same Error while moving old database out of the way happening again.

    Changing it to 777 fixes it again. 🤔

    Obviously if changing it to 777 then applying o-w doesn't work, then it seems that the above sudo chmod g+w /var/cache/app-info/xapian/default -R won't work either, because 777 followed by o-w implies g has w.

  27. jiceorange commented on Jul 31, 2019

    @jiceorange

    Has anyone succeeded in an update from 16.04 to 18.04? Maybe best to start over with a fresh install. Seems that I may be able to copy my files / settings from Windows so that I can restore them on the fresh install, right?

  28. IGR2014 commented on Oct 19, 2021

    @IGR2014

    Was unable to upgrade from 20.04 to 20.10 (WSL2, with WSLg, Windows 11 (22000.194)).
    Had to do this to upgrade normaly: #3489 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    external

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions