Modify the software default source to Tencent source

Background: When building a software environment, you need to download the installation files first. Many software default sources are abroad, and the download speed is slow. In order to improve deployment efficiency, we often need to modify the software default source to be the Chinese source first. In addition, **if the server is Tencent Cloud Yes, the source can also use Tencent's intranet domain name, which is faster (note that the URL of Tencent's intranet domain name, please use http, use https is not accessible, external domain names http and https can be used) **, see the official website documentation for details :

https://cloud.tencent.com/document/product/213/8623

Common pip, maven, npm, docker, mariadb, rubygems, etc. have configuration instructions on this document. In addition, here are some common software source configuration/modification methods or supplements:

1、pypi (python pip) configure domestic source##

**Please refer to **https://cloud.tencent.com/developer/article/1601851

2、 go environment configuration, download the installation file

The domain name golang.google.cn is resolved to the country, and the URL https://golang.google.cn/dl/ is faster to download

3、 composer source configuration

Change the source to China (choose 1 from n)

If the server is Tencent Cloud, the source can also replace the public domain name with Tencent intranet domain name, which is faster

composer config -g repos.packagist composer http://mirrors.cloud.tencent.com/composer/

composer config -g repo.packagist composer http://pkg.phpcomposer.com/

composer config -g repos.packagist composer http://php.cnpkg.org/

composer config -g repos.packagist composer http://mirrors.aliyun.com/composer/

Reference https://cloud.tencent.com/developer/article/1598544

4、**maven source **configuration##

If the server is Tencent Cloud, the source can also replace the public domain name with Tencent intranet domain name, which is faster

Reference http://mirrors.tencent.com/help/maven.html

Visit http://mirrors.tencent.com/ and search for "View" on the right side of the maven point. The accessed file is http://mirrors.tencent.com/help/maven.html

In the middle of the document, I emphasized it again: Please use http for the URL of Tencent's intranet domain name. It cannot be accessed using https. The external domain name http and https are ok, mirrors.cloud.tencent.com or mirrors.tencent.com can

5、npmsourceconfiguration

Setting method

Run the following command

npm config set registry http://mirrors.tencent.com/npm/

If the server is Tencent Cloud, the source can also replace the public domain name with Tencent intranet domain name, which is faster

6、 Restore the default mirror source

**cd /tmp && wget -q http://mirrors.tencentyun.com/install/softinst.sh && chmod +x softinst.sh && ./softinst.sh **

Currently, the public mirrors on the live network (except the public mirrors that have been eliminated and offline) are supported as shown in the following figure. The support is not complete, and needs to be more comprehensive. The requirements have been raised and need to be evaluated

7、 MongoDBSource##

If the server is Tencent Cloud, the source can also replace the public domain name with Tencent intranet domain name, which is faster

Visit http://mirrors.tencent.com/ to search mongodb and click "View" on the right. The accessed file is http://mirrors.tencent.com/help/mongodb.html. This document is not as fine as that of Tsinghua Yuan. Optimization requirements have been mentioned and need to be evaluated

Tsinghua source document: http://mirror.tuna.tsinghua.edu.cn/help/mongodb/

8、 Nginx and php have no Tencent sources yet, the requirements have been mentioned, pending evaluation##

linux php:http://mirrors.sohu.com/php/

windows php:https://windows.php.net/downloads/releases/archives/

http://mirrors.sohu.com/nginx/

Install Nginx (centos6 needs to replace the version in baseurl to 6, centos8 to 8, but you need to comment the [AppStream] module in /etc/yum.repos.d/CentOS-Base.repo, and then uncomment it after installation )

Execute the following command to create the nginx.repo file under /etc/yum.repos.d/

vi /etc/yum.repos.d/nginx.repo

Press "i" to switch to edit mode and write the following.

[nginx]

name=nginx repo

baseurl=https://nginx.org/packages/mainline/centos/7/$basearch/

gpgcheck=0

enabled=1

Press "Esc", enter ":wq!", save the file and return.

Execute the following command to install Nginx.

yum install nginx

9、 mysql source##

If the server is Tencent Cloud, the source can also replace the public domain name with Tencent intranet domain name, which is faster

http://mirrors.tencent.com/mysql/yum/

Install mysql referencehttps://cloud.tencent.com/developer/article/1625458

Replace the download address of the .noarch.rpm file with the Tencent address

10、 mariadb source##

http://mirrors.tencent.com/mariadb/yum/

If the server is Tencent Cloud, the source can also replace the public domain name with Tencent intranet domain name, which is faster

vim /etc/yum.repos.d/mariadb.repo
Add the following
[ mariadb]
name = MariaDB
** baseurl = http://mirrors.tencent.com/mariadb/yum/10.4/centos7-amd64/**
gpgkey=http://mirrors.tencent.com/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1

Installation: yum install -y mariadb-server mariadb-client

Add startup items and start services
systemctl enable mariadb
systemctl start mariadb

The focus is baseurl, according to your own system version and required mariadb version from http://mirrors.tencent.com/mariadb/yum/

**If you want to use the official source of mariadb, choose the appropriate url from **http://yum.mariadb.org/ (the official source of mariadb is from abroad, it’s slower to visit in China, but Tencent source can Configure intranet domain name, faster)

In addition, you need to be reminded that the password is empty after mariadb is installed, and the command to set the password is "mysqladmin -uroot -p password password" and press Enter twice.

11、 apache source##

http://mirrors.tencent.com/apache/

When downloading wget, use this source faster. If the server is Tencent Cloud, the source can also replace the public domain name with Tencent's intranet domain name, which is faster

12、 centos source##

http://mirrors.tencent.com/centos/

If the server is Tencent Cloud, the source can also replace the public domain name with Tencent intranet domain name, which is faster

①Back up the old configuration files of the system

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

②Enter the folder where the yum source configuration file is located

[ root@linux ~]# cd /etc/yum.repos.d/

③Download the yum source configuration file of mirrors.cloud.tencent.com to the above folder

CentOS5

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos5_base.repo

CentOS6

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos6_base.repo

CentOS7

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos7_base.repo

CentOS8

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.cloud.tencent.com/repo/centos8_base.repo

④Update the cache

yum clean all
yum makecache
yum -y update pkgname

13、 gnu source##

http://mirrors.tencent.com/gnu/

When downloading wget, use this source faster. If the server is Tencent Cloud, the source can also replace the public domain name with Tencent's intranet domain name, which is faster

14、 For other sources, please visit http://mirrors.tencent.com/ to view the software source list. If there is no source you want, you can leave a message and we will internally evaluate whether it is new

Recommended Posts

Modify the software default source to Tencent source
How to modify software source in Ubuntu 7.10
Ubuntu modified the default sh to bash
How to modify the hostname on CentOS 8
How to modify the hostname on Ubuntu 20.04
Wsl sets the default account to root (ubuntu18.04)
How to modify the CentOS server time to Beijing time
Modify the default encoding of mysql5.6 under CentOS7
Centos7 modify the system language to simplified Chinese
Modify the default root password of the Ubuntu operating system
Ubuntu update software source
CentOS 5 to CentOS 5.8 YUM source
How to set or modify the time zone on Ubuntu 20.04
Find the kernel source code corresponding to the running Ubuntu version
How to set or modify the time zone on Ubuntu 20.04
How to set or modify the time zone in CentOS 8