debian 镜像源
时间: 2023-08-09 22:08:17 浏览: 265
树莓派4b/ubuntu镜像源
5星 · 资源好评率100%
Debian镜像源是用于在Debian操作系统中下载软件包和更新的服务器。根据提供的引用内容,可以看出你想要配置阿里云的Debian镜像源。首先,你需要创建软链接来指向阿里云的镜像站点。具体的命令是:[1]
```
ln -s /var/spool/apt-mirror/mirror/mirrors.aliyun.com/debian /var/www/html/debian
ln -s /var/spool/apt-mirror/mirror/mirrors.aliyun.com/debian-security /var/www/html/debian-security
```
接下来,你需要编辑apt-mirror的配置文件,添加阿里云镜像站的地址和指定CPU架构的设置。你可以在打开的文档中添加以下内容:[2]
```
# 指定CPU架构,默认的话会下载跟本机相同的架构的源
set defaultarch amd64
# deb 配置的是拖库的目标地址 ,选择的是阿里云镜像站。默认的下载地址是 /var/spool/apt-mirror/mirror/
deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
deb http://mirrors.aliyun.com/debian-security/ buster/updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian-security/ buster/updates main non-free contrib
```
然后,你可以运行`sudo apt-mirror`命令来开始下载镜像源。[3]
如果在更新时出现缺少i18n文件夹下的文件的提示,你可以使用wget命令下载缺失的文件。具体的命令如下:[3]
```
wget -r -np -erobots=off -c -nH http://mirrors.aliyun.com/debian/dists/buster-backports/main/i18n/ -P /var/spool/apt-mirror/mirror/mirrors.aliyun.com/
wget -r -np -erobots=off -c -nH http://mirrors.aliyun.com/debian/dists/buster-backports/contrib/i18n/ -P /var/spool/apt-mirror/mirror/mirrors.aliyun.com/
wget -r -np -erobots=off -c -nH http://mirrors.aliyun.com/debian/dists/buster-backports/non-free/i18n/ -P /var/spool/apt-mirror/mirror/mirrors.aliyun.com/
wget -r -np -erobots=off -c -nH http://mirrors.aliyun.com/debian-security/dists/buster/updates/main/i18n/ -P /var/spool/apt-mirror/mirror/mirrors.aliyun.com/
wget -r -np -erobots=off -c -nH http://mirrors.aliyun.com/debian-security/dists/buster/updates/non-free/i18n/ -P /var/spool/apt-mirror/mirror/mirrors.aliyun.com/
```
这样,你就成功配置了阿里云的Debian镜像源。
阅读全文