zoukankan      html  css  js  c++  java
  • apt-get 安装时,提示lock被占用

    root@ubuntu:/root# sudo apt-get install -y httpd
    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?

    解决方案:

    其实这是因为有另外一个程序在运行,导致锁不可用。原因可能是上次运行更新或安装没有正常完成。解决办法是杀死此进程
    sudo rm /var/cache/apt/archives/lock
    sudo rm /var/lib/dpkg/lock

     但是这样不能解决问题:可能还会出现问题,解决方案:

    1,sudo dpkg --configure -a

    2,sudo apt-get update

     Could not open lock file /var/lib/dpkg/lock - open (13:Permission denied)

     Unable to lock the administration directory (/var/lib/dpkg/),are you root? 

        解决方案:

        sudo rm -rf /var/lib/dpkg/lock

        sudo rm -rf /var/cache/apt/archives/lock

        sudo apt-get updat

  • 相关阅读:
    Python—re模块
    Python—json模块
    Python—sys模块介绍
    Python—os模块介绍
    Python—randonm模块介绍
    Python—time模块介绍
    Python—包介绍
    Python—模块介绍
    Python—装饰器
    jvm、jre、jdk
  • 原文地址:https://www.cnblogs.com/ordili/p/6915182.html
Copyright © 2011-2022 走看看