I am trying to use "sudo apt-get install build-essential" but it gives an 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: build-essential : Depends: libc6-dev but it is not going to be installed or libc-dev Depends: gcc (>= 4:7.2) but it is not going to be installed Depends: g++ (>= 4:7.2) but it is not going to be installed Depends: dpkg-dev (>= 1.17.11) but it is not going to be installed E: Unable to correct problems, you have held broken packages.
So I tried to install the dependent packages (libc6-dev) etc but it ends up with
The following packages have unmet dependencies: libc6-dev : Depends: libc6 (= 2.27-3ubuntu1) but 2.27-3ubuntu1.2 is to be installed E: Unable to correct problems, you have held broken packages.
So I try to install libc6
Reading package lists... Done Building dependency tree
Reading state information... Done libc6 is already the newest version (2.27-3ubuntu1.2). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
When I use aptitude instead
The following NEW packages will be installed: build-essential dpkg-dev{ab} fakeroot{a} g++{a} g++-7{ab} gcc{a} gcc-7{ab} libalgorithm-diff-perl{a} libalgorithm-diff-xs-perl{a} libalgorithm-merge-perl{a} libasan4{ab} libatomic1{ab} libc-dev-bin{a} libc6-dev{ab} libcilkrts5{ab} libfakeroot{a} libgcc-7-dev{ab} libitm1{ab} liblsan0{ab} libmpx2{ab} libquadmath0{ab} libstdc++-7-dev{ab} libtsan0{ab} libubsan0{ab} linux-libc-dev{a} manpages-dev{a} 0 packages upgraded, 26 newly installed, 0 to remove and 0 not upgraded. Need to get 26.6 MB of archives. After unpacking 116 MB will be used. The following packages have unmet dependencies: libgcc-7-dev : Depends: gcc-7-base (= 7.3.0-16ubuntu3) but 7.5.0-3ubuntu1~18.04 is installed libmpx2 : Depends: gcc-8-base (= 8-20180414-1ubuntu2) but 8.4.0-1ubuntu1~18.04 is installed libc6-dev : Depends: libc6 (= 2.27-3ubuntu1) but 2.27-3ubuntu1.2 is installed libitm1 : Depends: gcc-8-base (= 8-20180414-1ubuntu2) but 8.4.0-1ubuntu1~18.04 is installed libcilkrts5 : Depends: gcc-7-base (= 7.3.0-16ubuntu3) but 7.5.0-3ubuntu1~18.04 is installed libasan4 : Depends: gcc-7-base (= 7.3.0-16ubuntu3) but 7.5.0-3ubuntu1~18.04 is installed libquadmath0 : Depends: gcc-8-base (= 8-20180414-1ubuntu2) but 8.4.0-1ubuntu1~18.04 is installed libstdc++-7-dev : Depends: gcc-7-base (= 7.3.0-16ubuntu3) but 7.5.0-3ubuntu1~18.04 is installed libtsan0 : Depends: gcc-8-base (= 8-20180414-1ubuntu2) but 8.4.0-1ubuntu1~18.04 is installed libubsan0 : Depends: gcc-7-base (= 7.3.0-16ubuntu3) but 7.5.0-3ubuntu1~18.04 is installed g++-7 : Depends: gcc-7-base (= 7.3.0-16ubuntu3) but 7.5.0-3ubuntu1~18.04 is installed gcc-7 : Depends: cpp-7 (= 7.3.0-16ubuntu3) but 7.5.0-3ubuntu1~18.04 is installed Depends: gcc-7-base (= 7.3.0-16ubuntu3) but 7.5.0-3ubuntu1~18.04 is installed liblsan0 : Depends: gcc-8-base (= 8-20180414-1ubuntu2) but 8.4.0-1ubuntu1~18.04 is installed libatomic1 : Depends: gcc-8-base (= 8-20180414-1ubuntu2) but 8.4.0-1ubuntu1~18.04 is installed dpkg-dev : Depends: libdpkg-perl (= 1.19.0.5ubuntu2) but 1.19.0.5ubuntu2.3 is installed The following actions will resolve these dependencies: Keep the following packages at their current version:
-
build-essential [Not Installed]
-
dpkg-dev [Not Installed]
-
g++ [Not Installed]
-
g++-7 [Not Installed]
-
gcc [Not Installed]
-
gcc-7 [Not Installed]
-
libasan4 [Not Installed]
-
libatomic1 [Not Installed]
-
libc6-dev [Not Installed]
-
libcilkrts5 [Not Installed]
-
libgcc-7-dev [Not Installed]
-
libitm1 [Not Installed]
-
liblsan0 [Not Installed]
-
libmpx2 [Not Installed]
-
libquadmath0 [Not Installed]
-
libstdc++-7-dev [Not Installed]
-
libtsan0 [Not Installed]
-
libubsan0 [Not Installed]
Accepting the solution gives:
No packages will be installed, upgraded, or removed. 0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B of archives. After unpacking 0 B will be used.
Any help will be greatly appreciated