从失败的 DKMS 模块升级中恢复

从失败的 DKMS 模块升级中恢复

我正在运行 Ubuntu 16.04.6,并且有WireGuard PPA配置好后,我就可以通过 apt 安装 WireGuard。前几天我尝试升级一些软件包,包括 WireGuard,但构建模块失败了。另一个问题暗示,aptitude/dpkg 似乎没有注意到这个失败,现在报告 WireGuard 是最新的,而事实上它似乎不再可用:

$ sudo rmmod wireguard && sudo modprobe wireguard
modprobe: FATAL: Module wireguard not found in directory
  /lib/modules/4.4.0-151-generic

我如何恢复到 WireGuard 的某个先前(有效)版本?

升级完整记录

$ sudo aptitude upgrade bsdutils git git-man postgresql-client-9.6 \
    postgresql-client-common postgresql-common python2.7 \
    python2.7-minimal python3.5 python3.5-minimal uuid-runtime \
    wireguard wireguard-dkms wireguard-tools
Resolving dependencies...
The following packages will be upgraded:
  bsdutils git git-man libpython2.7-minimal libpython2.7-stdlib libpython3.5 libpython3.5-minimal
  libpython3.5-stdlib postgresql-client-9.6 postgresql-client-common postgresql-common python2.7
  python2.7-minimal python3.5 python3.5-minimal uuid-runtime wireguard wireguard-dkms wireguard-tools
19 packages upgraded, 0 newly installed, 0 to remove and 66 not upgraded.
Need to get 0 B/19.6 MB of archives. After unpacking 1,476 kB will be used.
Do you want to continue? [Y/n/?] y
Preconfiguring packages ...
(Reading database ... 152374 files and directories currently installed.)
Preparing to unpack .../bsdutils_1%3a2.27.1-6ubuntu3.8_amd64.deb ...
Unpacking bsdutils (1:2.27.1-6ubuntu3.8) over (1:2.27.1-6ubuntu3.7) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up bsdutils (1:2.27.1-6ubuntu3.8) ...
(Reading database ... 152374 files and directories currently installed.)
Preparing to unpack .../libpython3.5_3.5.2-2ubuntu0~16.04.8_amd64.deb ...
Unpacking libpython3.5:amd64 (3.5.2-2ubuntu0~16.04.8) over (3.5.2-2ubuntu0~16.04.5) ...
Preparing to unpack .../python3.5_3.5.2-2ubuntu0~16.04.8_amd64.deb ...
Unpacking python3.5 (3.5.2-2ubuntu0~16.04.8) over (3.5.2-2ubuntu0~16.04.5) ...
Preparing to unpack .../libpython3.5-stdlib_3.5.2-2ubuntu0~16.04.8_amd64.deb ...
Unpacking libpython3.5-stdlib:amd64 (3.5.2-2ubuntu0~16.04.8) over (3.5.2-2ubuntu0~16.04.5) ...
Preparing to unpack .../python3.5-minimal_3.5.2-2ubuntu0~16.04.8_amd64.deb ...
Unpacking python3.5-minimal (3.5.2-2ubuntu0~16.04.8) over (3.5.2-2ubuntu0~16.04.5) ...
Preparing to unpack .../libpython3.5-minimal_3.5.2-2ubuntu0~16.04.8_amd64.deb ...
Unpacking libpython3.5-minimal:amd64 (3.5.2-2ubuntu0~16.04.8) over (3.5.2-2ubuntu0~16.04.5) ...
Preparing to unpack .../uuid-runtime_2.27.1-6ubuntu3.8_amd64.deb ...
Unpacking uuid-runtime (2.27.1-6ubuntu3.8) over (2.27.1-6ubuntu3.7) ...
Preparing to unpack .../git_1%3a2.23.0-0ppa1~ubuntu16.04.1_amd64.deb ...
Unpacking git (1:2.23.0-0ppa1~ubuntu16.04.1) over (1:2.22.0-0ppa1~ubuntu16.04.1) ...
Preparing to unpack .../git-man_1%3a2.23.0-0ppa1~ubuntu16.04.1_all.deb ...
Unpacking git-man (1:2.23.0-0ppa1~ubuntu16.04.1) over (1:2.22.0-0ppa1~ubuntu16.04.1) ...
Preparing to unpack .../python2.7_2.7.12-1ubuntu0~16.04.8_amd64.deb ...
Unpacking python2.7 (2.7.12-1ubuntu0~16.04.8) over (2.7.12-1ubuntu0~16.04.4) ...
Preparing to unpack .../libpython2.7-stdlib_2.7.12-1ubuntu0~16.04.8_amd64.deb ...
Unpacking libpython2.7-stdlib:amd64 (2.7.12-1ubuntu0~16.04.8) over (2.7.12-1ubuntu0~16.04.4) ...
Preparing to unpack .../python2.7-minimal_2.7.12-1ubuntu0~16.04.8_amd64.deb ...
Unpacking python2.7-minimal (2.7.12-1ubuntu0~16.04.8) over (2.7.12-1ubuntu0~16.04.4) ...
Preparing to unpack .../libpython2.7-minimal_2.7.12-1ubuntu0~16.04.8_amd64.deb ...
Unpacking libpython2.7-minimal:amd64 (2.7.12-1ubuntu0~16.04.8) over (2.7.12-1ubuntu0~16.04.4) ...
Preparing to unpack .../postgresql-common_204.pgdg16.04+1_all.deb ...
Leaving 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by postgresql-common'
Unpacking postgresql-common (204.pgdg16.04+1) over (203.pgdg16.04+1) ...
Preparing to unpack .../postgresql-client-common_204.pgdg16.04+1_all.deb ...
Unpacking postgresql-client-common (204.pgdg16.04+1) over (203.pgdg16.04+1) ...
Preparing to unpack .../postgresql-client-9.6_9.6.15-1.pgdg16.04+1_amd64.deb ...
Unpacking postgresql-client-9.6 (9.6.15-1.pgdg16.04+1) over (9.6.14-1.pgdg16.04+1) ...
Preparing to unpack .../wireguard-dkms_0.0.20190905-wg1~xenial_all.deb ...

