VPS使用教程之CentOS/Ubuntu/Debian依赖源配置教程

2021年3月30日20:54:10 发表评论 652

VPS使用教程之CentOS/Ubuntu/Debian依赖源配置教程云服务器怎么样?云服务器值不值得购买?云服务器好不好?

VPS使用教程之CentOS/Ubuntu/Debian依赖源配置教程

本篇文章仅以配置阿里云源为例,如需配置其他源可将地址替换为其它源,如清华:mirrors.tuna.tsinghua.edu.cn

一、CentOS 7 yum源

rm -rf /etc/yum.repos.d/*.repo #删除repo文件,或者自己备份  curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo  curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo  yum makecache #更新缓存

二、CentOS 6 yum源

rm -rf /etc/yum.repos.d/*.repo #删除repo文件,或者自己备份  curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo  curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo  yum makecache #更新缓存

三、Ubuntu 18 apt源

mv /etc/apt/sources.list{,bak} #备份sources.list  cat > /etc/apt/sources.list << EOF  deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse  deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse    deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse  deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse    deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse  deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse    deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse  deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse    deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse  deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse  EOF  apt update

四、Ubuntu 16 apt源

mv /etc/apt/sources.list{,bak} #备份sources.list  cat > /etc/apt/sources.list << EOF  deb http://mirrors.aliyun.com/ubuntu/ xenial main  deb-src http://mirrors.aliyun.com/ubuntu/ xenial main    deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main  deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main    deb http://mirrors.aliyun.com/ubuntu/ xenial universe  deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe  deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe  deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe    deb http://mirrors.aliyun.com/ubuntu/ xenial-security main  deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main  deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe  deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe  EOF  apt update

五、Debian 9 apt源

mv /etc/apt/sources.list{,bak} #备份sources.list  cat > /etc/apt/sources.list << EOF  deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib  deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib  deb http://mirrors.aliyun.com/debian-security stretch/updates main  deb-src http://mirrors.aliyun.com/debian-security stretch/updates main  deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib  deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib  deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib  deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib  EOF  apt update

六、Debian 8 apt源

mv /etc/apt/sources.list{,bak} #备份sources.list  cat > /etc/apt/sources.list << EOF  deb http://mirrors.aliyun.com/debian/ jessie main non-free contrib  deb http://mirrors.aliyun.com/debian/ jessie-proposed-updates main non-free contrib  deb-src http://mirrors.aliyun.com/debian/ jessie main non-free contrib  deb-src http://mirrors.aliyun.com/debian/ jessie-proposed-updates main non-free contrib  EOF  apt update

VPS使用教程之CentOS/Ubuntu/Debian依赖源配置教程

来源链接:https://www.vpssz.com/

本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。

郑重声明:VPS主机评测仅提供资料收集及VPS云主机信息推介,不提供任何VPS云主机及代购业务!