ubuntu 16.04 install snapd problem
10,674
My version of resolving this issue:
- Remove/comment all unnessesary trusty sources from your
/etc/apt/sources.list
. - Run
sudo apt-get update
and verify thatapt-cache policy snapd
is now have theCandidate: 2.32.9
that you need. try tosudo apt install --reinstall snapd
. - Optional. If you still have
Sub-process /usr/bin/dpkg returned an error code (1)
error, clean thecd var/lib/dpkg/info
withsudo rm ./snapd*
and reinstall the snapdsudo apt install --reinstall snapd
. - Verify that the Installed version is 2.32.9
snap --version
.
Related videos on Youtube
Author by
descogle
Updated on September 18, 2022Comments
-
descogle over 1 year
Having problem with installing/uninstalling snapd.
My version of snap on my Ubuntu 16.04 for some reason is not correct:
snap --version snap 2.31.1~14.04 snapd unavailable series -
So I want to reinstall the snad manually using:
sudo apt-get install snapd
and get the error:
Errors were encountered while processing: /var/cache/apt/archives/snapd_2.33.1~14.04_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
I decided to uninstall this version by trying to use this command:
sudo apt purge snapd ubuntu-core-launcher squashfs-tools
giving me this result:
Reading package lists... Done Building dependency tree Reading state information... Done Package 'ubuntu-core-launcher' is not installed, so not removed The following packages will be REMOVED: snapd* squashfs-tools* 0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded. After this operation, 79,3 MB disk space will be freed. Do you want to continue? [Y/n] y (Reading database ... 312065 files and directories currently installed.) Removing snapd (2.31.1~14.04) ... Failed to stop snapd.autoimport.service: Unit snapd.autoimport.service not loaded. Failed to stop snapd.socket: Unit snapd.socket not loaded. Failed to stop snapd.service: Unit snapd.service not loaded. dpkg: error processing package snapd (--purge): subprocess installed pre-removal script returned error exit status 5 dpkg: squashfs-tools: dependency problems, but removing anyway as you requested: snapd depends on squashfs-tools; however: Package squashfs-tools is to be removed. Removing squashfs-tools (1:4.3-3ubuntu2.16.04.1) ... Processing triggers for man-db (2.7.5-1) ... Errors were encountered while processing: snapd E: Sub-process /usr/bin/dpkg returned an error code (1)
Command:
apt-get -f install
won't help as well.
~$ apt-cache policy snapd snapd: Installed: 2.31.1~14.04 Candidate: 2.33.1~14.04 Version table: 2.33.1~14.04 500 500 http://archive.ubuntu.com/ubuntu trusty-proposed/universe amd64 Packages 2.32.9 500 500 http://ru.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages 2.32.9~14.04 500 500 http://archive.ubuntu.com/ubuntu trusty-updates/universe amd64 Packages *** 2.31.1~14.04 100 100 /var/lib/dpkg/status 2.0.2 500 500 http://ru.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
Please, if you get any idea of what's going on and how to fix this help me :)
Edit:
Trusty packages that I have in a souces list:
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
-
guiverc almost 6 yearsI would check your sources (what have you added there, and do you have trusty (14.04) sources?) - you should be getting 2.39.9 (packages.ubuntu.com/search?keywords=snapd) and not have a trusty (14.04) version. Can you add
apt-cache policy snapd
to your question. -
descogle almost 6 years@guiverc, I added information that you asked to my question.
-
guiverc almost 6 yearsI would comment out your 'trusty' sources; I can't see what they can provide you extra (with a tiny change of complications) unless you know of a reason to use them. I comment them out (put a # at start of line in /etc/apt/sources.list for those lines) as its easy to put them back if you need to reverse it (I also leave a "#- lines marked this way were commented out 2018-06-28 guiverc" (ie. doco explaining why) which I also do when I add sources (so I can remember why). Once command out; you can
sudo apt update
then try again. -
guiverc almost 6 yearsThe trusty version (2.33) was given priority as it's a higher number than the correct xenial version (2.32.9) as 2.33>2.32.9 according to
apt
's logic. Removing the 'trusty' sources should fix... (don't forget tosudo apt-get update
first) -
descogle almost 6 years@guiverc well i'll tried to remove the souse, and now i see that ubuntu is trying to install the correct verions of file but still have an error due instalation
Errors were encountered while processing: /var/cache/apt/archives/snapd_2.32.9_amd64.deb
-
guiverc almost 6 yearsLike the prior one, I'd do a
apt-cache policy snapd
to see where it's coming from (no need to post it here). all versions of Ubuntu should be the same (except trusty & cosmic) [packages.ubuntu.com/search?keywords=snapd]. I'd trysudo apt -f install
again, maybesudo apt install --reinstall snapd
(I'd be somewhat guided by what I saw inapt-cache policy
output)... let me know if problem persists; I'm heading to bed :) -
doug almost 6 yearsenable xenial-proposed, update sources & see if snapd will upgrade. If that happens to work install and or open synaptic > Origins. See if there are any other trusty packages installed. If so replace with xenial, in either case then remove the trusty repos from your sources. It was not a good or in any way useful idea to have them.
-
descogle almost 6 yearsThanks you for answers @doug, @guiverc, I finnaly get the point of my problem, the last step is to clean the
var/lib/dpkg/info
from all that concerns snap like thissudo rm ./snapd*
and thensudo apt-get update && sudo apt-get upgrade
and finish withsudo apt install --reinstall snapd
and that's to the god of linux get the output of thesnap --version
command like:snap 2.32.9 snapd 2.32.9 series 16 ubuntu 16.04 kernel 4.4.0-130-generic
-