1.上传镜像文件
2.创建挂载点
root@server01:~# mkdir /opt/debian.list
3.挂载镜像文件
root@server01:~# mount -o loop ubuntu-20.04.2-live-server-amd64.iso /opt/debian.list/
mount: /opt/debian.list: WARNING: device write-protected, mounted read-only.
4.更改apt源路径为本地路径
root@server01:~# cp /etc/apt/sources.list /etc/apt/sources.list.bak 先备份
root@server01:/# vim /etc/apt/sources.list
注释掉网络源
root@server01:/# apt-cdrom -m -d=/opt/debian.list add 添加本地源
root@server01:/# apt clean 清除缓存
root@server01:/# apt-get update 更新源
root@server01:/# apt-get upgrade
apt-get install build-essential 测试