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

手动更换linux软件源

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

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

微软开发的手机远程桌面工具:RD Client

简介Microsoft Remote Desktop是微软官方发布的RDP远程桌面控制工具,方便在手机上控制电脑或服务器。有了这款神器,就可以在手机上控制windows vps服务器了!RD Client安卓客户端下载地址:https://m.pc6.com/mipd/103772.html或者可以...

linux vps没有wget命令解决

linux vps没有wget命令会提示:-bash: wget: command not foundlinux vps解决没有wget命令的方法:debian系统apt-get -y update apt-get instal...

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...

Debian9/10/11下磁盘挂载及开机启动设置教程

检查磁盘空间即剩余情况本文是在实际使用过程中真实操作,用于交流和学习1. 使用fdisk -l命令查看当前磁盘的大小,其中/dev/sda磁盘发现并未使用;使用时,需要切换到root权限   其中,系统默认磁盘是在/dev/sdb1上root@****# fdisk&n...

测试linux vps基础信息io和网络:Bench.sh

测试linux vps基础信息io和网络:Bench.sh

秋水逸冰大佬的写的Bench.sh脚本,主机哥之前分享的测试脚本大多不支持在国内网络下测试,这款脚本是支持国内VPS里测试的。特点显示当前测试的各种系统信息;取自世界多处的知名数据中心的测试点,下载测试比较全面;支持 IPv6 下载测速;IO 测试三次,并显示平均值。使用:wget -qO...