`
ispring
  • 浏览: 355654 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

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 ...

    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

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

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

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

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

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

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

    Ubuntu | 安装vim遇到的问题

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

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

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

    index.html

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

    linux 下安装播放器:无法解析或打开软件包的列表或是状态文件

    最近准备在ubuntu系统上安装一个播放器,方便学习。可是自带的播放器缺少插件,而且自带的播放器比较...E: Problem with MergeList /var/lib/apt/lists/cn.archive.ubuntu.com_ubuntu_dists_natty_main_i18n_Transla

    dionaea-honeypot:虚拟机Ubuntu服务器12.04 x64安装dionaea honeypot

    sudo rm -rf /var/lib/apt/lists/* sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade 安装特权sbb: sudo apt-get install libudns-dev libglib2.0-dev libssl-dev libc

    SQL: A BEGINNER'S GUIDE 3/E

    Key Skills & Concepts--Lists of specific skills covered in the chapter Ask the Experts--Q&A sections filled with bonus information and helpful tips Try This--Hands-on exercises that show how to apply ...

    todoApi

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

    Simkl列表:电视,动漫,电影 - 电视追踪「Simkl Lists: TV, Anime, Movies - TV Tracker」-crx插件

    跟踪您最喜爱的电视节目,动漫和电影。...计算机,Facebook Messenger通知-阅读有关最佳电影,电视节目和动漫的评论-直接从Simkl网站观看电影和电视节目可在Hulu和Crunchyroll上获得投票我们接下来应在...

    ubuntu20.04 LTS系统默认源sources.list文件的修改

    sudo gedit /etc/apt/sources.list 然后把下面默认源内容复制进去 ubuntu20.LTS系统默认源sources.list文件内容 #deb cdrom:[Ubuntu 20.04 LTS _Focal Fossa_ - Release amd64 (20200423)]/ focal main ...

    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 ...

    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]...

    Trello:对齐列表「Trello: Align Lists」-crx插件

    只需双击列表,就可以将您的列表排列在Trello之下。 只需双击列表,即可将Trello.com中的列表彼此对齐。 注意:如果该功能不起作用,请刷新页面,然后重试。 支持语言:English

    JBrute:开源安全工具,用于审核哈希密码。-开源

    要运行JBrute,需要Java Runtime 1.7...https://sourceforge.net/p/jbrute/blog FAQ:https://sourceforge.net/p/jbrute/wiki/FAQ/ General问题:jbrute-users@lists.sourceforge.net(您可以在https://lists.sourcefo

    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]: ...

Global site tag (gtag.js) - Google Analytics