平常开发、装软件,难免会遇到翻墙、下载速度慢各种问题,现在统一整理出各种场景的加速方法,欢迎使用

  1. curl -s https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | sudo apt-key add -
  2. sudo tee /etc/apt/sources.list.d/kubernetes.list <<-'EOF'
  3. deb https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial main
  4. EOF
  5. sudo apt update
  1. cat <<EOF > /etc/yum.repos.d/kubernetes.repo
  2. [kubernetes]
  3. name=Kubernetes
  4. baseurl=http://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
  5. enabled=1
  6. gpgcheck=0
  7. repo_gpgcheck=0
  8. gpgkey=http://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg
  9. http://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
  10. EOF

/etc/apt/sources.list

  1. deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
  2. deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
  3. deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
  4. deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
  5. deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
  6. deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
  7. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
  8. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
  9. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
  10. deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
  1. deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
  2. deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
  3. deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
  4. deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
  5. deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
  6. deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
  7. deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
  8. deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
  9. deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
  10. deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
  1. wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
  1. wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
  1. echo "https://mirrors.aliyun.com/alpine/v3.8/main/" > /etc/apk/repositories
  2. echo "https://mirrors.aliyun.com/alpine/v3.8/community/" >> /etc/apk/repositories
  3. apk update
  1. echo "https://mirrors.aliyun.com/alpine/v3.9/main/" > /etc/apk/repositories
  2. echo "https://mirrors.aliyun.com/alpine/v3.9/community/" >> /etc/apk/repositories
  3. apk update
  1. make -p /etc/docker
  2. echo '{"registry-mirrors":["https://pee6w651.mirror.aliyuncs.com"]}' > /etc/docker/daemon.json
  1. # Enable the go modules feature
  2. export GO111MODULE=on
  3. # qiniuyun
  4. export GOPROXY=https://goproxy.cn
  5. # Set the GOPROXY environment variable
  6. export GOPROXY=https://goproxy.io
  7. # aliyun云
  8. export GOPROXY=https://mirrors.aliyun.com/goproxy/
  1. #使用阿里云镜像源加速
  2. composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
  3. #取消配置
  4. composer config -g --unset repos.packagist
  1. # 永久
  2. npm config set registry https://registry.npm.taobao.org
  3. # 临时
  4. npm --registry https://registry.npm.taobao.org install express
  1. mkdir -p /root/.pip
  2. echo -e "[global]\nindex-url = http://mirrors.aliyun.com/pypi/simple/\n[install]\ntrusted-host=mirrors.aliyun.com\n" > /root/.pip/pip.conf

/usr/local/apache-maven-3.3.9/conf/settings.xml

  1. <mirrors>
  2. <mirror>
  3. <id>alimaven</id>
  4. <name>aliyun maven</name>
  5. <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
  6. <mirrorOf>central</mirrorOf>
  7. </mirror>
  8. </mirrors>

版权声明:本文为chenqionghe原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/chenqionghe/p/11475328.html