Skip to content

Instantly share code, notes, and snippets.

@aqzlpm11
Last active July 19, 2018 09:38
Show Gist options
  • Save aqzlpm11/90144320cc3e3c83d9878a9ef7039e0e to your computer and use it in GitHub Desktop.
Save aqzlpm11/90144320cc3e3c83d9878a9ef7039e0e to your computer and use it in GitHub Desktop.
tuna-scripts
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-5.2.0-Linux-x86_64.sh
sh Anaconda3-5.2.0-Linux-x86_64.sh
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
# Linux
mkdir -p ~/.config/pip/
echo "[global]" >> ~/.config/pip/pip.conf
echo "index-url = https://pypi.tuna.tsinghua.edu.cn/simple" >> ~/.config/pip/pip.conf
# WINDOWS cmd
mkdir %APPDATA%\pip
echo [global] >> %APPDATA%\pip\pip.conf
echo index-url = https://pypi.tuna.tsinghua.edu.cn/simple >> %APPDATA%\pip\pip.conf
#!/bin/bash
backup_file=/etc/apt/sources.list.backup
if [ ! -f "$backup_file" ]; then
echo "# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释" >> tmp.f
echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse" >> tmp.f
echo "# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial main restricted universe multiverse" >> tmp.f
echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse" >> tmp.f
echo "# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-updates main restricted universe multiverse" >> tmp.f
echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse" >> tmp.f
echo "# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-backports main restricted universe multiverse" >> tmp.f
echo "deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse" >> tmp.f
echo "# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-security main restricted universe multiverse" >> tmp.f
echo "" >> tmp.f
echo "# 预发布软件源,不建议启用" >> tmp.f
echo "# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse" >> tmp.f
echo "# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ xenial-proposed main restricted universe multiverse" >> tmp.f
sudo mv /etc/apt/sources.list $backup_file
sudo mv tmp.f /etc/apt/sources.list
echo "Success!"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment