Ubuntu apt鏡像源更改

前言

因爲某牆的存在,通常默認使用 ubuntu 的官方源 archive.ubuntu.com/ 下載的速度不是通常的慢,因此找到提升下載速度的方法——更換apt鏡像源,下面記錄一下。html


步驟

1. 備份source.list

cd /etc/apt/ 
sudo cp sources.list sources.list.bak複製代碼

2. 修改sources.list

sudo vim sources.list複製代碼

把裏面的內容換成某個鏡像源提供的地址(本人用的是 清華 TUNA 源)ubuntu

# 默認註釋了源碼鏡像以提升 apt update 速度,若有須要可自行取消註釋
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse

# 預發佈軟件源,不建議啓用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiver
                         複製代碼

3. 更新 apt 本地索引

sudo apt-get update複製代碼

4. 下載測試

下載一個cmake  sudo apt-get install cmake vim


確實快了很多,有時候清華雲不穩,下載的時候出錯,apt-get update 一直在GETbash


能夠試試其餘源ionic


其餘源

  • 阿里源:https://developer.aliyun.com/mirror/
  • 網易 163 源:http://mirrors.163.com/ 
  • 中科大 USTC 源:https://mirrors.ustc.edu.cn/ 
  • 清華 TUNA 源:https://mirrors.tuna.tsinghua.edu.cn/ubuntu 
  • 中國官方源(搜狐):http://mirrors.sohu.com/help/ubuntu.html
相關文章
相關標籤/搜索