备份原来的源:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
更换源:
sudo vim /etc/apt/sources.list
将里面文件内容全部替换成下面:
#deb包
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# 源码
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
##测试版源
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
# Canonical 合作伙伴和附加
deb http://archive.canonical.com/ubuntu/ xenial partner
deb http://extras.ubuntu.com/ubuntu/ xenial main
执行更新:
sudo apt-get update
复损坏的软件包,尝试卸载出错的包,重新安装正确版本的:
sudo apt-get -f install
更新软件:
sudo apt-get upgrade
本文详细介绍如何备份并更换Ubuntu系统的软件源至阿里云镜像,包括具体的命令操作步骤,如使用sudo cp备份sources.list,编辑并替换为阿里云镜像源,以及执行sudo apt-get update和修复损坏软件包的方法。
4190

被折叠的 条评论
为什么被折叠?



