Cannot install build-essential

I was trying to install gevent via pip3, however I it failed and was unable to find arm-linux-gnueabihf-gcc. I searched online and found that I needed to install a few python-dev packages. However after installing them, the same error was thrown up, I researched a little more and found out that the package I was missing all the C compilers, so tried installing build-essentials then build-essential package. But the same error was thrown up: The package could not be found, I tried stretch and sid repositories with the same effect, even tried the raspbian source (I know not recommended) but to no avail. I could manually install download and install each package but that would be a big pain because of the extreeeeeeeeeemely long list of dependencies. Someone please help.

All the grabbed logs: http://paste.osmc.io/megopocema

Did you sudo apt-get update first?

I feel like replying meanly but I won’t.

I did.

I’m not sure why you would feel like that… We have no idea what your competence level of these procedures might be. There are hundreds of thousands of tutorials that anyone can (and I assure you, they do) follow blindly.

deb http://ftp.debian.org/debian jessie main contrib non-free

deb http://ftp.debian.org/debian/ jessie-updates main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib non-free

deb http://apt.osmc.tv jessie main


osmc@Vero4Ktesting:~$ sudo apt-get install build-essential
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  binutils bzip2 cpp cpp-4.9 dpkg-dev g++ g++-4.9 gcc gcc-4.9 libasan1 libatomic1 libc-dev-bin libc6-dev libcloog-isl4 libdpkg-perl
  libgcc-4.9-dev libgdbm3 libgomp1 libisl10 libmpc3 libmpfr4 libstdc++-4.9-dev libtimedate-perl libubsan0 linux-libc-dev make patch
  perl perl-modules xz-utils
Suggested packages:
  binutils-doc bzip2-doc cpp-doc gcc-4.9-locales debian-keyring gcc-4.9-doc libstdc++6-4.9-dbg gcc-multilib manpages-dev autoconf
  automake libtool flex bison gdb gcc-doc libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan1-dbg liblsan0-dbg libtsan0-dbg
  libubsan0-dbg libcilkrts5-dbg libquadmath-dbg glibc-doc libstdc++-4.9-doc make-doc ed diffutils-doc perl-doc
  libterm-readline-gnu-perl libterm-readline-perl-perl libb-lint-perl libcpanplus-dist-build-perl libcpanplus-perl
  libfile-checktree-perl liblog-message-simple-perl liblog-message-perl libobject-accessor-perl
Recommended packages:
  fakeroot libalgorithm-merge-perl libfile-fcntllock-perl rename libarchive-extract-perl libmodule-pluggable-perl libpod-latex-perl
  libterm-ui-perl libtext-soundex-perl libcgi-pm-perl libmodule-build-perl libpackage-constants-perl
The following NEW packages will be installed:
  binutils build-essential bzip2 cpp cpp-4.9 dpkg-dev g++ g++-4.9 gcc gcc-4.9 libasan1 libatomic1 libc-dev-bin libc6-dev
  libcloog-isl4 libdpkg-perl libgcc-4.9-dev libgdbm3 libgomp1 libisl10 libmpc3 libmpfr4 libstdc++-4.9-dev libtimedate-perl libubsan0
  linux-libc-dev make patch perl perl-modules xz-utils
0 upgraded, 31 newly installed, 0 to remove and 0 not upgraded.
Need to get 37.8 MB of archives.
After this operation, 121 MB of additional disk space will be used.
Do you want to continue? [Y/n]

Don’t use stretch or sid repos or you’ll run in to problems for sure.

sudo apt-get install build-essential is all you need.

Your log shows that build-essential and the packages the metapackage itself brings in are not present. Your APT history.log doesn’t show an attempt to install it. What’s the actual output of running this command?

I also notice you’re using zsh. That can (and does) mangle PATH; so try running the commands in a standard shell

Your system has a lot of non-standard packages, such as Mono, MinGW (!?) and cross-gcc-dev. dpkg is also (or at least was previously) in a broken state when you tried to purge Mono.

I felt like replying meanly because I had tried so many things and I definitely updated apt-get umpteen times, anyway, I digress.

Thsi the output of my sources.list file:
deb Index of /debian jessie main contrib non-free

deb http://ftp.debian.org/debian/ jessie-updates main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib non-free

deb http://apt.osmc.tv/ jessie main

#deb http://ftp.debian.org/debian/ stretch main contrib non-free
#deb http://ftp.debian.org/debian/ sid main contrib non-free

