从 12.10 升级到 14.10 失败

从 12.10 升级到 14.10 失败

从 12.10 升级到 14.10 时出现此错误:

W:Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/main/source/Sources  404  Not Found [IP: 91.189.91.15 80]
W:Failed to fetch http://security.ubuntu.com/ubuntu/dists/raring-security/restricted

我应该怎么办?

答案1

测试一下:

打开终端,

Ctrl++AltT

运行:

sudo -i
nano /etc/apt/sources.list

在打开的文件中。

删除内容。

粘贴以下内容:

deb http://us.archive.ubuntu.com/ubuntu/ utopic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ utopic main restricted
deb http://us.archive.ubuntu.com/ubuntu/ utopic-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ utopic-updates main restricted
deb http://us.archive.ubuntu.com/ubuntu/ utopic universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ utopic universe
deb http://us.archive.ubuntu.com/ubuntu/ utopic-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ utopic-updates universe
deb http://us.archive.ubuntu.com/ubuntu/ utopic multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ utopic multiverse
deb http://us.archive.ubuntu.com/ubuntu/ utopic-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ utopic-updates multiverse
deb http://us.archive.ubuntu.com/ubuntu/ utopic-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ utopic-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu utopic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu utopic-security main restricted
deb http://security.ubuntu.com/ubuntu utopic-security universe
# deb-src http://security.ubuntu.com/ubuntu utopic-security universe
deb http://security.ubuntu.com/ubuntu utopic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu utopic-security multiverse
deb http://archive.canonical.com/ubuntu utopic partner
# deb-src http://archive.canonical.com/ubuntu utopic partner
deb http://extras.ubuntu.com/ubuntu utopic main
# deb-src http://extras.ubuntu.com/ubuntu utopic main
deb http://us.archive.ubuntu.com/ubuntu/ utopic-proposed universe multiverse restricted main

Ctrl+ O,保存文件。Ctrl+ X,关闭 nano。

继续运行:

apt-get autoremove
apt-get clean
UNUSCONF=$(dpkg -l|grep "^rc"|awk '{print $2}')
apt-get remove --purge $UNUSCONF
NEWKERNEL=$(uname -r|sed 's/-*[a-z]//g'|sed 's/-386//g')
ADDKERNEL="linux-(image|headers|ubuntu-modules|restricted-modules)"
METAKERNEL="linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)"
UNUSKERNELS=$(dpkg -l|awk '{print $2}'|grep -E $ADDKERNEL |grep -vE $METAKERNEL|grep -v $NEWKERNEL)
apt-get remove --purge $UNUSKERNELS
apt-get update
apt-get dist-upgrade
dpkg --configure -a
apt-get -f install
apt-get clean
reboot

相关内容