一、需求:
因项目需要,系统需要将ubuntu16.0.4升级至18.0.4,系统初始镜像源地址是国外的地址,现需要进行修改;
二、修改步骤:
1、#打开/etc/apt目录 cd /etc/apt
2、#查看对应的目录下文件信息 ls
3、#备份所需操作的文件 cp sources.list source.list_bak
4、#修改sources.list内的镜像源地址 vim sources.list
5、#将sources.list中的内容全部替换成如下内容
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
6、#使更改操作生效 sudo apt-get update