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

手动更换linux软件源

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

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软件源” 的相关文章

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

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

linux vps禁用ipv6方法

有些vps会同时存在ipv4和ipv6,如果我们不想用ipv6可以禁用ipv6地址。此方法在debian10和CentOS7下测试可用!用nano或vi命令编辑配置文件nano /etc/sysctl.conf在末尾添加如下两行:net.ipv6.conf.all.disable_ipv6...

linux vps服务器运行python程序时提示python: command not found解决方法

给vps dd完debian10系统在运行python程序的时候提示这个错误root@srv1634123456:~# python client-linux.py -bash: python: command not found解决办法...

测试linux vps基础信息io和网络:SuperBench

测试linux vps基础信息io和网络:SuperBench

可测试linux vps基础信息io及网络,第一次运行需等待半分钟左右wget -qO- --no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbenc...

VPS跑分网络IO测试脚本

VPS跑分网络IO测试脚本

主机哥做测评时发现一个测试VPS跑分、网络及IO的脚本,测得的数据还是比较准确的。项目地址:https://github.com/masonr/yet-another-bench-script脚本使用:curl -sL yabs.sh | bash如果提示没有...