1、挂载iso镜像到/mnt目录下
mount -t iso9660 -o loop /root/ubuntu-16.04.7-server-amd64.iso /mnt
2、修改系统本身的apt-get源
cp /etc/apt/sources.list /etc/apt/sources.list.bak echo deb file:///mnt xenial main restricted > /etc/apt/sources.list
xenial是ubuntu16.04的代号,常见版本代号:
22.04: jammy 20.04: focal 18.04: bionic 16.04: xenial 14.04: trusty
3、更新源索引
apt-get update
转载请注明:零五宝典 » Ubuntu配置光盘ISO为本地apt-get源