Linux系统中安装golang-go时出现unable to lock the administration directory的解决
来源:互联网 发布:福富软件 国企 编辑:程序博客网 时间:2024/06/14 15:55
Linux中搭建go环境时出现unable to lock the administration directory问题的解决
首先看一下出现的结果,是否是如下图所示:
如果是的话,下面我们来动手解决。出现这种情况的原因主要有两个:
(一)apt还在运行
解决方法,找到并且杀掉所有的apt-get和apt进程。在命令行中输入ps -a | grep apt命令,可以查到所有apt相关的进程,然后kill掉这些进程。
(二)lock文件的限制
当没有apt-get或者apt进程的情况下,那么就基本确定是这个原因造成的。锁定的文件会阻止Linux系统中某些文件或者数据的访问,一旦运行了apt-get或者apt命令,锁定文件将会创建于/var/lib/apt/lists、/var/lib/dpkg、/var/cache/apt/archives中。这有助于运行中的apt-get或者apt进程能够避免被其他需要使用相同文件的用户或者系统进程所打断。当该进程执行完毕后,锁定文件将会删除。锁定文件的名字一般为lock。
在上面几个不同的文件夹中看到了锁定文件,这是因为进程由于某个原因被杀掉了,因此需要删除锁定文件来避免该错误。
具体步骤如下:
step1:依次进入以上三个目录中,查看是否有lock文件,如果有执行后面的操作。
step2:执行删除命令来移除/var/lib/dpkg/目录下的锁定文件,rm /var/lib/dpkg/lock。执行这条命令时,有可能需要root权限才能执行,因此可以切换到root用户。
step3:强制重新配置软件包,执行命令dpkg –configure -a。
step4:也可以删除/var/lib/apt/lists以及缓存文件夹下的锁定文件,执行命令rm /var/lib/apt/lists/lock 和rm /var/cache/apt/archives/lock
step5:更新软件包源列表。执行命令apt update,或者apt-get update。
执行完以上操作后,应该就可以正常安装golang-go了。
- Linux系统中安装golang-go时出现unable to lock the administration directory的解决
- 修复 Ubuntu 中“Unable to lock the administration directory (/var/lib/dpkg/)”的
- Unable to lock the administration directory (/var/lib/dpkg/)
- 修复 Ubuntu 中“Unable to lock the administration directory (/var/lib/dpkg/)”
- Ubuntu终端出现Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
- (ubuntu安装错误)Unable to lock the administration...
- 在Ubuntu中遇到Unable to lock the administration directory (/var/lib/dpkg/),are you root? 问题解决办法
- 在Ubuntu中遇到Unable to lock the administration directory (/var/lib/dpkg/),are you root? 问题解决办法
- 在Ubuntu中遇到Unable to lock the administration directory (-var-lib-dpkg-),are you root- 问题解决办法
- E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
- Unable to lock the administration directory (/var/lib/dpkg/),is another process using it?
- E: Unable to lock the administration directory (/var/lib/dpkg/), is another
- Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
- Unable to lock the administration directory (/var/lib/dpkg/),is another process using it?
- Unable to lock the administration directory (/var/lib/dpkg/),is another process using it?
- Unable to lock the administration directory (/var/lib/dpkg/), is another process
- E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
- Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
- 如何设计一个秒杀系统
- 实验二: CSS
- PHP 创建、删除和移动文件函数
- 八周第三次课 2017.12.6 rsync通过服务同步、linux系统日志、screen工具
- 谷歌TensorFlow Lite支持Core ML
- Linux系统中安装golang-go时出现unable to lock the administration directory的解决
- Coursera deeplearning.ai 深度学习习题1-2-Neural Network Basics
- 操作系统基础训练十个问题及解答
- Genymotion+VirtualBox (android虚拟机的使用)
- 刷爆推特的钢管舞机器人有~故~事
- java基础 1
- leetcode 258[easy]---Add Digits
- 不好,两群AI打起来了!“幕后主使”是上海交大~
- Rhyme/Spring bean的实例化 1.3.2. Instantiating beans