Summary of mirror source configuration in common Linux distribution

  • 2021-07-24 12:04:43
  • OfStack

Recently, I studied Linux and tried a few Linux releases, but most of the releases didn't have very good software source speed. So I simply do a collection here, I used some commonly used distribution of software source settings to do a summary, we can also do a reference.

Ubuntu 18.04

18.04 is the latest long-term support version of Ubuntu. Of course, I am very much looking forward to the long-term support version of 20.04 released in April, and supporting wireguard is very attractive.


#  Back up the official image 
cp /etc/apt/sources.list /etc/apt/sources.list.backup

#  Using Tsinghua Image Source 
tee /etc/apt/sources.list <<EOL
#  Source mirroring is annotated by default to improve  apt update  Speed, if necessary, you can cancel the annotation by yourself 
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
EOL

openSUSE tumbleweed

openSUSE tumbleweed is a rolling update of openSUSE, which is recommended if you like to try the latest software. There are some font rendering problems with manjaro, so now I've found the scrolling release of openSUSE, which feels good except that the package manager is one point slower than pacman. Of course, it is best to close the official mirror source in yast management program, otherwise he will download from the official mirror source by default.


#  Add Tsinghua Image Source 
zypper addrepo -f https://mirrors.tuna.tsinghua.edu.cn/opensuse/tumbleweed/repo/oss/ tsinghua_oss
zypper addrepo -f https://mirrors.tuna.tsinghua.edu.cn/opensuse/tumbleweed/repo/non-oss/ tsinghua_nonoss

Arch

Arch is a very popular rolling release with new software sources and highly customizable features. Of course, because the customization is too high, I have to install my own desktop, so I don't need Arch in the end. However, the Arch in the virtual machine is really easy to use, does not install a graphical interface, starts quickly and updates quickly, and can also experience the latest software.


#  Add Tsinghua Image Source and Netease Image Source 
sed -i '1i Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch' /etc/pacman.d/mirrorlist
sed -i '2i Server = https://mirrors.163.com/archlinux/$repo/os/$arch' /etc/pacman.d/mirrorlist

Manjaro

Manjaro is a derivative distribution based on Arch, which not only has the advantages of Arch, but also adds a pre-configured graphical interface, so that users can easily get a desktop version of Linux out of the box as using Ubuntu. The disadvantage is that it is too radical with Arch1. If the dual system is installed, it will take a long time to update the system, and it is easy to have a pile of software packages that conflict and fail to update. Manjaro comes with a mirror source configuration tool, so we don't need to edit the configuration file manually, and simply call the tool to set the mirror source to China.


pacman-mirrors -c China

Fedora

Fedora Default GNOME Desktop I felt ugly, so I finally gave up. However, Fedora as a distribution is OK, although it is a fixed version of the release, but the software update speed is also very fast. New kernels, software and the like will be available soon. This point is not much different from the rolling release. What is listed here is the configuration method of Fedora 28 and later versions. Please refer to the configuration instructions of Tsinghua official mirror source for the configuration of the old version.


#  Back up the old configuration 
cp /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/fedora.repo.backup
cp /etc/yum.repos.d/fedora-updates.repo /etc/yum.repos.d/fedora-updates.repo.backup

#  Using Tsinghua Image Source 
tee /etc/yum.repos.d/fedora.repo <<EOL
[fedora]
name=Fedora \$releasever - \$basearch
failovermethod=priority
baseurl=https://mirrors.tuna.tsinghua.edu.cn/fedora/releases/\$releasever/Everything/\$basearch/os/
metadata_expire=28d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-\$releasever-\$basearch
skip_if_unavailable=False
EOL

tee /etc/yum.repos.d/fedora-updates.repo <<EOL
[updates]
name=Fedora \$releasever - \$basearch - Updates
failovermethod=priority
baseurl=https://mirrors.tuna.tsinghua.edu.cn/fedora/updates/\$releasever/Everything/\$basearch/
enabled=1
gpgcheck=1
metadata_expire=6h
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-\$releasever-\$basearch
skip_if_unavailable=False
EOL


Related articles: