I see pretty much all the answers recommend deleting the lock. I don't recommend doing that as a first measure; maybe if there is no alternative. The lock is placed when an apt process is running, and is removed when the process completes. If there is a lock with no apparent process running, this may mean the process got stuck for some reason.

If you try

ps aux | grep apt

that will catch processes containing the word apt, at least. If you see an apt-get process or an aptitude process that looks stuck, you can try

kill processnumber

and if that doesn't work try

kill -9 processnumber

This should kill the process and may remove the lock. Killing an apt or aptitude process is harmless unless it is actually in the middle of package installation. In any case, if the process got stuck, you probably don't have a choice but to kill it.

Killing a dpkg process directly, if present, is not a good idea, because if dpkg is active, it is probably manipulating the package database, and killing it may leave the package database in an inconsistent state; i.e. corrupted.

Killing an apt-get or aptitude process is in general much safer.

Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?的更多相关文章

  1. 解决0% [Waiting for headers] 导致的unable to lock the administration directory (/var/lib/dpkg/) is another process using it

    这是我在配置vim的YouCompleteMe时遇到的问题,我需要使用CMake来编译YCM. 在我输入 $ sudo apt install cmake 由于网络原因导致安装一直卡在0% [Wait ...

  2. 解决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?

    是不是在使用ubuntu的时候特别是安装或更新的时候会出现下面的情况:  E: Could not get lock /var/lib/dpkg/lock - open (11: Resource t ...

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

    E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)E: Unable to l ...

  4. E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

    sudo rm /var/lib/dpkg/locksudo dpkg --configure -a

  5. Unable to lock the administration directory (/var/lib/dpkg/),is another process using it?

    Description:无法获得锁 /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)Unable to lock the ...

  6. 修复 Ubuntu 中“Unable to lock the administration directory (/var/lib/dpkg/)”

    在 Ubuntu 或者它的衍生版如 Linux Mint(我已经作为日常工作使用的系统)中使用 apt-get 命令或者其相对更新的APT 管理工具时,你可能会在命令行中看到一个 unable to ...

  7. Fix "Unable to lock the administration directory (/var/lib/dpkg/)" in Ubuntu

    While using the apt-get command or the relatively new APT package management tool in Ubuntu Linux or ...

  8. E: Unable to lock the administration directory (/var/lib/dpkg/)

    如何修复 Ubuntu 中的“Unable to lock the administration directory (/var/lib/dpkg/)” 在 Ubuntu 或者它的衍生版如 Linux ...

  9. 解决 unable to lock the administration directory (/var/lib/dpkg/) 问题

    阿里开源镜像站提供了raspbian的软件包镜像,国内的用户可以选择改用阿里镜像站作为更新源. 但是在更换源之后,执行 sudo apt-get update && apt-get u ...

随机推荐

  1. ogre3D学习基础11 -- 日志文件的使用与异常处理

    用文件来记录 Ogre 系统初始化.运行.结束以及调试信息.使用日志便于我们调试程序.Ogre 日志系统由两个类组成:Log 类与 LogManager. 1.Log类 Log 类的一个对象对应于一个 ...

  2. datatable 修改点击列头进行排序顺序

    一般点击排序时,是先升序后降序 可以通过如下代码修改排序规则 jQuery(function ($) { $(".datatable").dataTable({ "pag ...

  3. 【LeetCode】Binary Tree Postorder Traversal(二叉树的后序遍历)

    这道题是LeetCode里的第145道题. 题目要求: 给定一个二叉树,返回它的 后序 遍历. 示例: 输入: [1,null,2,3] 1 \ 2 / 3 输出: [3,2,1] 进阶: 递归算法很 ...

  4. CF878D D. Magic Breeding bitset

    D. Magic Breeding time limit per test 4 seconds memory limit per test 1024 megabytes input standard ...

  5. 测试openssl_encrypt

    <?php //$string = 'It works ? Or not it works ?'; //$pass = '1234'; //$method = 'aes128'; // // / ...

  6. iOS键盘高度的获取

    代码如下: - (void)viewDidLoad { [super viewDidLoad]; //增加监听,当键盘出现或改变时收出消息 [[NSNotificationCenter default ...

  7. 【bzoj4128】Matrix 矩阵乘法+Hash+BSGS

    题目描述 给定矩阵A,B和模数p,求最小的x满足 A^x = B (mod p) 输入 第一行两个整数n和p,表示矩阵的阶和模数,接下来一个n * n的矩阵A.接下来一个n * n的矩阵B 输出 输出 ...

  8. 刷题总结——regular words(hdu1502 dp+高精度加法+压位)

    题目: Problem Description Consider words of length 3n over alphabet {A, B, C} . Denote the number of o ...

  9. zabbix基于LNMP安装

    安装依赖 yum install pcre* #为了支持rewrite功能 yum install openssl openssl-devel yum install gcc make gd-deve ...

  10. TroubleShoot:The context has expired (0×80090317)

    网上搜了一下,服务器上的时间不正确,在SharePoint 设置中,可以通过管理中心设置下Time Zone 和服务器的时间上一致.