1、個人安裝環境
1.1 ubuntu 18.04.1
2、更新源分析
2.1 Ubuntu版本一覽表
|  
             
              版本號 
               |  
            
             
              代號 
               |  
            
             
              發布時間 
               |  
          
|---|---|---|
| 19.04 | Disco Dingo | 2019/4/19 | 
| 18.10 | Cosmic Cuttlefish | 2018/10/18 | 
| 18.04 LTS | Bionic Beaver | 2018/04/26 | 
| 17.10 | Artful Aardvark | 2017/10/21 | 
| 17.04 | Zesty Zapus | 2017/04/13 | 
| 16.10 | Yakkety Yak | 2016/10/20 | 
| 16.04LTS | Xenial Xerus | 2016/04/21 | 
| 15.10 | Wily Werewolf | 2015/10/23 | 
| 15.04 | Vivid Vervet | 2015/04/22 | 
| 14.10 | Utopic Unicorn | 2014/10/23 | 
| 14.04 LTS | Trusty Tahr | 2014/04/18 | 
| 13.10 | Saucy Salamander | 2013/10/17 | 
| 13.04 | Raring Ringtail | 2013/04/25 | 
|  
             
              12.10 
               |  
            
             
              Quantal Quetzal 
               |  
            
             
              2012/10/18 
               |  
          
|  
             
              12.04 LTS 
               |  
            
             
              Precise Pangolin 
               |  
            
             
              2012/04/26 
               |  
          
|  
             
              11.10 
               |  
            
             
              Oneiric Ocelot 
               |  
            
             
              2011/10/13 
               |  
          
|  
             
              11.04(Unity成為默認桌面環境) 
               |  
            
             
              Natty Narwhal 
               |  
            
             
              2011/04/28 
               |  
          
|  
             
              10.10 
               |  
            
             
              Maverick Meerkat 
               |  
            
             
              2010/10/10 
               |  
          
|  
             
              10.04 LTS 
               |  
            
             
              Lucid Lynx 
               |  
            
             
              2010/04/29 
               |  
          
|  
             
              9.10 
               |  
            
             
              Karmic Koala 
               |  
            
             
              2009/10/29 
               |  
          
|  
             
              9.04 
               |  
            
             
              Jaunty Jackalope 
               |  
            
             
              2009/04/23 
               |  
          
|  
             
              8.10 
               |  
            
             
              Intrepid Ibex 
               |  
            
             
              2008/10/30 
               |  
          
|  
             
              8.04 LTS 
               |  
            
             
              Hardy Heron 
               |  
            
             
              2008/04/24 
               |  
          
|  
             
              7.10 
               |  
            
             
              Gutsy Gibbon 
               |  
            
             
              2007/10/18 
               |  
          
|  
             
              7.04 
               |  
            
             
              Feisty Fawn 
               |  
            
             
              2007/04/19 
               |  
          
|  
             
              6.10 
               |  
            
             
              Edgy Eft 
               |  
            
             
              2006/10/26 
               |  
          
|  
             
              6.06 LTS 
               |  
            
             
              Dapper Drake 
               |  
            
             
              2006/06/01 
               |  
          
|  
             
              5.10 
               |  
            
             
              Breezy Badger 
               |  
            
             
              2005/10/13 
               |  
          
|  
             
              5.04 
               |  
            
             
              Hoary Hedgehog 
               |  
            
             
              2005/04/08 
               |  
          
|  
             
              4.10(初始發布版本) 
               |  
            
             
              Warty Warthog 
               |  
            
             
              2004/10/20 
               |  
          
2.2 更新源格式分析
2.2.1 使用如下命令查看source.list幫助文檔:
man sources.list
2.2.2 相應格式信息截取如下:
The format for two one-line-style entries using the deb and deb-src types is:
           deb [ option1=value1 option2=value2 ] uri suite [component1] [component2] [...]
           deb-src [ option1=value1 option2=value2 ] uri suite [component1] [component2] [...]
 
        說明如下:

2.2.3 suite字段的“bionic"代表什么意思?
如上已經列舉Ubuntu版本一覽表,相信眼尖的童鞋已經看出來了,"bionic"是18.04TLS的版本代號!所以Ubuntu18.04TLS更新源必須為如下格式:
uri bionic component1 component2 component3 component4
網上很多帖子,給出更新源url,而又不介紹自己使用Ubuntu的版本,導致很多童鞋更新源設置錯誤!
3、常見更新源列舉
3.1 中國科技大學源
##中科大源 deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
3.2 阿里源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
3.3 更新源目錄分析
訪問http://mirrors.aliyun.com/ubuntu/,目錄結構如下:

單擊進入dists子目錄,不同的目錄對應不同的Ubuntu版本代號

但個人也發現,更新源目錄層級無法與阿里目錄層級完全對應上,清楚的童鞋歡迎給我留言!
http://mirrors.aliyun.com/ubuntu/dists/bionic/main/,目錄中已經沒有restricted universe multiverse
4、選取速度較快的源
4.1 ping中科大源
ping mirrors.ustc.edu.cn
ping結果:
PING mirrors.ustc.edu.cn (202.141.176.110) 56(84) bytes of data. 64 bytes from mirrors.ustc.edu.cn (202.141.176.110): icmp_seq=1 ttl=128 time=60.9 ms 64 bytes from mirrors.ustc.edu.cn (202.141.176.110): icmp_seq=2 ttl=128 time=55.7 ms 64 bytes from mirrors.ustc.edu.cn (202.141.176.110): icmp_seq=3 ttl=128 time=58.6 ms 64 bytes from mirrors.ustc.edu.cn (202.141.176.110): icmp_seq=4 ttl=128 time=58.0 ms
大概需要60ms
4.2 ping阿里源
ping mirrors.aliyun.com
ping結果:
64 bytes from 58.215.157.229 (58.215.157.229): icmp_seq=1 ttl=128 time=2.87 ms 64 bytes from 58.215.157.229 (58.215.157.229): icmp_seq=2 ttl=128 time=3.21 ms 64 bytes from 58.215.157.229 (58.215.157.229): icmp_seq=3 ttl=128 time=3.36 ms 64 bytes from 58.215.157.229 (58.215.157.229): icmp_seq=4 ttl=128 time=3.14 ms
大概需要3ms,所以我們選擇阿里源
5、系統設置
5.1 備份source.list為source.list.bk
sudo mv /etc/apt/sources.list /etc/apt/sources.list.bk
5.2 編輯source.list
sudo vim /etc/apt/sources.list
將速度較快的阿里源地址拷貝,然后替換sources.list中所有內容
5.3 執行命令
sudo apt-get update sudo apt-get upgrade
