无法从源安装 NetworkManager

无法从源安装 NetworkManager

我正在尝试在 Ubuntu 19.10 上将 NetworkManager 升级到 1.23-1,以克服 1.20 中的一个错误。

/usr我按照以下过程进行安装:

  • 下载了最新的 tar 档案并将其提取到/usr
  • 编辑autogen.sh,附加--prefix=/usr到末尾配置
  • 以 root 身份:

    dpkg --force-all --remove network-manager
    cd /usr/NetworkManager-1.23.1    
    ./autogen.sh
    make
    make install
    

当我重新启动时,NetworkManager.service无法启动,并systemctl status NetworkManager出现以下信息:

● NetworkManager.service - Network Manager
   Loaded: loaded (/etc/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
  Drop-In: /usr/local/lib/systemd/system/NetworkManager.service.d
           └─NetworkManager-ovs.conf
   Active: failed (Result: exit-code) since Thu 2020-02-06 20:00:03 GMT; 3min 28s ago
     Docs: man:NetworkManager(8)
  Process: 17793 ExecStart=/usr/sbin/NetworkManager --no-daemon
 Main PID: 17793 (code=exited, status=1/FAILURE)

Feb 06 20:00:03 luke-pc systemd[1]: NetworkManager.service: Service RestartSec=100ms expired, sch
Feb 06 20:00:03 luke-pc systemd[1]: NetworkManager.service: Scheduled restart job, restart counte
Feb 06 20:00:03 luke-pc systemd[1]: Stopped Network Manager.
Feb 06 20:00:03 luke-pc systemd[1]: NetworkManager.service: Start request repeated too quickly.
Feb 06 20:00:03 luke-pc systemd[1]: NetworkManager.service: Failed with result 'exit-code'.
Feb 06 20:00:03 luke-pc systemd[1]: Failed to start Network Manager.

手动运行 sudo /usr/sbin/NetworkManager --no-daemon --log-level=debug 时,journactl -xe 显示以下内容:

Feb 06 20:07:25 luke-pc NetworkManager[11012]: <info>  [1581019645.9276] NetworkManager (version 1.23.1) is starting... (after a restart)
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <info>  [1581019645.9277] Read config: /usr/etc/NetworkManager/NetworkManager.conf (lib: 20-connectivity-ubuntu.conf, no-mac-addr-change.conf)
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <debug> [1581019645.9277] CONFIG: config-data[0x560dc8ad11b0]: 2 groups
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <debug> [1581019645.9277] CONFIG: 
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <debug> [1581019645.9277] CONFIG: [connectivity]
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <debug> [1581019645.9277] CONFIG:   uri=http://connectivity-check.ubuntu.com/
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <debug> [1581019645.9277] CONFIG: 
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <debug> [1581019645.9277] CONFIG: [device-mac-addr-change-wifi]
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <debug> [1581019645.9278] CONFIG:   match-device=driver:rtl8723bs,driver:rtl8189es,driver:r8188eu,driver:8188eu,driver:eagle_sdio,driver:wl
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <debug> [1581019645.9278] CONFIG:   wifi.scan-rand-mac-address=no
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <debug> [1581019645.9278] CONFIG:   wifi.cloned-mac-address=preserve
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <debug> [1581019645.9278] CONFIG:   ethernet.cloned-mac-address=preserve
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <debug> [1581019645.9278] CONFIG: 
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <debug> [1581019645.9278] CONFIG: # no-auto-default file "/usr/var/lib/NetworkManager/no-auto-default.state"
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <warn>  [1581019645.9278] config: unknown key 'wifi.cloned-mac-address' in section [device-mac-addr-change-wifi] of file '/usr/lib/NetworkManager/conf.d/no-mac-addr-change.conf'
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <warn>  [1581019645.9278] config: unknown key 'ethernet.cloned-mac-address' in section [device-mac-addr-change-wifi] of file '/usr/lib/NetworkManager/conf.d/no-mac-addr-change.conf'
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <debug> [1581019645.9279] config: state: missing state file "/usr/var/lib/NetworkManager/NetworkManager.state": No such file or directory
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <debug> [1581019645.9279] WEXT support is enabled
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <debug> [1581019645.9280] create NMDBusManager singleton (5a8c0467649cc135)
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <error> [1581019645.9307] bus-manager: fatal failure to acquire D-Bus service "org.freedesktop.NetworkManager: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Connection ":1.161" is not allowed to own the service "org.freedesktop.NetworkManager" due to security policies in the configuration file
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <info>  [1581019645.9308] exiting (error)
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <debug> [1581019645.9312] disposing NMDBusManager singleton (5a8c0467649cc135)
Feb 06 20:07:25 luke-pc NetworkManager[11012]: <debug> [1581019645.9312] disposing NMConfig singleton (d261c54ce82089be)

有人能帮忙吗?我推测 NetworkManager.service 或某些东西在从源代码安装时配置不正确?

谢谢。

答案1

在我看来,您使用的从源代码安装的方法不正确。
您可能错过了一些与 Debian/Ubuntu 相关的补丁或类似的东西。
考虑删除 NetworkManager 的安装,然后继续下面的方法。

您必须使用以下命令安装所有构建依赖项:

# get build dependencies
sudo apt-get build-dep network-manager

# get tools
sudo apt-get install build-essential dpkg-dev debhelper devscripts

然后下载来自最新开发版本的 deb 包

cd ~/Downloads
wget http://archive.ubuntu.com/ubuntu/pool/main/n/network-manager/network-manager_1.22.4-1ubuntu2.dsc
wget http://archive.ubuntu.com/ubuntu/pool/main/n/network-manager/network-manager_1.22.4.orig.tar.xz
tar -xf network-manager_1.22.4.orig.tar.xz
cd NetworkManager-1.22.4/
wget http://archive.ubuntu.com/ubuntu/pool/main/n/network-manager/network-manager_1.22.4-1ubuntu2.debian.tar.xz
tar -xf network-manager_1.22.4-1ubuntu2.debian.tar.xz

# compile deb-packages from source code
fakeroot debian/rules binary

# install resulting deb-packages
sudo apt install ../*.deb

然后重新启动。

相关内容