1. 打开终端,输入以下命令以备份原来的 sources.list 文件:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2. 编辑 sources.list 文件:
sudo nano /etc/apt/sources.list
3. 将原来的内容全部删除,然后将以下内容复制到文件中:
#国内阿里源
deb http://mirrors.aliyun.com/debian/ bullseye main non-free contrib deb-src http://mirrors.aliyun.com/debian/ bullseye main non-free contrib deb http://mirrors.aliyun.com/debian-security bullseye-security main non-free contrib deb-src http://mirrors.aliyun.com/debian-security bullseye-security main non-free contrib deb http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib deb-src http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib deb http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib deb-src http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
#国内清华源
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free # 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换 deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
4. 保存并退出编辑器,然后更新软件包列表:
sudo apt update
5. 安装软件包:
sudo apt upgrade
6. 安装完成后,您的 Debian 11 系统将使用阿里云镜像源。
7.使用IPv6代理访问Github,运行如下代码:
cat >> /etc/hosts << EOF
# https://danwin1210.de/github-ipv6-proxy.php
2a01:4f8:c010:d56::2 github.com
2a01:4f8:c010:d56::3 api.github.com
2a01:4f8:c010:d56::4 codeload.github.com
2a01:4f8:c010:d56::5 objects.githubusercontent.com
2a01:4f8:c010:d56::6 ghcr.io
2a01:4f8:c010:d56::7 pkg.github.com npm.pkg.github.com maven.pkg.github.com nuget.pkg.github.com rubygems.pkg.github.com
EOF
文章转载自:https://www.itxm.cn/post/ijade1a9.html
文章评论