ayy*_*ian 5 windows amazon-ec2 windows-subsystem-for-linux
我一直在尝试在 WSL 上安装 docker,但它不断抛出错误
我已经尝试过了sudo apt-get remove ec2-instance-connect,它抛出了这个错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
ec2-instance-connect
0 upgraded, 0 newly installed, 1 to remove and 1 not upgraded.
1 not fully installed or removed.
After this operation, 57.3 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 64032 files and directories currently installed.)
Removing ec2-instance-connect (1.1.12+dfsg1-0ubuntu3) ...
Deleted system user ec2-instance-connect
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
dpkg: error processing package ec2-instance-connect (--remove):
installed ec2-instance-connect package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
ec2-instance-connect
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
Run Code Online (Sandbox Code Playgroud)
它不允许我运行一个upgrade或install任何新的软件包。
有人能帮我一下吗?
我刚刚在 Unix & Linux Stack 上遇到了其他人,也遇到了几乎相同的问题。在寻找答案时,我刚刚发现了这个(未回答的)问题。我在那里发布了一个答案,但我会重复这个问题的相关部分,以防其他人遇到它。
ec2-instance-connect如果在 WSL 上错误安装,结果会是一个相当有问题的包。它通常只应在 Amazon/AWS EC2 实例中运行时安装在 Ubuntu 上。
它具有采用 Systemd 的安装后脚本和删除后脚本,而 WSL 上不提供该脚本。据我所知,由于postinstall永远不会成功完成,因此每次您执行许多其他命令时它都会尝试运行apt。
要摆脱它(并停止错误),仅仅这样做是不够的sudo apt purge ec2-instance-connect,因为删除后错误仍然会失败(并且包将保留)。您需要:
sudo rm /var/lib/dpkg/info/ec2-instance-connect.postrm
sudo apt purge ec2-instance-connect
sudo deluser --system --quiet ec2-instance-connect
Run Code Online (Sandbox Code Playgroud)
apt此后应该可以再次正常工作,但请参阅上面链接的 Unix & Linux Stack 答案,以获取有关其他需要检查的内容的讨论,这些内容可能需要清理。
| 归档时间: |
|
| 查看次数: |
909 次 |
| 最近记录: |