首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Wireguard安装错误:无法更正问题,您持有损坏的软件包。但是,不保存任何包。

Wireguard安装错误:无法更正问题,您持有损坏的软件包。但是,不保存任何包。
EN

Stack Overflow用户
提问于 2020-01-17 08:40:48
回答 1查看 1.4K关注 0票数 2

在Debian 10机器上,Wireguard安装失败,错误描述如下。

代码语言:javascript
复制
The following packages have unmet dependencies:
 wireguard : Depends: wireguard-dkms (>= 0.0.20191219) but it is not installable or
                      wireguard-modules (>= 0.0.20191219) but it is not installable
E: Unable to correct problems, you have held broken packages.

但是,以下命令(以root用户身份运行)不返回任何输出,表明没有保存任何包。

代码语言:javascript
复制
dpkg --get-selections | grep hold 

任何帮助都是非常感谢的,因为我过去没有遇到过这个错误。

使用了以下进程,所有命令都以root用户身份运行:

代码语言:javascript
复制
echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable.list
printf 'Package: *\nPin: release a=unstable\nPin-Priority: 90\n' > /etc/apt/preferences.d/limit-unstable

apt clean
apt update
Hit:1 http://security.debian.org buster/updates InRelease                               
Hit:2 http://deb.debian.org/debian buster InRelease
Hit:3 http://deb.debian.org/debian buster-updates InRelease
Hit:4 http://deb.debian.org/debian buster-backports InRelease
Hit:5 http://deb.debian.org/debian unstable InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.

apt install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

apt install wireguard
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 wireguard : Depends: wireguard-dkms (>= 0.0.20191219) but it is not installable or
                      wireguard-modules (>= 0.0.20191219) but it is not installable
E: Unable to correct problems, you have held broken packages.

aptitude install wireguard
The following NEW packages will be installed:
  wireguard{b} wireguard-tools{a} 
0 packages upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 91.6 kB of archives. After unpacking 344 kB will be used.
The following packages have unmet dependencies:
 wireguard : Depends: wireguard-dkms (>= 0.0.20191219) which is a virtual package and is not provided by any available package
 or
                      wireguard-modules (>= 0.0.20191219) which is a virtual package and is not provided by any available package

The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     wireguard [Not Installed]                          



Accept this solution? [Y/n/q/?] Y
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B of archives. After unpacking 0 B will be used.

aptitude why-not wireguard
Not currently installed
The candidate version 1.0.20200102-1 has priority optional
No dependencies require to remove wireguard
EN

回答 1

Stack Overflow用户

发布于 2020-01-17 14:11:59

这个问题已经通过以下教程编译模块得到了解决:https://www.wireguard.com/compilation/

我不必像正常安装时那样编译这些工具。

代码语言:javascript
复制
apt-get install libmnl-dev libelf-dev linux-headers-$(uname -r) build-essential pkg-config

git clone https://git.zx2c4.com/wireguard-linux-compat
git clone https://git.zx2c4.com/wireguard-tools

make -C wireguard-linux-compat/src -j$(nproc)
sudo make -C wireguard-linux-compat/src install
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59779759

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档