2

在 Debian 10 机器上,Wireguard 安装失败并出现以下错误。

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 身份运行)不返回任何输出,表明没有保存任何包。

dpkg --get-selections | grep hold 

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

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

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
4

1 回答 1

1

该问题已通过通过此处找到的教程编译模块解决:https ://www.wireguard.com/compilation/

我不必编译这些工具,因为它们正常安装。

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
于 2020-01-17T06:11:58.650 回答