0

I am trying to install libfreetype6-dev.

Running sudo apt-get install libfreetype6-dev gives

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: libfreetype6-dev : Depends: libfreetype-dev (= 2.10.1-2ubuntu0.1) but it is not going to be installed E: Unable to correct problems, you have held broken packages.

I tried forcing the version, as mentioned here, and added fix-broken and f flags, but it still fails to install.

Ceres
  • 109
  • The package is available libfreetype6-dev | 2.10.1-2ubuntu0.1 | focal-updates | amd64, arm64, armhf, i386, ppc64el, riscv64, s390x so sudo apt update & read the messages to ensure you don't have errors/warnings or missing lines in that output... – guiverc Oct 24 '21 at 13:44
  • Turns out I had to force install the correct dependencies instead of force installing the package itself. It works now – Ceres Oct 24 '21 at 13:49

1 Answers1

0

As the error says, libfreetype-dev needs to be installed as a dependency, trying to install it raised the error

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: libfreetype-dev : Depends: libfreetype6 (= 2.10.1-2ubuntu0.1) but 2.10.1-2ubuntu0.20.04ppa1 is to be installed E: Unable to correct problems, you have held broken packages.

So I had to force install libfreetype6=2.10.1-2ubuntu0.1 with
sudo apt get-install libfreetype6=2.10.1-2ubuntu0.1,
after that I could install libfreetype-dev, and then libfreetype6-dev with
sudo apt-get install libfreetype-dev
sudo apt-get install libfreetype6-dev.

Ceres
  • 109
  • Thanks for leaving your answer up despite the downvote. It helped me! I still have some sid packages remaining from some ill-advised package installations some months ago, and downgrading fixed it for me. – jcomeau_ictx Oct 07 '23 at 02:07