我的目标是运行一个安装并连接 nordvpn 的 docker 容器。
启动 Docker 容器
sudo docker pull ubuntu:latest
sudo docker run -it ubuntu bash
// now im in the docker container
apt install update
apt install wget
wget {{nordvpn_link.deb}}
dpkg -i {{nordvpn_link.deb}}
// some errors about dependencies after above command so ...
apt install -f
// then
apt install nordvpn
第一个大错误
root@f706a3f4012f:/home# apt install nordvpn
Reading package lists... Done
Building dependency tree
Reading state information... Done
nordvpn is already the newest version (3.6.0-2).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up nordvpn (3.6.0-2) ...
[ERROR] Unknown environment `bash'
dpkg: error processing package nordvpn (--configure):
installed nordvpn package post-installation script subprocess returned error exit status 255
Errors were encountered while processing:
nordvpn
E: Sub-process /usr/bin/dpkg returned an error code (1)
我读这里运行以下命令
dpkg --configure -a
// errors
Setting up nordvpn (3.6.0-2) ...
[ERROR] Unknown environment `bash'
dpkg: error processing package nordvpn (--configure):
installed nordvpn package post-installation script subprocess returned error exit status 255
Errors were encountered while processing:
nordvpn
我不确定为什么 docker 容器会发生这种情况,因为该过程在我的常规 ubuntu 桌面安装上进行得很顺利。
答案1
不确定您是否已经弄清楚了,但 postinstall 脚本专门用于配置 systemd/sysvinit 脚本。由于您在 docker 容器内运行,因此您没有这两个脚本。
对于那些好奇的人来说,该脚本会查看 PID 为 1 的进程,以确定您正在运行的是 systemd 还是 sysvinit。但是,由于这是在 docker 内部,因此 PID 1 将属于您传递给 docker 的任何命令(在本例中为 bash)。
由于该应用程序已经安装,您应该可以安全地忽略该错误。