-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,333
  • Did you make sure that your system is up-to-date without preexisting problems with your package manager? What happened when you ran the command indicated in the output you posted? – Nmath Oct 03 '22 at 20:21
  • 2
    Number one step is knowing what release you're on. I looked up a package from your question & came up with two possible releases, meaning I can't help. We're limited to details you provide and for best results you should provide all required detail (which for package questions your Ubuntu release is essential!) – guiverc Oct 03 '22 at 22:02
  • Check your output: Both git and build-essential were already installed. Stop trying to install them. Enjoy your success and move on. – user535733 Oct 04 '22 at 14:05

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