Centos / Redhat 换国内源
操作步骤
先把原本的官方 yum 源 删除 或 备份
cd /etc/yum.repos.d/
备份(Redhat 同理)
mv Centos-* Centos-*.backup
删除(Redhat 同理)
rm Centos-*
下载 Centos 8 repo 文件(Redhat也可用Centos源)
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
清除yum缓存
yum clean all 或 dnf clean all
生成新的yum缓存
yum makecache 或 dnf makecache
Kali 换国内源
操作步骤
修改 sources.list 文件
sudo vim /etc/apt/sources.list
输入 i 进入编辑模式
将官方源注释掉(用 # 号)
在末尾追加国内源
随便选一个源,填上去
官方源
deb http://http.kali.org/kali kali-rolling main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contrib中科大
deb http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
deb-src http://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib阿里云
deb http://mirrors.aliyun.com/kali kali-rolling main non-free contrib
deb-src http://mirrors.aliyun.com/kali kali-rolling main non-free contrib清华大学
deb http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling main contrib non-free浙大
deb http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free
deb-src http://mirrors.zju.edu.cn/kali kali-rolling main contrib non-free东软大学
deb http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib
deb-src http://mirrors.neusoft.edu.cn/kali kali-rolling/main non-free contrib重庆大学
deb http://http.kali.org/kali kali-rolling main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contrib
输入完后按 esc 键输入 :wq 保存并退出
清除原来的缓存包
sudo apt-get clean // 删除缓存包
并生成新的缓存
sudo apt-get update // 更新索引
sudo apt-get upgrade // 更新包
sudo apt-get dist-upgrade // 更新包(智能解决依赖)