Ubuntu – The program ‘gcc’ is not currently installed. Trying to install AMD Catalyst Driver on Ubuntu Mate 16.04

16.04amdgpuaptdpkgubuntu-mate

I am trying to update my Linux's AMD VGA driver to use AMD's proprietary Catalyst Driver, which I read is more recommended compared to the generic Linux / Mesa X11 driver http://www.cgl.ucsf.edu/chimera/graphics/updatelinux.html. My laptop still uses old Core2 P8700 processor and ATI Mobility Radeon 3670 VGA. I have downloaded the Catalyst driver from the AMD support website, extracted it and ran it's install script. But it failed, after reading the install log, it says that it Can't exec "gcc...".

So I tried $ gcc, it complained

The program 'gcc' is currently not installed. You can install it by typing:
sudo apt install gcc

I did $ sudo apt search gcc, it outputted so much lines, I couldn't even scroll up anymore to see all the results.

So I fired up Synaptics and tried searching 'gcc' there first and try have a look.

From the Synaptics 'gcc' search, I found that I have cpp, cpp-5, dpkg-dev, gcc-5-base, gcc-6-base, libgcc1, libgomp1, libquadmath0, and uno-libs3 already installed. So it already has gcc-5-base and gcc-6-base and many of the gcc libs seems, right?

So what am I missing here? Why I still can't execute $ gcc on my shell?

So what the hell is the 'gcc-5&6-base' there for? Do I still hasn't install 'gcc' or should I install 'gcc-4.7' or 'gcc-4.8' like that?

Sorry I am still learning Linux here (still mostly with Debians Linuxes). I hv been using Windows more often, because the CPU and GPU currently still runs cooler under Windows 7 for my laptop. (Ran lm-sensors on Linux and openhardwaremonitor on Windows). So I am trying to try the AMD's drivers now, to (hopefully) try to bring my Linux's temps down.

——Update for N0rbert's comment: (I ran this as you requested)

user@mate-16.04:~$ apt-cache policy gcc
gcc:
  Installed: (none)
  Candidate: 4:5.3.1-1ubuntu1
  Version table:
     4:5.3.1-1ubuntu1 500
        500 http://ph.archive.ubuntu.com/ubuntu xenial/main amd64 Packages

——Update after I ran $ sudo apt install build-essential and ran the install script:

It still fails, this is part of the log output:

Package build failed!
Package build utility output:
Cleaning in directory .
dpkg-checkbuilddeps: error: Unmet build dependencies: build-essential:native debhelper (>= 7) dh-modaliases execstack
debuild: fatal error at line 1340:
You do not appear to have all build dependencies properly met.
You can use mk-build-deps to generate a dummy package which
Depends on all the required packages, or you can install them manually using dpkg or apt using the error messages just above this message.
dpkg-buildpackage: source package fglrx-installer
dpkg-buildpackage: source version 2:8.970-0ubuntu1
dpkg-buildpackage: source distribution xenial
dpkg-buildpackage: source changed by AMD: Advanced Micro Devices. <http://ati.amd.com/support/driver.html> 
 dpkg-source --before-build fglrx.Skr0IX
dpkg-buildpackage: host architecture amd64
 debian/rules build

——Update: I solved the above dependency problem with $ sudo apt install debhelper dh-modaliases execstack. I succesfully ran the install script, the log says it succesfully generated the .deb packages for my OS. But I could not find any of them on the generated folder after doing la or ll on the folder. This is the generated $ cat /usr/share/ati/fglrx-install.log:

Package /home/user/Downloads/dpkg-deb: has been successfully generated
Package /home/user/Downloads/building has been successfully generated
Package /home/user/Downloads/package has been successfully generated
Package /home/user/Downloads/'fglrx' has been successfully generated
Package /home/user/Downloads/in has been successfully generated
Package /home/user/Downloads/fglrx_8.970-0ubuntu1_amd64.deb'. has been successfully generated
Package /home/user/Downloads/dpkg-deb: has been successfully generated
Package /home/user/Downloads/building has been successfully generated
Package /home/user/Downloads/package has been successfully generated
Package /home/user/Downloads/'fglrx-dev' has been successfully generated
Package /home/user/Downloads/in has been successfully generated
Package /home/user/Downloads/fglrx-dev_8.970-0ubuntu1_amd64.deb'. has been successfully generated
Package /home/user/Downloads/dpkg-deb: has been successfully generated
Package /home/user/Downloads/building has been successfully generated
Package /home/user/Downloads/package has been successfully generated
Package /home/user/Downloads/'fglrx-amdcccle' has been successfully generated
Package /home/user/Downloads/in has been successfully generated
Package /home/user/Downloads/fglrx-amdcccle_8.970-0ubuntu1_amd64.deb'. has been successfully generated

But I could not see any of the generated .deb packages in the ~/Downloads folder? Any idea as to why? Am I doing something wrong or not sure if the legacy AMD script is buggy?

Best Answer

The short answer to solve the problem at hand is to run

sudo apt-get update; sudo apt-get install gcc

You may also want to run sudo apt-get upgrade depending on if you have any concerns about needing to not upgrade older packages.

It seems what you're really after is to find out why you have some components such as gcc-5-base.

There really isn't any way to definitively say why you have part but not all of the gcc package. It may have been installed because it's a dependency for some other package. It may have been installed as part of gcc earlier, but then gcc itself was later uninstalled and it was left behind. Etc.

Related Question