Ubuntu 更換鏡像源
通常我們使用ubunntu的時(shí)候總是出現(xiàn)網(wǎng)絡(luò)過(guò)慢導(dǎo)致的更新下載失敗等問(wèn)題。
Ubuntu默認(rèn)的服務(wù)器是在國(guó)外,自然連接就很慢。
這里我們更換成國(guó)內(nèi)的鏡像源,這里使用清華鏡像源。
操作步驟如下:https://blog.csdn.net/qq_57171795/article/details/123109463
下面介紹更換清華鏡像源的方法
1.打開(kāi)Ubuntu的控制臺(tái)(快捷鍵ctrl+Alt T)
2.進(jìn)入 /etc/apt/路徑
cd /etc/apt/
3.將sources.list備份保存為sources.backup.list,以防止有需要的時(shí)候更換回來(lái)
cp -a sources.list sources.backup.list
4.打開(kāi)清華鏡像官方,在搜索框輸入ubuntu ,點(diǎn)擊ubuntu旁邊的小問(wèn)號(hào)
https://mirrors.tuna.tsinghua.edu.cn/
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
5.根據(jù)相應(yīng)的版本復(fù)制鏡像源碼,查看ubuntu版本。
查看ubuntu對(duì)應(yīng)的版本方法:
cat /etc/issue
這里我的版本號(hào)是:21.10,需要在清華網(wǎng)站上選擇相應(yīng)的版本后再?gòu)?fù)制鏡像源碼
6.打開(kāi)sources.list
sudo gedit sources.list
7.將sources.list內(nèi)的內(nèi)容清空,粘貼剛剛復(fù)制的鏡像源,并保存(save)
下面的是ubuntu20.04
# 默認(rèn)注釋了源碼鏡像以提高 apt update 速度,如有需要可自行取消注釋
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# 預(yù)發(fā)布軟件源,不建議啟用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
下圖是21.10:
8.更新鏡像源文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-790666.html
sudo apt-get update
到這里就完成了。文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-790666.html
到了這里,關(guān)于Ubuntu 更換清華大學(xué)鏡像源的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!