ubuntu20.04准备离线安装包

时间:2024-03-03 08:24:29

ubuntu20.04 准备离线安装包

  • 下载系统镜像[下载](https://mirror.tuna.tsinghua.edu.cn/ubuntu-releases/20.04.6/ubuntu-20.04.6-desktop-amd64.iso)
  • 安装ubuntu20.04
  • 配置网络(nano /etc/netplan/01-network-manager-all.yaml)
  • 下载离线安装包
  • 将/var/cache/apt/archives/目录下的deb包全部备份出来
  • 拷贝到离线环境中(dpkg -i *.deb)即可

在没有外网的条件下搭建测试环境,需要提前下载好必要的安装包,包括(dkms,docker等),以下是操作步骤.

下载系统镜像下载

安装ubuntu20.04

配置网络(nano /etc/netplan/01-network-manager-all.yaml)

# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager
  ethernets:
    enp3s0:
      dhcp4: no
      addresses: [192.168.1.100/24]
      gateway4: 192.168.1.254
      nameservers:
        addresses: [8.8.8.8]
sudo netplan apply

下载离线安装包

apt install --download-only net-tools vim tmux ipmitool
apt install --download-only dkms
apt install --download-only openssh-server
apt install --download-only apt-transport-https ca-certificates curl gnupg2 software-properties-common 
apt install --download-only curl
cd /var/cache/apt/archives/
dpkg -i *.deb
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt install docker-ce --download-only

将/var/cache/apt/archives/目录下的deb包全部备份出来

拷贝到离线环境中(dpkg -i *.deb)即可