Ubuntu 16.04安装快照问题

脱壳

安装/卸载时遇到问题。

由于某些原因,我在Ubuntu 16.04上的snap版本不正确:

snap --version
 snap    2.31.1~14.04
 snapd   unavailable
 series  -

因此,我想使用以下方法手动重新安装小插曲:

sudo apt-get install snapd

并得到错误:

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)

我决定尝试使用此命令来卸载此版本:

sudo apt purge snapd ubuntu-core-launcher squashfs-tools

给我这个结果:

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)

命令:

apt-get -f install

也不会有帮助。

~$ 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

请,如果您对正在发生的事情以及如何解决此问题有任何了解,请帮我:)

编辑:

我在来源列表中拥有的可信任软件包:

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
脱壳

解决此问题的我的版本:

  1. 从您的中删除/评论所有不必要的可信赖来源/etc/apt/sources.list
  2. 运行sudo apt-get update并验证apt-cache policy snapd现在具有Candidate: 2.32.9您需要的。试着去sudo apt install --reinstall snapd
  3. 可选的。如果仍然有Sub-process /usr/bin/dpkg returned an error code (1)错误,清洁cd var/lib/dpkg/infosudo rm ./snapd*和重新安装snapd sudo apt install --reinstall snapd
  4. 验证安装的版本为2.32.9 snap --version

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章