linux系统搭建本地yum源-debian

下载debian的dvd版本iso镜像文件

参考下载地址:

1
https://cdimage.debian.org/cdimage/archive/

上传下载好的镜像并挂载

注意:
下面的挂载重启系统后需要重新挂载,可以考虑将挂载添加到/etc/fstab文件当中

1
2
3
4
mount -t iso9660 -o loop debian-9.13.0-amd64-DVD-1.iso /media/cdrom1
mount -t iso9660 -o loop debian-9.13.0-amd64-DVD-2.iso /media/cdrom2
mount -t iso9660 -o loop debian-9.13.0-amd64-DVD-3.iso /media/cdrom3

添加/etc/apt/sources.list文件

1
2
3
4
5
6
7
cat > /etc/apt/sources.list <<EOF
deb [ trusted=yes ] file:/media/cdrom1/ stretch main contrib
deb [ trusted=yes ] file:/media/cdrom2/ stretch main contrib
deb [ trusted=yes ] file:/media/cdrom3/ stretch main contrib


EOF

更新并安装软件

1
2
apt update
apt install vim