安装 ifupdown2

安装 ifupdown2

我正在运行 Ubuntu 19-04。

我正在尝试安装 ifupdown2

当我做

dpkg -i ../ifupdown2_1.2.1_all.deb

它说

Selecting previously unselected package  ifupdown2.
dpkg: considering removing ifupdown in  favour of ifupdown2 ...
dpkg: no, cannot proceed with removal  of ifupdown (--auto-deconfigure will help):
pppoeconf depends on ifupdown (>=  0.7.44~)
ifupdown is to be removed.

dpkg: regarding  ../ifupdown2_1.2.1_all.deb containing  ifupdown2:
ifupdown2 conflicts with ifupdown
ifupdown (version 0.8.34ubuntu2) is  present and installed.

dpkg: error processing archive   ../ifupdown2_1.2.1_all.deb (--install):
conflicting packages - not installing  ifupdown2
Errors were encountered while  processing:
../ifupdown2_1.2.1_all.deb

有人知道这个问题的解决办法吗?

答案1

cat /etc/network/interfaces

# ifupdown has been replaced by netplan(5) on this system.  See
# /etc/netplan for current configuration.
# To re-enable ifupdown on this system, you can run:
#    sudo apt install ifupdown

我希望我的网络连接由 Network Manager 而不是 Netplan 控制。如果必须安装 ifupdown,那么我想要 ifupdown2。

我试过

apt install ifupdown

返回

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
ifupdown2 : Conflicts: ifupdown
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or 
specify a solution).

所以我做了

apt --fix-broken install

返回

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer 
required:
rsplib-docs spl-dkms
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
pppoeconf
0 upgraded, 0 newly installed, 1 to remove and 10 not upgraded.
1 not fully installed or removed.
After this operation, 135 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 193626 files and directories currently installed.)
Removing pppoeconf (1.21ubuntu1) ...
Processing triggers for man-db (2.8.5-2) ...

然后我就这么做了

dpkg -i ../ifupdown2_1.2.1_all.deb

返回

(Reading database ... 193619 files and directories currently installed.)
Preparing to unpack ../ifupdown2_1.2.1_all.deb ...
Unpacking ifupdown2 (1.2.1) over (1.2.1) ...
Setting up ifupdown2 (1.2.1) ...
ifupdown2.postinst: Warning: No 'iface lo' definition found in 
/etc/network/interfaces
ifupdown2.postinst: Warning: No 'auto lo' statement found in 
/etc/network/interfaces
Processing triggers for man-db (2.8.5-2) ...

似乎已经安装了

apt list --installed | grep -i ifupdown2

WARNING: apt does not have a stable CLI interface. Use with caution in 
scripts.

ifupdown2/now 1.2.1 all [installed,upgradable to: 1.2.5-1]

然后我在 /etc/network/interfaces 中添加了以下内容

auto lo
iface lo inet loopback 

auto enp11s0
iface enp11s0 inet dhcp

添加

[ifupdown]
managed=false

到 /etc/NetworkManager/NetworkManager.conf 并执行

systemctl stop systemd-networkd
systemctl disable systemd-networkd
service NetworkManager restart

一切似乎都还好,但如果有人知道如何将 ifupdown2 从 1.2.1 升级到 1.2.5-1 那就好了。

相关内容