-1
sudo apt-get install build-essential git cmake flex bison libelf-dev libusb-dev libhidapi-dev libftdi1-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
build-essential is already the newest version (12.9ubuntu3).
build-essential set to manually installed.
git is already the newest version (1:2.34.1-1ubuntu1.4).
git set to manually installed.
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 bison : Depends: m4
 cmake : Depends: libjsoncpp25 (>= 1.9.5) but it is not going to be installed
         Depends: librhash0 (>= 1.2.6) but it is not going to be installed
         Depends: cmake-data (= 3.22.1-1ubuntu1.22.04.1) but it is not going to be installed
 flex : Depends: m4
        Recommends: libfl-dev but it is not going to be installed
 libfaudio0 : Depends: libsdl2-2.0-0 (>= 2.0.16) but it is not going to be installed
 libftdi1-dev : Depends: libusb-1.0-0-dev but it is not going to be installed
                Recommends: libftdi1-doc but it is not going to be installed
 libhidapi-dev : Depends: libhidapi-libusb0 (= 0.11.2-1) but it is not going to be installed
                 Depends: libhidapi-hidraw0 (= 0.11.2-1) but it is not going to be installed
 libusb-dev : Depends: libusb-0.1-4 (= 2:0.1.12-32build3) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Nmath
  • 12,664
Julie Powers
  • 1
  • 1
  • 1

1 Answers1

1

The error usually happened after you installed a package from third-party repository, such as an Ubuntu PPA. Then, you removed that PPA. But, the packages you're going to install require another version of the package that you installed from that PPA.

The point is to find out which package or which PPA cause the conflict. Then, install the correct version of that package (using Synaptic Package Manager for example), or add back the PPA and purge it which will downgrade all installed packages to stock versions:

sudo apt install ppa-purge && sudo ppa-purge ppa:maintainer-id/ppa-name

In the case, I'll try the command mentioned in the output first: sudo apt --fix-broken install, or use sudo aptitude install build-essential git cmake flex bison ... to see if it could help.

Or, use apt command to try installing every packages in the output that you provided:

sudo apt install libjsoncpp25
sudo apt install cmake-data
sudo apt install libsdl2-2.0-0
...
...

Until it tells me something like:Depends: key-package (=x.x.x) but anther version (x.x.x) is already installed. And, finally switch the key-package version either via command below or by Synaptic package manager.:

sudo apt install key-package=x.x.x