Sources.list.d

#mono-xamarin.list

deb http://download.mono-project.com/repo/debian wheezy main

And output of sudo apt-get update && sudo apt-get -y install build-essential:

osmc@BedroomRasPi:~$ sudo apt-get update && sudo apt-get -y install build-essential
Hit http://download.mono-project.com wheezy InRelease
Ign http://ftp.debian.org jessie InRelease
Hit http://security.debian.org jessie/updates InRelease
Hit http://ftp.debian.org jessie-updates InRelease
Hit http://ftp.debian.org jessie Release.gpg
Hit http://apt.osmc.tv jessie InRelease
Hit http://ftp.debian.org jessie Release
Get:1 http://ftp.debian.org jessie-updates/main armhf Packages/DiffIndex [7,408 B]
Hit http://security.debian.org jessie/updates/non-free armhf Packages
Hit http://ftp.debian.org jessie-updates/contrib armhf Packages
Hit http://download.mono-project.com wheezy/main armhf Packages
Get:2 http://ftp.debian.org jessie-updates/non-free armhf Packages/DiffIndex [736 B]
Get:3 http://apt.osmc.tv jessie/main armhf Packages/DiffIndex [2,023 B]
Hit http://security.debian.org jessie/updates/main Translation-en
Hit http://ftp.debian.org jessie-updates/contrib Translation-en
Hit http://security.debian.org jessie/updates/non-free Translation-en
Get:4 http://ftp.debian.org jessie-updates/main Translation-en/DiffIndex [2,704 B]
Hit http://security.debian.org jessie/updates/main armhf Packages
Get:5 http://ftp.debian.org jessie-updates/non-free Translation-en/DiffIndex [736 B]
Hit http://security.debian.org jessie/updates/contrib armhf Packages
Hit http://ftp.debian.org jessie/main armhf Packages
Hit http://security.debian.org jessie/updates/contrib Translation-en
Hit http://ftp.debian.org jessie/contrib armhf Packages
Hit http://ftp.debian.org jessie/non-free armhf Packages
Hit http://ftp.debian.org jessie/contrib Translation-en
Hit http://ftp.debian.org jessie/main Translation-en
Hit http://ftp.debian.org jessie/non-free Translation-en
Ign http://apt.osmc.tv jessie/main Translation-en_IN
Ign http://apt.osmc.tv jessie/main Translation-en
Ign http://download.mono-project.com wheezy/main Translation-en_IN
Ign http://download.mono-project.com wheezy/main Translation-en
Fetched 13.6 kB in 20s (667 B/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package build-essential is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'build-essential' has no installation candidate

I was using zsh, changed the shell back to bash, fancy theme and auto-completion is not worth the effort.
I installed mono on purpose, mingw was a mistake, was looking for packages containing arm-linux-gnueabihf-gcc the thing that was missing while installing gevent.

apt-cache search build-essential

If that returns nothing, then:

  • you have a connectivity issue preventing proper updating
  • or dpkg / apt is in a bad state

You seem to have installed a lot of packages.
build-essential installs for me on OSMC here, so I’d suggest a reinstall. Also check that your SD card is OK.

You don’t want arm-linux-gnueabihf-gcc, as you’re not doing cross if you’re building on the target

Not productive. Remember @actiona is helping you in his own free time. You do not have to take his help or advice.

Sorry for being so rude, it was just I was having too much trouble making it work.

I have tried this already but to no avail and I do not have any connectivity issues, most other packages install fine.

You don’t mention the output.

All I can suggest is a reinstallation. If you can replicate this on a fresh OSMC install, I’ll take a further look.

Output:
osmc@BedroomRasPi:~$ apt-cache search build-essential osmc@BedroomRasPi:~$ sudo apt-cache search build-essential

This definitely isn’t a card problem because I recently bought a new card.
This post.

That doesn’t rule out a card problem, but I agree that it’s not likely.

sudo rm /var/lib/apt/lists/*
sudo apt-get update

Could also be a proxy, so for good measure before running above, run:

sudo sed 's/ftp.debian.org/ftp.uk.debian.org/' -i /etc/apt/sources.list

Otherwise just reinstall: it’s not broken on a fresh install of OSMC.

No difference

I’ve checked for proxy errors, tried multiple proxies.

Will do so tomorrow, tried enough for today, its 10pm here.