FEniCS legacy installation on Ubuntu 23.04

Dear All,
Due to the latest problems in using ufl on the legacy version, I did uninstall the FEniCS; however, I am not able to reinstall it due to the following error:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 dolfin-bin : Depends: python3-dolfin (>= 2019.2.0~legacy20230609.8b85e9d.ar-2~ppa1~lunar1) but 2019.2.0~git20230116.bd54183-1 is to be installed
 dolfin-doc : Depends: libdolfin-dev (>= 2019.2.0~legacy20230609.8b85e9d.ar-2~ppa1~lunar1) but 2019.2.0~git20230116.bd54183-1 is to be installed
              Depends: python3-dolfin (>= 2019.2.0~legacy20230609.8b85e9d.ar-2~ppa1~lunar1) but 2019.2.0~git20230116.bd54183-1 is to be installed
              Recommends: python3-matplotlib but it is not going to be installed
 python3-ufl : Breaks: python3-dolfin (< 2019.2.0~legacy~) but 2019.2.0~git20230116.bd54183-1 is to be installed
E: Unable to correct problems, you have held broken packages.

Your help would be highly appreciated.

There’s a new set of library dependencies, so

sudo apt-get dist-upgrade

might help sort it out.

Thanks for your response.
I’m following exactly what #egomezp did (please refer to his post) by running Fenics on a Macbook Pro M2 Chip. I’m using UTM with Ubuntu Jammy 22.04. I’m following this 4 commands given in the tutorial:

sudo add-apt-repository ppa:fenics-packages/fenics
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install fenics

The following error message appears:

Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Package fenics is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package ‘fenics’ has no installation candidate

Any help would be highly appreciated.

I can reproduce issues with lunar (ubuntu 23.04). Looks like some more packages need to be rebuilt. I’m not sure what the issue is exactly. You’ll probably have easier success with jammy (22.04). The Long-Term-Releases (LTS) tend to be more stable. I’ll write again when lunar is validated.

Thanks for your suggestion, but the installation did not work for the recommended Ubuntu version.
I followed the below commands first:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

And then the usual commands for installing the FEniCS:

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:fenics-packages/fenics
sudo apt-get update
sudo apt-get install fenics

Still, I got the following error message after the last above command:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package fenics is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package &apos;fenics&apos; has no installation candidate</pre>

Should I try installing from the source?

Thanks

You mean rebuild the deb package from debian source using dpkg-buildpackage? That is always possible. But pip install will not help, it will make things worse since it will break the management of compatible versions.

Ubuntu lunar (23.04) is now installing successfully from the PPA (mshr is updated).

Many thanks for your help and response. I did try to install it from source based on the instruction after installing Cmake and Pybind11.
https://fenics.readthedocs.io/en/latest/installation.html
However the following command is making errors:

git clone --branch=$FENICS_VERSION https://bitbucket.org/fenics-project/mshr

Error

fatal: Remote branch 2019.1.0.post0 not found in upstream origin

Your help would be highly appreciated.

I can only help with the Debian (ubuntu) packaging. Try the update/upgrade cycle again with Ubuntu 23.04

I tried the update/upgrade cycle with Ubuntu 23.04 as you. requested, however, get the following error:

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 dolfin-bin : Depends: python3-dolfin (>= 2019.2.0~legacy20230609.8b85e9d.ar-2~ppa1~lunar1) but 2019.2.0~git20230116.bd54183-1 is to be installed
 dolfin-doc : Depends: libdolfin-dev (>= 2019.2.0~legacy20230609.8b85e9d.ar-2~ppa1~lunar1) but 2019.2.0~git20230116.bd54183-1 is to be installed
              Depends: python3-dolfin (>= 2019.2.0~legacy20230609.8b85e9d.ar-2~ppa1~lunar1) but 2019.2.0~git20230116.bd54183-1 is to be installed
              Recommends: python3-matplotlib but it is not going to be installed
 python3-mshr : Depends: libmshr-dev (>= 2019.2.0~git20200924.c27eb18+dfsg1-8~fenics1~lunar1) but it is not going to be installed
 python3-ufl : Breaks: python3-dolfin (< 2019.2.0~legacy~) but 2019.2.0~git20230116.bd54183-1 is to be installed
E: Unable to correct problems, you have held broken packages.```
I am using the following system:

OS: Ubuntu 23.04 aarch64
Host: QEMU Virtual Machine virt-8.0
Kernel: 6.2.0-26-generic
Shell: bash 5.2.15

Thanks again for your consideration.

I think this must be the the problem, specifically aarch64. You’ve got an arm64 system (ARM processor), but the PPA only builds packages for amd64 (x86_64 i.e. 64-bit Intel processors).

In that case you may be better off using debian testing rather than ubuntu. Debian testing gets the same packages that I provide for debian and the PPA, built on all supported architectures.

A simpler alternative is to just use the ubuntu native packages and not use the PPA. i.e. skip the add-apt-repository step. Old versions of fenics are already built for all ubuntu releases (including 23.04 lunar) on amd64 arm64 armhf ppc64el riscv64 and s390x architectures, see https://launchpad.net/ubuntu/+source/dolfin . The new legacy packages have been built for the future ubuntu release mantic (23.10).

If the fenics package itself is missing at any point, then work around that by installing the python3-dolfin and python3-mshr packages explicitly.

1 Like