ANSYS 2023 终于官方支持了 Ubuntu 20.04 LTS 版本,因此将安装过程记录如下。
安装Ubuntu 20.04 LTS并切换源
安装一个桌面环境(对于 Ubuntu Server)
给要安装的机器连接键盘鼠标显示器并登录管理员,不要远程安装
sudo apt install build-essential firefox \
libbsd0 libc6 libexpat1 libfontconfig1 libfreetype6 libglib2.0-0 libice6 \
libpcre3 libpng16-16 libsm6 libuuid1 libx11-6 libx11-xcb1 libxau6 libxcb-icccm4 \
libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-render0 \
libxcb-shape0 libxcb-shm0 libxcb-sync1 libxcb-util1 libxcb-xfixes0 \
libxcb-xinerama0 libxcb-xkb1 libxcb1 libxdmcp6 libxext6 libxft2 \
libxkbcommon-x11-0 libxkbcommon0 libxrender1 debianutils gzip libasound2 \
libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libavahi-client3 libavahi-common3 \
libblkid1 libcairo-gobject2 libcairo2 libcom-err2 libcups2 libdatrie1 \
libdbus-1-3 libdrm2 libepoxy0 libffi7 libfribidi0 libgbm1 libgcc-s1 libgcrypt20 \
libgdk-pixbuf2.0-0 libgmp10 libgnutls30 libgpg-error0 libgraphite2-3 \
libgssapi-krb5-2 libgtk-3-0 libharfbuzz0b libhogweed5 libidn2-0 libjpeg62 \
libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 liblz4-1 liblzma5 libmount1 \
libnettle7 libnspr4 libnss3 libp11-kit0 libpango-1.0-0 libpangocairo-1.0-0 \
libpangoft2-1.0-0 libpcre2-8-0 libpixman-1-0 libselinux1 libsqlite3-0 \
libsystemd0 libtasn1-6 libthai0 libunistring2 libwayland-client0 \
libwayland-cursor0 libwayland-egl1 libwayland-server0 libxcb-dri3-0 \
libxcomposite1 libxcursor1 libxdamage1 libxfixes3 libxi6 libxinerama1 \
libxrandr2 libxss1 libxtst6 lsb-core tar xfonts-100dpi xfonts-75dpi libbrotli1 \
libbz2-1.0 libcurl4-gnutls-dev libegl1 libelf1 libenchant-2-2 libgfortran5 \
libgl1 libglu1-mesa libglvnd0 libglx0 libgomp1 libgstreamer-gl1.0-0 \
libgstreamer-plugins-base1.0-0 libgstreamer1.0-0 libgudev-1.0-0 \
libharfbuzz-icu0 libhyphen0 libibverbs1 libicu66 libjavascriptcoregtk-4.0-18 \
libjbig0 libjpeg-turbo8 libltdl7 libnotify4 libopengl0 libopenjp2-7 \
liborc-0.4-0 libpcre3-dev libpsl5 libquadmath0 libseccomp2 libsecret-1-0 \
libsoup2.4-1 libtiff5 libudev1 libwebkit2gtk-4.0-37 libwebp6 libwebpdemux2 \
libwoff1 libxm4 libxml2 libxmu6 libxslt1.1 libxt6 uuid-dev libcrypt1 \
libperl-dev libxshmfence1 libxxf86vm1 libasn1-8-heimdal libembree3-3 \
libfontenc1 libgssapi3-heimdal libhcrypto4-heimdal libheimbase1-heimdal \
libheimntlm0-heimdal libhx509-5-heimdal libkrb5-26-heimdal libldap-2.4-2 \
libpam0g libpci3 libroken18-heimdal libsasl2-2 libtbb2 libwind0-heimdal \
ocl-icd-opencl-dev libcurl4 libnghttp2-14 librtmp1 libssh-4 libgtk2.0-0 \
libsdl1.2debian libxv1 coinor-libipopt1v5 libdrm-amdgpu1 libmumps-dev libnuma1 \
libpng-dev libqhull-dev libspooles-dev libtiff-dev libtinfo5 xterm libfabric1 \
libapparmor1 libasyncns0 libflac8 libogg0 libpulse-mainloop-glib0 libpulse0 \
libsndfile1 libvorbis0a libvorbisenc2 libwrap0
挂载镜像,按照说明安装及激活即可。
sudo mount -o loop <ANSYS_ISO> /mnt
sudo /mnt/INSTALL
其中,<ANSYS_ISO>
为光盘镜像路径。
如果存在双网卡,一个连接内网,一个连接外网,则有可能默认网关在内网上,导致无法连接外部网络。 例如网卡如下, ens1f0固定IP连接内网,ens1f1动态IP连接外网。
$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens1f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether ************** brd ff:ff:ff:ff:ff:ff
inet 10.10.81.9/24 brd 10.10.81.255 scope global ens1f0
valid_lft forever preferred_lft forever
inet6 fe80::d250:99ff:fed2:96d1/64 scope link
valid_lft forever preferred_lft forever
3: ens1f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether ************** brd ff:ff:ff:ff:ff:ff
inet 192.168.1.101/24 brd 192.168.1.255 scope global ens1f1
valid_lft forever preferred_lft forever
inet6 fe80::d250:99ff:fed2:96d2/64 scope link
valid_lft forever preferred_lft forever
则将/etc/netplan/00-installer-config.yaml
中,ens1f0
下的gateway4
删除即可。如果ens1f1
也是固定IP,则需要在ens1f1
下补充默认网关gateway4
。
创建service文件
sudo touch /etc/systemd/system/ansys_lic.service
sudo chmod 664 /etc/systemd/system/ansys_lic.service
sudo vim /etc/systemd/system/ansys_lic.service
填入以下内容
[Unit]
Description=Start ANSYS License Server
After=network.target multi-user.target
[Service]
ExecStart=/ansys_inc/shared_files/licensing/start_ansysli
ExecStop=/ansys_inc/shared_files/licensing/stop_ansysli
Type=simple
[Install]
WantedBy=default.target
启动服务
sudo systemctl daemon-reload
sudo systemctl start ansys_lic.service
sudo systemctl enable ansys_lic.service