0

I want to install g++ in my Ubuntu 20.04 by typing in the terminal sudo apt-get install g++ but it tells me this:

Some packages cannot be installed. 
This can mean that an impossible situation was requested or, 
if you are using a development distribution, which some packages
required have not yet been created or have been removed from Incoming. 
The following information can help resolve the situation:

The following packages have unmet dependencies: g++: It depends: g++-9 (> = 9.3.0-3 ~) but it is not going to be installed E: Unable to fix problems, there are bad packages blocked".

What can I do to fix these issues ?

karel
  • 114,770

1 Answers1

0

aptitude is more aggressive than apt-get about resolving package dependencies. aptitude remembers which packages were explicitly requested and which packages were only installed due to dependencies. It will automatically uninstall packages which were not explicitly requested when they are no longer needed.

Install aptitude with sudo apt install aptitude, run sudo apt install g++ and follow the suggestions for resolving the unmet dependencies that aptitude provides.

karel
  • 114,770