所以我在WSL 2上使用Ubuntu 20.04
我用这样的方式删除了python:sudo apt remove python3。在此之后,我想再次安装python,但在安装之后,我编写了sudo apt update,然后编写了sudo apt upgrade,在编写升级之后,它搜索升级,然后给出错误:
nikeedev@Nikita-Goncarenko ~ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
E: Could not read response to hello message from hook [ ! -f /usr/lib/ubuntu-advantage/apt-esm-json-hook ] || /usr/lib/ubuntu-advantage/apt-esm-json-hook || true: Success
E: Could not read response to hello message from hook [ ! -f /usr/lib/ubuntu-advantage/apt-esm-json-hook ] || /usr/lib/ubuntu-advantage/apt-esm-json-hook || true: Success
✘ nikeedev@Nikita-Goncarenko ~ 发布于 2022-02-15 15:21:47
我发现它在重新安装后工作,多亏了@cocomac 's评论!
apt依赖于Python。你已经卸载了。如果你没有什么重要的东西,你就可以重来一点。还可能有一种重新安装Python的方法,但我不确定它在WSL2中如何工作。
发布于 2022-03-09 10:18:18
在将我的旧Ubuntu安装到一台新笔记本电脑后,我也遇到了同样的错误,但是重新安装Python对我来说不起作用。在这个吉特布问题的指导下,我最终通过删除(实际上重命名)文件/etc/apt/apt.conf.d/20apt-esm-hook.conf来解决这个问题:
cd /etc/apt/apt.conf.d/
sudo mv 20apt-esm-hook.conf 20apt-esm-hook.conf.baksudo apt upgrade现在就像一种魅力:)
https://askubuntu.com/questions/1383997
复制相似问题