ubuntu E:包'snapd'没有安装候选,无法安装snap包管理器

uwopmtnx  于 2023-10-17  发布在  其他
关注(0)|答案(1)|浏览(355)

当我想逃跑的时候

sudo apt install snapd

错误显示如下:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package snapd is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'snapd' has no installation candidate

如何在ubuntu中安装snap store?
我试着查阅Snap的官方文档:https://snapcraft.io/docs/installing-snap-on-ubuntu
上面写着

Snap is pre-installed and ready to go on all recent releases of Ubuntu.

This means, if you’re running Ubuntu 16.04 LTS (Xenial Xerus) or later, including Ubuntu 22.04 LTS (Jammy Jellyfish) and Ubuntu 23.04 (Lunar Lobster), you don’t need to do anything.

但为什么我的系统里没有!!

k3bvogb1

k3bvogb11#

发生上述错误是因为APT包管理器阻止安装快照包。
要启用快照支持,我们有两个选项:
选项1:通过运行以下命令删除/etc/apt/preferences.d目录中的nossnap. config文件:

sudo rm /etc/apt/preferences.d/nosnap.pref

选项2:注解同一文件中的三行代码。

Package: snapd
Pin: release a=*
Pin-Priority: -10

安装snapd:

sudo apt install snapd

然后,您可以安装任何Snap应用程序:

sudo snap install <app-name>

相关问题