The apt.kitware.com for at least focal is broken currently, looks like cmake-data 2.24.0 is premature and missing. Using focal-rc works with 2.24.0~rc5 so it is specific to the “stable” version of the repository.
sudo apt install cmake
Reading package lists... Done
Building dependency tree
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:
cmake : Depends: cmake-data (= 3.23.2-0kitware1ubuntu20.04.1) but 3.24.0-0kitware1ubuntu20.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.
Our build server is currently in the process of building CMake for several architectures and Ubuntu versions. Sometimes the
cmake-data package becomes available before the
cmake package, because
cmake-data has the
all architecture, so it only needs to be built once, whereas the
cmake package needs to be built for every architecture. Please be patient - the rest of the packages should be available later today.
Could the build server be setup to not publish until all the artifacts are ready? This breaks any automated builds which pull cmake packages.
The same problem has happened again (
cmake : Depends: cmake-data (= 3.24.0-0kitware1ubuntu20.04.1) but 3.24.1-0kitware1ubuntu20.04.1 is to be installed). It looks like the
cmake package requires an unspecified version of
cmake-data, hence getting its latest version instead of the matching one.
I worked around this by installing
cmake-data beforehand while stating the same version, e.g.
export CMAKE_VERSION=3.24.0-0kitware1ubuntu20.04.1 && apt-get -y install --no-install-recommends cmake-data=$CMAKE_VERSION cmake=$CMAKE_VERSION.