Ubuntu系統修改資源爲阿里雲鏡像

通常都會推薦使用國內的鏡像源,好比163或者阿里雲的鏡像服務器
將下列文本添加到/etc/apt/sources.list文件裏ubuntu

deb http://mirrors.aliyun.com/ubuntu/ raring main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ raring-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ raring-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ raring-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ raring-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ raring main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ raring-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ raring-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ raring-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ raring-backports main restricted universe multiverse
1
2
3
4
5
6
7
8
9
10
可是執行sudo apt-get update仍然報錯,問題在於DNS沒有配置好。
解決方法:服務器

sudo vi /etc/resolv.conf
1
添加阿里雲

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
#這裏用的是阿里雲的DNS服務器
nameserver 223.5.5.5
nameserver 223.6.6.6
1
2
3
4
5
6
以後執行sudo apt-get update就正常了。
————————————————
版權聲明:本文爲CSDN博主「feiniao8651」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處連接及本聲明。
原文連接:https://blog.csdn.net/feiniao8651/article/details/60332535.net

相關文章
相關標籤/搜索