Ubuntu – Can’t install libqt4-dev on Focal – “Package not available” despite appearing in launchpad

aptdependenciespackage-managementrepositorysoftware installation

I'm trying to get Geant4 up and running, and one of the required dependencies is to have libqt4-dev. Despite the fact that it appears in launchpad (link), I keep on getting the following error:

  • Package libqt4-dev 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 'libqt4-dev' has no installation candidate
    

I've tried sudo apt-get update and sudo apt-get upgrade, as well as following a few similar threads from 2017, but nothing has worked yet. I was able to install other libraries such as libx11-dev or libxerces-c-dev, so I don't think its a repository issue. Any ideas?

Best Answer

You need to add the repository by running the following command:

sudo add-apt-repository ppa:rock-core/qt4