当前位置:首页 > VPS教程 > 正文内容

手动更换linux软件源

23vps3年前 (2022-06-13)VPS教程747

Centos换源命令

查看Centos系统版本

阿里云限量代金券 | 此广告位出租25元/月
cat /etc/system-release

备份Centos系统源

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

Centos7-阿里云源

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

Centos7-网易源

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

Centos运行以下命令生成缓存

yum clean all
yum makecache


Debian和Ubuntu换源命令

查看Debian和Ubuntu系统版本

cat /etc/issue
lsb_release -a

备份Debian或Ubuntu系统源

mv /etc/apt/sources.list /etc/apt/sources.list.backup

Debian-阿里云源

cat > /etc/apt/sources.list<<-EOF
deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
EOF

Ubuntu-阿里云源

Ubuntu_18.04

cat > /etc/apt/sources.list<<-EOF
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb 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 main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
EOF

Debian或Ubuntu运行以下命令生成缓存

apt-get update && apt-get upgrade -y


本网站由提供服务

扫描二维码推送至手机访问。

版权声明:本文由主机测评网发布,如需转载请注明出处。

本文链接:https://23vps.com/post/22.html

分享给朋友:

“手动更换linux软件源” 的相关文章

vps常用脚本和工具

这里整理了我常用的vps脚本和工具,本页已置顶会定期更新。网络测试Linux回程路由检测https://23vps.com/post/9.htmlIP可用性检测工具https://23vps.com/post/15.htmlping.pe替代品ping.sxhttps://23vps.com/pos...

一键更换Linux 软件源脚本

一键更换Linux 软件源脚本

在国内使用linux vps时遇到更新缓慢甚至软件源无效可以使用这个脚本,让你的linux vps使用更顺畅。官方网址:https://supermanito.github.io/LinuxMirrors/#/ github地址:https://github.com/SuperManito/Linu...

在windows或linux vps上生成指定大小文件命令

在linux vps上生成指定大小文件命令dd if=/dev/zero of=1GB.bin bs=1M count=1024这样就生成了一个1GB大小的文件,在服务器生成指定大小文件一般是为了测试磁盘写入性能或者当测速文件用的。在Windows vps上生...

VPS基础信息及跑分测试脚本

上次主机哥分享过一款测评脚本里其实也带跑分测试,但是主机哥发现在某些VPS跑分测不出来,于是再分享一个脚本。wget --no-check-certificate https://github.com/teddysun/across/raw/master/unixbench.sh...

锐速/BBRPLUS/BBR2一键脚本:Linux-NetSpeed

锐速/BBRPLUS/BBR2一键脚本:Linux-NetSpeed

项目地址:https://github.com/younasiqw/Linux-NetSpeed-New 原项目地址:https://github.com/ylx2016/Linux-NetSpeed/ 原作者博客:https://blog.ylx.me/archives/783...