linux ubuntu domestic apt source domestic conda source domestic pip source domestic mirror acceleration linux accelerates the installation of various software [pro-test available] [solution]

Cause

Linux environments often install various software, various python software, various machine learning components, and the direct default source installation method is very slow, and some can’t even be downloaded. I found a lot of information on the Internet, and many methods of adding domestic sources are out of date. , Here is a way to add a best practice source. The following method is effective under the linux ubuntu18.04 environment

Add apt domestic mirror source

apt-get apt source domestic mirror permanent addition method:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo vi /etc/apt/sources.list

 Fill in the following:

#添加阿里源
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse

If you cannot edit the above files, you can create the source.list file in other authorized folders, and then:

sudo cp path/to/source.list /etc/apt/sources.list

Add conda domestic mirror source

vi ~/.condarc
填如下内容:
ssl_verify: true
show_channel_urls: true

channels:
  - http://mirrors.ustc.edu.cn/anaconda/pkgs/main/
  - http://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  - http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - defaults

Note that the above domestic source address is not https 

 

After configuration, you can use the following command to view the configured information

conda config --show-sources

Add pip domestic mirror source

mkdir -p $HOME/.config/pip/
vi $HOME/.config/pip/pip.conf
填如下内容:
[global]
timeout = 6000
index-url = http://pypi.mirrors.ustc.edu.cn/simple/
extra-index-url = https://pypi.mirrors.ustc.edu.cn/simple/
		http://pypi.douban.com/simple/
		https://pypi.tuna.tsinghua.edu.cn/simple/
		https://mirrors.aliyun.com/pypi/simple/
trusted-host = pypi.mirrors.ustc.edu.cn
		pypi.mirrors.ustc.edu.cn
		pypi.douban.com
		pypi.tuna.tsinghua.edu.cn
		mirrors.aliyun.com

The specific configuration success effect is as follows

 

 

 

Guess you like

Origin blog.csdn.net/jrckkyy/article/details/114242769