snapd is unavailable in Ubuntu 16.04

9,360

Try to remove snapd completely with:

sudo apt-get purge snapd snapd-login-service

Re-enable main repository with:

sudo add-apt-repository main

Then install it again:

sudo apt-get update
sudo apt-get install snapd snapd-login-service

This should make /snap directory available again.

Share:
9,360
Masroor
Author by

Masroor

Updated on September 18, 2022

Comments

  • Masroor
    Masroor over 1 year

    I'm using Ubuntu 16.04. But I think the snapd is broken in my system.

    When I run $ snap --version, I get this response:

    snap    2.29.4.2~14.04
    snapd   unavailable
    series  -
    

    I have also problem running $ sudo apt upgrade and $ sudo apt -f install. Every time I get errors such as:

    Setting up snapd (2.29.4.2~14.04) ...
    Failed to execute operation: No such file or directory
    

    Any help?

    Updates below.


    Also lsb_release -a reports

    Distributor ID: Ubuntu
    Description: Ubuntu 16.04.1 LTS
    Release:    16.04
    Codename:   xenial
    

    With dpkg --get-selections | grep linux-image | grep -v deinstall, I get

    linux-image-4.4.0-116-generic
    

    If I run sudo apt -f install and sudo apt upgrade I get:

    ## To be filed by Masroor ##
    
    • undsoft
      undsoft about 6 years
      Is this a real genuine install of 16.04? I'm guessing it's a server, VPS or other appliance provided by a 3rd party, and has been modified somehow. What's the origin of the install? What does lsb_release -a report?
    • Masroor
      Masroor about 6 years
      When I run lsb_release -a, I get this: No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.1 LTS Release: 16.04 Codename: xenial
    • Masroor
      Masroor about 6 years
      @popey my /snap directory is empty!!! What's the problem? Also lsb_release -a reports: Distributor ID: Ubuntu Description: Ubuntu 16.04.1 LTS Release: 16.04 Codename: xenial
    • undsoft
      undsoft about 6 years
      Again, what's the origin of this machine? Is it a server / vps?
    • Masroor
      Masroor about 6 years
      @popey No it is not a server. When I run dpkg --get-selections | grep linux-image | grep -v deinstall, I get linux-image-4.4.0-116-generic.
    • undsoft
      undsoft about 6 years
      What's the origin of the machine? Was it clean installed with 14.04 and upgraded? Did it ship with Ubuntu out of the box? The reason I am asking is because we often see these issues on systems which aren't genuine Ubuntu, or systems that have had packages removed. The fact you're getting messages for snapd 14.04 on 16.04 is alarming.
    • Masroor
      Masroor about 6 years
      @popey It was actually clean installed from genuine Ubuntu. The point is that I wasn't getting errors regarding snapd in previous days and I could easily run the simple commands like sudo apt upgrade. But now I don't know where have I made a mistake that I'm now having trouble with snapd.
    • guiverc
      guiverc about 6 years
      I would be interested in the actual errors you get with sudo apt -f install or sudo apt upgrade. Sorry I can't help with snap*. If you wish to reply, please edit your question & add there, and not comments (more formatting choices exist in question/answers)
    • N0rbert
      N0rbert about 6 years
      What is the output of apt-cache policy snapd? Its version 2.29.4.2~14.04 is wrong, it is for trusty (14.04), not xenial (16.04).
    • Organic Marble
      Organic Marble about 6 years
      My 16.04 machines are up to point release 16.04.4, if you are on 16.04.1 and using that kernel, something is very weird with your system.
    • Masroor
      Masroor about 6 years
      @OrganicMarble So what's the solution for me? I'm using Ubuntu 16.04.1 and the version of the snap is 2.29.4.2~14.04 which is wrong. How can I resolve this?
    • N0rbert
      N0rbert about 6 years
      Please give us more details, fill ## To be filed by Masroor ## part of your question by editing it. Also try to test my answer.
  • alvaroc
    alvaroc almost 6 years
    I have exactly the same problem. Tried this solution with no luck . "snap --version snap 2.33.1ubuntu2 snapd unavailable series - " snapd does not even appear in sudo service --status-all or anything that prompts it is indeed installed