# 拉镜像和建立容器 docker pull ubuntu docker run --name=WRF_byp -it -v C:\Byp\Mount:/home/mount --entrypoint=/bin/bash ubuntu:latest # 查看系统版本 root@bc719a5a1370:/home/mount/WRF# cat /etc/issue Ubuntu 20.04.3 LTS \n \l # 检查是否安装编译语言 which gfortran which cpp which gcc 如果在命令行输入以上命令没反应,说明未装 # 一定要先升级apt-get(Ubuntu系统安装软件命令) apt-get update # 升级成功后安装 apt-get install gfortran gcc cpp g++ make 安装后提示出错: E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/m/mpfr4/libmpfr6_4.0.2-1_amd64.deb Connection failed [IP: 91.189.91.39 80] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? 尝试: root@bc719a5a1370:/home/mount/WRF# apt-get update --fix-missing Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB] Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB] Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB] Fetched 336 kB in 4s (76.7 kB/s) Reading package lists... Done # 再一次安装 apt-get install gfortran gcc cpp g++ make 成功! # 检查是否安装成功 gcc --version gfortran --version cpp --version # 安装g++ apt-get install g++ 提示已经有了: Reading package lists... Done Building dependency tree Reading state information... Done g++ is already the newest version (4:9.3.0-1ubuntu2). 0 upgraded, 0 newly installed, 0 to remove and 45 not upgraded. mkdir ~/WRF_WorkStation mkdir ~/WRF_WorkStation/Libraries mkdir ~/WRF_WorkStation/netcdf mkdir ~/WRF_WorkStation/grib2 mkdir ~/WRF_WorkStation/mpich mkdir ~/WRF_WorkStation/test