首页 > 解决方案 > 我尝试在 ubuntu 中安装 python 3.6 但每次我在终端中发出命令时都会显示错误:

问题描述

我尝试在 ubuntu 中安装 python 3.6

sudo apt-get install python3.6

它给出了以下错误

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

标签: pythonubuntuterminalpython-3.6

解决方案


发生这种情况的锁在 apt 进程运行时放置,并在进程完成时移除。如果有一个没有进程运行的锁,这可能意味着进程由于某种原因被卡住并且没有释放锁。

尝试这个:

ps aux | grep apt
sudo kill -9 processnumber

您可以在此处找到有关如何删除锁定的更多解决方案:https ://askubuntu.com/questions/15433/unable-to-lock-the-administration-directory-var-lib-dpkg-is-another-process

然后使用此链接安装 python3.6:https ://askubuntu.com/questions/865554/how-do-i-install-python-3-6-using-apt-get


推荐阅读