0

I am trying to install gcc-8 g++-8 on my Ubunutu 20.04 but I cannot as shown below. Any advice?

sudo apt install gcc-8 g++-8
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'clang-8-doc' for regex 'g++-8'
Note, selecting 'python-clang-8' for regex 'g++-8'
Note, selecting 'clang-8' for regex 'g++-8'
Note, selecting 'clang-8-examples' for regex 'g++-8'
Note, selecting 'libclang-8-dev' for regex 'g++-8'
E: Unable to locate package gcc-8
karel
  • 114,770
Tak
  • 976
  • 3
  • 15
  • 34

1 Answers1

0

There are 2 ways to accomplish this:

  • Install GCC and G++ using by doing:
sudo add-apt-repository universe 
sudo apt update 
sudo apt install gcc g++
  • You can do it with dpkg if it doesn't work:
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-8/gcc-8_8.4.0-3ubuntu2_amd64.deb
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gcc-8/g++-8_8.4.0-3ubuntu2_amd64.deb
sudo dpkg -i g++-8_8.4.0-3ubuntu2_amd64.deb gcc-8_8.4.0-3ubuntu2_amd64.deb
sudo apt --fix-missing install
Rishon_JR
  • 1,013