OpenFoam安装报错:E: Unable to locate package openfoam6

报错

在使用Ubuntu18.04安装OpenFoam-6时,按照安装教程安装时(非源码编译),输入sudo apt-get -y install openfoam6时报错:

runner@ubuntu:/opt$ sudo apt-get -y install openfoam6
[sudo] password for runner: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package openfoam6

解决方案

20220906测试阿里云源可用,故使用阿里云源。

  1. 启动终端,输入:
sudo gedit /etc/apt/sources.list
  1. 在打开的文件中第一行插入下面内容,随后保存并关闭。
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

OpenFoam安装报错:E: Unable to locate package openfoam6_第1张图片
3. 输入如下命令更新缓存(第一行必须执行,第二行可以不执行),这需要花费一些时间。

sudo apt-get update
sudo apt-get upgrade
  1. 随后重新执行安装教程(非源码编译)命令即可(先前执行过的依然要执行)
sudo sh -c "wget -O - https://dl.openfoam.org/gpg.key | apt-key add -"
sudo add-apt-repository http://dl.openfoam.org/ubuntu
sudo apt-get update
sudo apt-get -y install openfoam6

安装过程中其他问题请参阅安装教程(非源码编译)

你可能感兴趣的:(OpenFoam,ubuntu,OpenFoam)