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

手动更换linux软件源

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

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

苹果手机ssh工具

苹果手机ssh工具

苹果手机上的ssh工具:Terminal & SSH可以去App Store搜索下载...

linux vps如何查看网关

linux vps如何查看网关

我们在使用dd脚本来给vps网络重装系统之前,为了防止无法通过dhcp自动获取网关,首先记录下网关地址,这样等dd完后至少还能进vnc修改网关地址。linux vps可以查看网关命令:netstat -rn如果提示“-bash: netstat: command not found”,这仅...

VPS跑分网络IO测试脚本

VPS跑分网络IO测试脚本

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

linux vps连接工具putty

linux vps连接工具putty

putty 简介简单的说 putty 是一个开源程序,用来连接服务器。最早的时候,仅仅在window系统上可以使用,后来在其他的系统上也可以运行,比如 类unix, mac 。putty 不仅仅是一个软件而是一个软件集(文章最后会列出这个软件集),其中最常用的是 putty ,用来连接 linxu...

ping.pe替代品ping.sx

ping.pe替代品ping.sx

近日主机哥发现用于检测小鸡网络的ping.pe已经没有国内检测节点了(只剩一个腾讯云节点了),对于检测国内连通性来说已经不够用了,有个替代网站就是https://ping.sx/网站截图:...

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

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