Disclaimer: I have searched and read similar posts and they do not answer my question. Moving this post from SO where it was a skosh off topic.
I am running Ubuntu 18.10 and need to install gcc 8.2.0 to build kernel modules. apt-get wants to install 8.3 which doesn't match how my kernel was built.
I have tried
sudo apt-get update
sudo apt-get install gcc:8.2.0
but I get the error message that the package could not be found.
I tried going the route of installing 8.3 and then building 8.2.0 and installing it into /usr/local/bin. It worked for a few modules but when I tried building kernel modules for VMWare it complained that the package was not installed correctly. I am a CentOS guy so a little out of my element on debian based distros.
I located gcc 8.2.0 here as part of the core for Cosmic (18.10) and downloaded it. apt still complained when I tried to install it, saying it needed to install 8.3.
I also tried:
sudo apt-get install gcc=4:8.2.0-1ubuntu1 --no-upgrade
and it still wants to install 8.3. There must be a way to do this but I cannot figure out how.
Output of "apt policy":
sudo apt policy gcc gcc-8
apt policy gcc gcc-8
gcc:
Installed: 4:8.3.0-1ubuntu1.1
Candidate: 4:8.3.0-1ubuntu1.1
Version table:
*** 4:8.3.0-1ubuntu1.1 500
500 http://us.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 Packages
100 /var/lib/dpkg/status
4:8.2.0-1ubuntu1 500
500 http://mirrors.kernel.org/ubuntu cosmic/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu cosmic/main amd64 Packages
gcc-8:
Installed: 8.3.0-6ubuntu1~18.10
Candidate: 8.3.0-6ubuntu1~18.10
Version table:
*** 8.3.0-6ubuntu1~18.10 500
500 http://us.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 Packages
100 /var/lib/dpkg/status
8.2.0-7ubuntu1 500
500 http://mirrors.kernel.org/ubuntu cosmic/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu cosmic/main amd64 Packages
What does the output mean? I see 8.2 listed in the available packages.
sudo apt install gcc-8
.apt policy gcc gcc-8
=
instead of:
and using actual version string, i.e.sudo apt-get install gcc=8.2.0-7ubuntu1
?