title: Ubuntu 18.10 - how to install a specific version of gcc
body: <p>Disclaimer: I have searched and read similar posts and they do not answer my question.</p>
  
  <p>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.</p>
  
  <p>I have tried</p>
  
  <pre><code>sudo apt-get update
  sudo apt-get install gcc:8.2.0
  </code></pre>
  
  <p>but I get the error message that the package could not be found.</p>
  
  <p>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.</p>
  
  <p>I located gcc 8.2.0 <a href="https://packages.ubuntu.com/cosmic/gcc" rel="nofollow noreferrer">here</a> as part of the core for Cosmic (18.10) but I am unsure how to install it.</p>
  
  <p>I also tried:</p>
  
  <pre><code>sudo apt-get install gcc=4:8.2.0-1ubuntu1 --no-upgrade
  </code></pre>
  
  <p>and it still wants to install 8.3.  Do I need to change the defaults for this to work?  It completely ignores the --no-upgrade option.</p>