sudo apt-get update取消了一半,现在无法运行sudo apt-get update

我是ubuntu的新用户。 到目前为止,它一直运作良好。 今天我尝试过’sudo apt-get update’,并且在获取数据后它已经冻结了。 这是输出:

sudo apt-get update Hit:1 http://archive.canonical.com/ubuntu xenial InRelease Hit:2 http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu xenial InRelease Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB] Hit:4 http://us.archive.ubuntu.com/ubuntu xenial InRelease Hit:5 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease Get:6 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [92.2 kB] Fetched 187 kB in 0s (225 kB/s) 

使用sudo apt-get clean然后sudo apt-get update ,我得到以下问题:

 E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/ 

使用sudo rm -rf /var/lib/apt/lists/lock然后sudo apt-get update我得到一个新问题:

 ** (appstreamcli:3466): WARNING **: Exception: Unable to get write lock on /var/cache/app-info/xapian/default: already locked 
 sudo fuser /var/cache/app-info/xapian/default 

没有显示。

 file /var/cache/app-info/xapian/default 

节目

 /var/cache/app-info/xapian/default: directory 

看看这个链接 。 前几天我遇到了无法解锁的问题,并用Faheem Mitha使用的相同答案解决了这个问题。

 ps aux | grep apt 

这将返回一个与PID相关的事情列表。 然后运行:

 kill processnumber 

要么

 kill -9 processnumber 

您可能需要或不必调用sudo priveleges以根据您的设置终止进程。

暂时修复是简单地删除/var/cache/app-info/xapian/default 。 它似乎是apt的搜索索引,因此必须重建,否则不会产生不良影响。

是的,我有同样的问题,我的解决方法(我当然不是)是:

  1. 重启系统
  2. killall相对过程
  3. sudo apt-get upgrade
  4. 然后你可以正常安装
  5. 完成! 有用。