尝试使用时出现此错误apt-get
:
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?
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题?
我使用 Ubuntu 12.04 64 位,我执行了以下操作:sudo gedit /etc/apt/apt.conf
并添加了
APT::Install-Recommends "false";
APT::Install-Suggests "false";
Run Code Online (Sandbox Code Playgroud)
但它没有用。当我尝试安装一个包时,它仍然想安装建议和推荐的包。我该如何解决这个问题?
16.4 Ubuntu
apt-get update
W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (1: Operation not permitted)
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
Run Code Online (Sandbox Code Playgroud) 错误:
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
Run Code Online (Sandbox Code Playgroud)
所以,我已经看到这个错误出现了几次,并且由于使用以下命令而得到它:
sudo apt-get update && apt-get upgrade
Run Code Online (Sandbox Code Playgroud)
我以 root 身份运行并确保没有任何更新管理器正在运行。首先,我尝试使用以下方法检查锁定它的内容:
sudo lsof /var/lib/dpkg/lock
Run Code Online (Sandbox Code Playgroud)
输出为:
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/gareth/.gvfs
Output information may be incomplete.
Run Code Online (Sandbox Code Playgroud)
以防万一我尝试使用以下方法移除锁:
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
Run Code Online (Sandbox Code Playgroud)
……无济于事。有趣的是,如果我实际上是 root 并使用:
sudo -s
apt-get update && apt-get upgrade
Run Code Online (Sandbox Code Playgroud)
...更新有效。所以我可以更新和升级我的软件包,只要我真的是 root,这有点令人沮丧。这也意味着它更多地与权限有关,而不是其他锁定目录的东西?
在此先感谢您提供任何帮助。
当我运行命令时,出现以下错误:
您需要以 root 身份执行此命令。
什么是root
,我怎样才能成为它?
“你是root吗?”这个问题的答案是什么?APT问的?
输入密码后收到此消息时,我正在安装受限制的附加程序包。
我输入yes
了问题的答案,现在终端正在填满这封信y
!
我该怎么办?
user@chrubuntu:~$ sudo apt-get install wine1.7
[sudo] password for user:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
wine1.7 : Depends: wine1.7-i386 (= 1:1.7.19-0ubuntu2~trusty2) …
Run Code Online (Sandbox Code Playgroud) 当我运行此命令时:
apt-get install git-core
Run Code Online (Sandbox Code Playgroud)
表明:
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
Run Code Online (Sandbox Code Playgroud) 我正在尝试安装 git
apt-get install git
Run Code Online (Sandbox Code Playgroud)
然后它说
E: Could not open lock fine /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
Run Code Online (Sandbox Code Playgroud)
我怎么得到这个?
我正在尝试运行此命令:
sudo apt-get update && apt-get upgrade
Run Code Online (Sandbox Code Playgroud)
但我不断收到这些错误
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
Run Code Online (Sandbox Code Playgroud)
我在另一个答案中读到,通过使用sudo
这些错误将得到解决。但就我而言,我已经在使用 sudo。如何解决这些错误?