`

ubuntu中解决“E: 无法获得锁 /var/lib/apt/lists/lock

阅读更多
用sudo apt-get update时出现“ E: 无法获得锁 /var/lib/apt/lists/lock”错误。
在网上搜索到的解决方案──“将/var/lib/apt/list/lock删除掉即可”──其实是一种极端的情况,也就是在上次更新没有正常关闭的情况下使用。
在大部分情况下,问题的原因在于其它的程序如系统的自动更新、新立得等正在使用apt-get进程,所以解决方法也就是将这一进程关闭。
具体如下:
1、ps-aux 查出apt-get进程的PID,通常是一个四位数字。
2、用sudo kill PID代码 杀死进程
3、用sudo apt-get update,sudo apt-get dist-upgrade升级。
分享到:
评论

相关推荐

    shit:Sudo 历史调用工具

    [user@host] $ apt-get updateE: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)E: Unable to lock directory /var/lib/apt/lists/E: Could not open lock file /var/lib/dpkg/...

    ubuntu16.04安装python3.6.docx

    主要解决安装过程报错,有完整的安装过程。 python-3.6/ubuntu/dists/xenial/main/binary-amd64/Packages 403 Err:7 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main amd64 Packages 403 ...

    nomachine_6.9.2_1_amd64.deb

    Debian GNU Linux 4.0 Etch/5.0 Lenny/6.0 Squeeze/7.0 Wheezy/8.0 Jessie/9.0 Stretch/10.0 Buster, Ubuntu 8.04 Hardy Heron/8.10 Intrepid Ibex/9.04 Jaunty Jackalope/9.10 Karmic Koala/10.4 Lucid Lynx/10.10 ...

    spring 最新框架jar

    [team members]: https://twitter.com/springframework/lists/team/members [The Spring Blog]: http://spring.io/blog/ [news feed]: http://spring.io/blog/category/news [Apache License]: ...

    emqx-ubuntu16.04-v3.1.0_amd64.deb

    emq在Ubuntu16.04系统上的部署安装包,下载后运行命令sudo dpkg -i emqx-ubuntu16.04-v3.1.0_amd64.deb 安装

    解决Ubuntu更新apt-get时报错哈希码不匹配

    背景 昨晚更新apt-get时由于太晚要睡觉,所以还没下载完就ctrl-c中断、关机了。今天重新更新时,报错如下 ...rm -rf /var/lib/apt/lists/* apt-get clean && sudo apt-get update 作者:coder_szc

    wookie-lists:微服务读书俱乐部的用户列表

    伍奇人名单 构建微服务研讨会/读书俱乐部的简单服务 在部署到 heroku (Wookie 是因为它是 github 建议的回购名称的一部分。仅供参考。) 基本API GET /api/lists ...DELETE /api/lists/:listId/users/:userId

    Android代码-crosswalk

    Introduction Crosswalk is an app runtime based on Chromium/Blink. It is an open source project started by the Intel Open Source Technology Center ...As of February 2017, Crosswalk is not being developed ...

    Android代码-undertow

    Undertow Undertow is a Java web server based on non-blocking IO. It consists of a few different parts: ...Mailing List: undertow-dev@lists.jboss.org http://lists.jboss.org/mailman/listinfo/undertow-dev

    index.html

    网页设计,呵呵,专业。index.html

    ansible-carbon:有助于管理 Carbon 安装的角色

    碳有助于管理 Carbon 安装的角色。 它使用defaults变量来生成主要的 Carbon 和存储模式配置文件。例子 ---# Default installation- hosts: myhost1 roles: - ...WHITELISTS_DIR: /var/lib/carbon/lists/ CONF_DIR:

    apache-maven-3.5.0-bin

    1) Unpack the archive where you would like to store the binaries, e.g.: Unix-based operating systems (Linux, Solaris and Mac OS X) tar zxvf apache-maven-3.x.y.tar.gz Windows unzip apache-maven-3...

    docker-update-check:检查Docker容器是否需要更新

    Docker更新检查运行服务器意味着您必须跟上错误修复和安全更新。... 为此, apt-check将/var/lib/dpkg/status文件中找到的已安装软件包列表与/var/lib/apt/lists/软件包列表进行比较。 软件包管理工

    docker-ubuntu:片段和示例 Dockerfile 可帮助更快地构建基于 Ubuntu 的映像

    docker-ubuntu ... RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 保持容器运行 CMD tail -f /dev/null 更改时区 RUN echo "Asia/Shanghai" > /etc/timezone RUN dpkg-re

    todoApi

    PUT localhost:8888 / todoApi / lists /#:获取“名称”字符串和列表ID并更新列表的名称,其中#是目标列表ID 删除localhost:8888 / todoApi / lists /#:删除列表,其中#是目标列表ID,还检查连接到列表的...

    Ubuntu | 安装vim遇到的问题

    一旦你运行了 apt-get 或者 apt 命令,锁定文件将会创建于 /var/lib/apt/lists/、/var/lib/dpkg/、/var/cache/apt/archives/ 中。 这有助于运行中的 apt-get 或者 apt进程能够避免被其它需要使用相同文件的用户...

    hibernate-2.1.8.part1.rar

    hibernate-devel@lists.sourceforge.net Free Technical Support: http://forum.hibernate.org Commercial Support & Training: http://www.hibernate.org/SupportTraining Get Up And Running Quick ---...

    hibernate-2.1.8.part3.rar

    hibernate-devel@lists.sourceforge.net Free Technical Support: http://forum.hibernate.org Commercial Support & Training: http://www.hibernate.org/SupportTraining Get Up And Running Quick ---...

    hibernate-2.1.8.part2.rar

    hibernate-devel@lists.sourceforge.net Free Technical Support: http://forum.hibernate.org Commercial Support & Training: http://www.hibernate.org/SupportTraining Get Up And Running Quick ---...

    Sortable前端框架

    Sortable is a <s>minimalist</s> JavaScript library for reorderable drag-and-drop lists. Demo: http://rubaxa.github.io/Sortable/ ## Features * Supports touch devices and [modern]...

Global site tag (gtag.js) - Google Analytics