尝试使用 apt-get 更新时出现错误

尝试使用 apt-get 更新时出现错误

我尝试安装任何软件时都会出现错误。错误如下

Reading package lists... Error!
E: Could not open file /var/cache/apt/pkgcache.bin - open (22: Invalid argument)
E: Failed to truncate file - ftruncate (9: Bad file descriptor)
E: The package lists or status file could not be parsed or opened.

当我尝试使用更新系统时sudo apt-get update,我遇到其他错误,例如

W: Failed to fetch http://tz.archive.ubuntu.com/ubuntu/dists/precise-backports/main/binary-i386/Packages  404  Not Found [IP: 91. 189. 92. 192 80]

以及其他许多人。

我是 Ubuntu 新手。

答案1

尝试这个:

  1. 跑步gksudo gedit /etc/apt/sources.list

  2. 将这些行添加到它

    deb http://it.archive.ubuntu.com/ubuntu/ precise main universe restricted multiverse
    deb-src http://it.archive.ubuntu.com/ubuntu/ precise main universe restricted multiverse
    
    deb http://security.ubuntu.com/ubuntu precise-security main universe restricted multiverse
    deb-src http://security.ubuntu.com/ubuntu precise-security main universe restricted multiverse
    
    deb http://it.archive.ubuntu.com/ubuntu/ precise-updates main universe restricted multiverse
    deb-src http://it.archive.ubuntu.com/ubuntu/ precise-updates main universe restricted multiverse
    
  3. 保存文件并退出文本编辑器。

  4. 跑步sudo apt-get update

相关内容