-------- Uninstall Beginning --------
Module:  wireguard
Version: 0.0.20190702
Kernel:  4.4.0-151-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

wireguard.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.4.0-151-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall completed.

------------------------------
Deleting module version: 0.0.20190702
completely from the DKMS tree.
------------------------------
Done.
Unpacking wireguard-dkms (0.0.20190905-wg1~xenial) over (0.0.20190702-wg1~xenial) ...
Preparing to unpack .../wireguard-tools_0.0.20190905-wg1~xenial_amd64.deb ...
Unpacking wireguard-tools (0.0.20190905-wg1~xenial) over (0.0.20190702-wg1~xenial) ...
Preparing to unpack .../wireguard_0.0.20190905-wg1~xenial_all.deb ...
Unpacking wireguard (0.0.20190905-wg1~xenial) over (0.0.20190702-wg1~xenial) ...
Processing triggers for libc-bin (2.23-0ubuntu11) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for ureadahead (0.100.0-19.1) ...
Processing triggers for systemd (229-4ubuntu21.21) ...
Setting up libpython3.5-minimal:amd64 (3.5.2-2ubuntu0~16.04.8) ...
Setting up libpython3.5-stdlib:amd64 (3.5.2-2ubuntu0~16.04.8) ...
Setting up libpython3.5:amd64 (3.5.2-2ubuntu0~16.04.8) ...
Setting up python3.5-minimal (3.5.2-2ubuntu0~16.04.8) ...
Setting up python3.5 (3.5.2-2ubuntu0~16.04.8) ...
Setting up uuid-runtime (2.27.1-6ubuntu3.8) ...
Setting up git-man (1:2.23.0-0ppa1~ubuntu16.04.1) ...
Setting up git (1:2.23.0-0ppa1~ubuntu16.04.1) ...
Setting up libpython2.7-minimal:amd64 (2.7.12-1ubuntu0~16.04.8) ...
Setting up python2.7-minimal (2.7.12-1ubuntu0~16.04.8) ...
Setting up libpython2.7-stdlib:amd64 (2.7.12-1ubuntu0~16.04.8) ...
Setting up python2.7 (2.7.12-1ubuntu0~16.04.8) ...
Setting up postgresql-client-common (204.pgdg16.04+1) ...
Setting up postgresql-common (204.pgdg16.04+1) ...
Setting up postgresql-client-9.6 (9.6.15-1.pgdg16.04+1) ...
Setting up wireguard-dkms (0.0.20190905-wg1~xenial) ...
Loading new wireguard-0.0.20190905 DKMS files...
Building only for 4.4.0-151-generic
Building initial module for 4.4.0-151-generic
Error! Bad return status for module build on kernel: 4.4.0-151-generic (x86_64)
Consult /var/lib/dkms/wireguard/0.0.20190905/build/make.log for more information.
Setting up wireguard-tools (0.0.20190905-wg1~xenial) ...
Setting up wireguard (0.0.20190905-wg1~xenial) ...
Processing triggers for libc-bin (2.23-0ubuntu11) ...

Current status: 66 (-19) upgradable.

答案1

在 IRC 上,WireGuard 的创建者建议我运行

apt update && apt upgrade && reboot

我这样做了(aptitude update && aptitude full-upgrade前两个步骤使用),它确实重新启用了 WireGuard。我不太确定如何它解决了这个问题,但升级的内容之一是我的内核,所以也许有一些东西阻止了 WireGuard 模块针对旧内核进行构建,而新内核中已经修复了这个问题。

相关内容