惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
腾讯CDC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
F
Full Disclosure
博客园 - 【当耐特】
C
CERT Recently Published Vulnerability Notes
Engineering at Meta
Engineering at Meta
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Threatpost
I
Intezer
V2EX - 技术
V2EX - 技术
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
小众软件
小众软件
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
N
News | PayPal Newsroom
MyScale Blog
MyScale Blog
AI
AI
Vercel News
Vercel News
Spread Privacy
Spread Privacy
美团技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
Help Net Security
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 热门话题
U
Unit 42
L
LangChain Blog
Recent Announcements
Recent Announcements

运维 on 打工人日志

Tmux 安装和使用教程 使用 ElasticSearch Curator 7天定期删除日志 在windows上安装appium 可观测性和监控的区别 systemd 守护命令 Linux crontab 命令 linux常用命令 linux基础知识 yaml 语法 iptables 基础知识 网络基础知识 linux服务基础知识 mysql基础知识 shell基础知识 运维知识图谱
GNU/Linux 一键更换系统软件源脚本
作者 · 2023-09-21 · via 运维 on 打工人日志

背景

有很多小伙伴,在接受公司老项目后,想要更新服务器源时,发现镜像源失效了,手动添加也很不方便,我这里提供了一个脚本供大家使用,轻松切换镜像源。
支持系统:

 Debian8.0 ~ 12
 Ubuntu14.04 ~ 23
 Kali Linux2.0 ~ 2023
 Red Hat Enterprise Linux7.0 ~ 9
 Fedora30 ~ 38
 CentOS7.0 ~ 8.5 / Stream 8 ~ 9
 Rocky Linux8 ~ 9
 AlmaLinux8 ~ 9
 OpenCloudOS8.6 / 9.0
 openEuler21.03 ~ 23
 openSUSELeep 15 / Tumbleweed
 Arch Linuxall

执行命令

国内使用

1bash <(curl -sSL https://www.jobcher.com/ChangeMirrors.sh)

教育网使用

1bash <(curl -sSL https://www.jobcher.com/ChangeMirrors.sh) --edu

海外使用

1bash <(curl -sSL https://www.jobcher.com/ChangeMirrors.sh) --abroad

注意事项

  1. 需使用 Root 用户执行脚本 切换命令为 sudo -isu root,不同系统环境使用的命令不一样,因为有些系统没有在初始安装时为 Root 用户设置固定密码所以需要使用 sudo 指令来提权
  2. 建议使用 SSH 远程工具 如果你使用的系统终端界面不支持 UTF-8 编码那么将无法正常显示中文内容,导致无法正确选择交互内容。大部分系统都会自动开启该服务
  3. 首次在新系统上执行脚本 当前执行方式依赖 curl 指令来获取脚本内容并执行,所以需要先通过包管理工具来安装该软件包,否则会报错 Command not found,若无法安装就复制源码到本地新建.sh脚本,然后通过 bash 手动执行

其他问题

有一部分小伙伴会出现这些问题:

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

这个配置告诉YUM,这个repository的GPG key存在于磁盘上。而当YUM在路径 /etc/pki/rpm-gpg 下找不到这个GPG key的时候,就会报如上的错误了

解决

1cd /etc/pki/rpm-gpg
2yum install wget -y
3wget https://archive.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7