apt-get 安装过程中总是出错

apt-get 安装过程中总是出错

每当我尝试执行 apt-get install/upgrade 时,我总是会收到如下一系列错误。是不是因为 /etc/apt/sources.list 文件中有一些不正确的条目?如果是这样,如何纠正?

$ sudo apt-get -f install 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Correcting dependencies... Done
    The following package was automatically installed and is no longer required:
      linux-image-extra-3.8.0-30-generic
    Use 'apt-get autoremove' to remove it.
    The following extra packages will be installed:
      libjavascriptcoregtk-1.0-0 libwebkitgtk-1.0-0 libwebkitgtk-1.0-common libxerces-c3.1
    Suggested packages:
      gstreamer1.0-ffmpeg
    The following NEW packages will be installed:
      libjavascriptcoregtk-1.0-0 libwebkitgtk-1.0-0 libwebkitgtk-1.0-common libxerces-c3.1
    0 upgraded, 4 newly installed, 0 to remove and 7 not upgraded.
    1 not fully installed or removed.
    Need to get 11.7 MB of archives.
    After this operation, 39.9 MB of additional disk space will be used.
    Do you want to continue [Y/n]? Y
    WARNING: The following packages cannot be authenticated!
      libxerces-c3.1 libjavascriptcoregtk-1.0-0 libwebkitgtk-1.0-common libwebkitgtk-1.0-0
    Install these packages without verification [y/N]? Y
    Err http://in.archive.ubuntu.com/ubuntu/ raring/universe libxerces-c3.1 amd64 3.1.1-3
      404  Not Found [IP: 91.189.91.23 80]
    Err http://in.archive.ubuntu.com/ubuntu/ raring/main libjavascriptcoregtk-1.0-0 amd64 1.10.2-0ubuntu1
      404  Not Found [IP: 91.189.91.23 80]
    Err http://in.archive.ubuntu.com/ubuntu/ raring/main libwebkitgtk-1.0-common all 1.10.2-0ubuntu1
      404  Not Found [IP: 91.189.91.23 80]
    Err http://in.archive.ubuntu.com/ubuntu/ raring/main libwebkitgtk-1.0-0 amd64 1.10.2-0ubuntu1
      404  Not Found [IP: 91.189.91.23 80]
    Failed to fetch http://in.archive.ubuntu.com/ubuntu/pool/universe/x/xerces-c/libxerces-c3.1_3.1.1-3_amd64.deb  404  Not Found [IP: 91.189.91.23 80]
    Failed to fetch http://in.archive.ubuntu.com/ubuntu/pool/main/w/webkit/libjavascriptcoregtk-1.0-0_1.10.2-0ubuntu1_amd64.deb  404  Not Found [IP: 91.189.91.23 80]
    Failed to fetch http://in.archive.ubuntu.com/ubuntu/pool/main/w/webkit/libwebkitgtk-1.0-common_1.10.2-0ubuntu1_all.deb  404  Not Found [IP: 91.189.91.23 80]
    Failed to fetch http://in.archive.ubuntu.com/ubuntu/pool/main/w/webkit/libwebkitgtk-1.0-0_1.10.2-0ubuntu1_amd64.deb  404  Not Found [IP: 91.189.91.23 80]
    E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

答案1

  1. 首先确保你已经安装了应用程序 gksu 和 leafpad

    启动终端窗口。

输入(或复制/粘贴):

sudo apt-get install gksu leafpad

按 Enter 键并提交您的密码。请注意,密码将保持不可见,甚至不会显示星号,这是正常的。

2.然后删除您现在拥有的所有来源:

启动终端窗口。

输入(使用复制/粘贴以避免错误):

sudo rm -vf /etc/apt/sources.list.d/*.list && sudo rm -vf /etc/apt/sources.list

按 Enter。出现提示时输入密码;密码将完全不可见,甚至不会显示星号,这是正常的。

  1. 创建新的来源列表:

将以下命令复制/粘贴到终端:

gksudo leafpad /etc/apt/sources.list

按 Enter 键。

现在将下面的所有文本复制/粘贴到该空文本文件中:

## UBUNTU 14.04 LTS TRUSTY TAHR 的源列表
## 也适用于 XUBUNTU 14.04、LUBUNTU 14.04
## 和 KUBUNTU 14.04
## 来自:http://sites.google.com/site/easylinuxtipsproject
## 此列表适用于主服务器;您可能需要选择一个
## 更接近您的更快的镜像服务器,提供软件和更新。
## 仅适用于 14.04 LTS Trusty Tahr!
#
## 普通软件的来源:
deb http://archive.ubuntu.com/ubuntu trusty main
deb http://archive.ubuntu.com/ubuntu trusty-updates 主要
deb http://archive.ubuntu.com/ubuntu trusty restricted
deb http://archive.ubuntu.com/ubuntu trusty-updates 受限
deb http://archive.ubuntu.com/ubuntu 值得信赖的宇宙
deb http://archive.ubuntu.com/ubuntu trusty-updates universe
deb http://archive.ubuntu.com/ubuntu trusty multiverse
deb http://archive.ubuntu.com/ubuntu trusty-updates multiverse
#
## 安全更新来源:
deb http://archive.ubuntu.com/ubuntu trusty-security main
deb http://archive.ubuntu.com/ubuntu trusty-security restricted
deb http://archive.ubuntu.com/ubuntu trusty-security universe
deb http://archive.ubuntu.com/ubuntu trusty-security multiverse
#
## 反向移植源(降低优先级):
deb http://archive.ubuntu.com/ubuntu trusty-backports main
deb http://archive.ubuntu.com/ubuntu trusty-backports 受限
deb http://archive.ubuntu.com/ubuntu trusty-backports universe
deb http://archive.ubuntu.com/ubuntu trusty-backports multiverse
#
## 合作伙伴来源(软件来自
## CANONICAL 的业务合作伙伴):
deb http://archive.canonical.com/ubuntu 值得信赖的合作伙伴
#
## 独立来源(软件
## 来自第三方开发者):
deb http://extras.ubuntu.com/ubuntu trusty main
#
## 网络浏览器来源 GOOGLE CHROME
##(默认禁用):
## 仅当您安装了 Google Chrome 后才启用它!
## 您可以在应用程序软件和更新中启用它。
# deb http://dl.google.com/linux/chrome/deb/ 稳定主

保存文本文件并关闭它。

  1. 现在重新加载源列表信息:

在终端中:

sudo apt-get update

按 Enter 键并提交您的密码。请注意,密码将保持不可见,甚至不会显示星号,这是正常的。

你完成了!

相关内容