Ubuntuのデフォルトソースを国内ソースに変更

5744 ワード

Ubuntuをインストールすると、海外ソースを使うのが遅すぎて、国内ソースに変更するのがずっと速くなります.

1、修正プロセス


1.1バックアップ


バックアップ/etc/apt/sources.List、コマンドは次のとおりです.
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak

1.2 Ubuntuのソースリストの変更

/etc/apt/sources.listファイルの下のリストを変更します.特に、これらのリストは現在のUbuntuシステムのバージョンと関係があり、異なるバージョンでは異なる構成が使用されています.例:

1.2.1公式中国Ubuntu 18.04更新源

deb http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

1.2.2公式中国Ubuntu 16.04更新ソース

deb http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
## 
deb http://cn.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse


#  
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
## 
deb-src http://cn.archive.ubuntu.com/ubuntu/ xenial-proposed main restricted universe multiverse


# Canonical  
deb http://archive.canonical.com/ubuntu/ xenial partner
deb http://extras.ubuntu.com/ubuntu/ xenial main

1.3最後に更新元コマンドを実行する


更新元コマンドは次のとおりです.
sudo apt-get update
sudo apt-get upgrade

2、国内で有名なUbuntuミラーサイト


公式中国http://cn.archive.ubuntu.com/ubuntu/次のいずれかのサーバに置き換えます.
  • 阿里雲http://mirrors.aliyun.com/ubuntu/Ubuntu 18.04更新元は以下の通り:
  • 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
    
  • 網易http://mirrors.163.com/ubuntu/Ubuntu 18.04更新元は以下の通り:
  • deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
    deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
    deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
    deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
    deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
    deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
    deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
    
  • 捜狐http://mirrors.sohu.com/ubuntu/

  • 教育ネットワーク
  • 中科大https://mirrors.ustc.edu.cn/ubuntu/(v4/v6) http://mirrors4.ustc.edu.cn/ubuntu/(v4) http://mirrors6.ustc.edu.cn/ubuntu/(v6)
  • 中科院OpenCAShttp://mirrors.opencas.cn/ubuntu/
  • 清華http://mirrors.tuna.tsinghua.edu.cn/ubuntu/(v4/v6) http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu/(v4) http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu/(v6)
  • 上海交通大学http://ftp.sjtu.edu.cn/ubuntu/(v4/v6) http://ftp6.sjtu.edu.cn/ubuntu/(v6)

  • 3、参考資料

  • Ubuntu 16.04 source http://wiki.ubuntu.org.cn/テンプレート:16.04 source
  • Ubuntu 18.04デフォルトソースを国内ソースに変更https://www.linuxidc.com/Linux/2018-08/153709.htm