Linuxシステム国内ミラーサイト
4054 ワード
一、交換説明
最初のバックアップはcentos、mv/etc/yumなどです.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS-Base.repo.backup第2ステップ置換、例えばcentos 7置換網yumソース、wget-O/etc/yumを実行する.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo#centos 7第3ステップcentosなどの新しいキャッシュを生成し、yum clean all&&yum makecacheを実行
二、常用システム交換スクリプト
https://mirrors.aliyun.com/epel/http://mirrors.aliyun.com/repo/
centos 7/rhel 7、アリ雲yumソースおよびepelソースの更新
#!/bin/sh
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# or curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache
centos 8/rhel 8、アリ雲yumソースおよびepelソースの更新
#!/bin/sh
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
# or curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
wget https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
rpm -ivh epel-release-latest-8.noarch.rpm
rm -f epel-release-latest-8.noarch.rpm
yum clean all
yum makecache
ubuntu18.04(bionic)、aptソースをアリクラウドソースに交換
#!/bin/sh
mv /etc/apt/sources.list /etc/apt/sources.list.bak
echo "\
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src 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-backports main restricted universe multiverse
">/etc/apt/sources.list
apt-get update
# apt-get update -y
ubuntu16.04、aptソースをアリクラウドソースに変更
#!/bin/sh
mv /etc/apt/sources.list /etc/apt/sources.list.bak
echo "\
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
">/etc/apt/sources.list
apt-get update
# apt-get update -y
三、国内の主要ミラーサイト
3.1阿里雲https://developer.aliyun.com/mirror3.2網易http://mirrors.163.com/3.3捜狐http://mirrors.sohu.com/3.4テンセントhttps://mirrors.cloud.tencent.com/3.5中国科大学http://mirrors.ustc.edu.cn/3.6清華大学https://mirrors.tuna.tsinghua.edu.cn/3.7華中科大学http://mirror.hust.edu.cn/3.8重慶大学http://mirrors.cqu.edu.cn/