Ubuntu 服务器安装 OpenVPN - “损坏的软件包”

Ubuntu 服务器安装 OpenVPN - “损坏的软件包”

我正在尝试在我的 Ubuntu Server 18.04.3 LTS 上安装 OpenVPN。我刚刚开始使用 Linux,还没有太多经验。我使用该服务器实现的大部分操作都是按照我在某处找到的教程进行的,所以我并不惊讶它现在告诉我有“损坏的软件包”。

尝试安装 OpenVPN 时,我收到以下信息:

thegeni@nas:~$ sudo apt-get install openvpn
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:
 openvpn : Depends: initscripts (>= 2.88dsf-13.3) but it is not installable
E: Unable to correct problems, you have held broken packages.

我在其他地方搜索了一些答案,但到目前为止我找到的所有解决方案似乎都是针对特定问题的,并没有真正帮助我。除了重新安装之外,我还能做些什么来解决这个问题?

谢谢你在这里帮助我!

编辑1:

sudo apt update输出:

thegeni@nas:~$ sudo apt update
Hit:1 http://ppa.launchpad.net/certbot/certbot/ubuntu bionic InRelease
Hit:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:3 http://repo.ombi.turd.me/stable jessie InRelease
Hit:4 http://de.archive.ubuntu.com/ubuntu bionic InRelease
Hit:5 http://de.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:6 http://de.archive.ubuntu.com/ubuntu bionic-backports InRelease
Hit:7 http://build.openvpn.net/debian/openvpn/stable xenial InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:2
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:2
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:2
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:2
W: Target Translations (main/i18n/Translation-de) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:2
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:2
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:2
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:3
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:3
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:3
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:3
W: Target Translations (main/i18n/Translation-de) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:3
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:3
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:3
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:2
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:2
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:2
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:2
W: Target Translations (main/i18n/Translation-de) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:2
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:2
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:2
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:3
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:3
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:3
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:3
W: Target Translations (main/i18n/Translation-de) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:3
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:3
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list.d/openvpn.list:1 and /etc/apt/sources.list.d/openvpn.list:3

好的,所有这些 W:消息都是新的......

答案1

显然,您正在尝试安装openvpnOpenVPN 存储库提供的软件,该存储库恰好是为 Ubuntu 16.04 或制作的xenial

http://build.openvpn.net/debian/openvpn/stable xenial

这些软件包包含initscripts其依赖项,因此当您在 18.04 上执行安装时,它根本不起作用,因为initscripts在 18.04 上不存在。

删除存储库就足以消除错误,另外不要忘记重新安装损坏的openvpn安装。

sudo apt remove openvpn
sudo add-apt-repository --remove "deb http://build.openvpn.net/debian/openvpn/stable xenial main"
sudo rm /etc/apt/sources.list.d/openvpn.list
sudo apt update
sudo apt install openvpn

相关内容