reading package lists... done 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)
时间: 2023-06-05 16:47:31 浏览: 322
这是一个错误提示,意思是无法打开锁定文件/var/lib/apt/lists/lock,也无法锁定目录/var/lib/apt/lists,同时删除缓存文件/var/cache/apt/pkgcache.bin和/var/cache/apt/srcpkgcache.bin时也出了问题,可能是权限不足的原因。
相关问题
jss@LAPTOP-P5IENIJT:~$ apt-get update Reading package lists... Done 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)、
这个问题是由于您没有足够的权限来执行apt-get命令所导致的。在Linux系统中,需要使用root权限或者以root用户身份运行apt-get命令才能获得足够的权限。
您可以尝试使用sudo命令来运行apt-get命令,sudo命令可以临时提升当前用户的权限。请在终端中输入以下命令:
```bash
sudo apt-get update
```
系统会要求您输入当前用户的密码,输入密码后再次运行apt-get命令,应该就能够成功更新软件包列表了。
如果您没有对sudo命令进行配置或者没有root权限,您可能需要联系系统管理员或者具有适当权限的用户来执行这些操作。
sudo apt update Reading package lists... Done E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/
这个错误通常是因为有另一个进程正在使用apt-get或类似工具。你可以尝试以下命令来查找并杀死这些进程:
```
sudo lsof /var/lib/dpkg/lock
sudo lsof /var/lib/apt/lists/lock
sudo lsof /var/cache/apt/archives/lock
```
然后使用以下命令释放锁定:
```
sudo rm /var/lib/dpkg/lock
sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
```
最后,运行以下命令更新软件包列表:
```
sudo apt update
```
阅读全文