I am using the gcc/g++ compilers as a part of the OpenFace installation process on my Ubuntu 22.04 based system. While downloading and installing the gcc, it automatically downloads the latest g++-11 version, whereas I require g++-8 version for the software to run. How can I replace/install the g++-8 package on my system without it auto-updating to g++-11? Help would be appreciated!
Asked
Active
Viewed 3,678 times
2 Answers
2
Ubuntu 21.10 Impish Indri - End of Life July 14, 2022
Add the impish repository. Basically, you only need the universe.
sudo cat <<EOF | sudo tee /etc/apt/sources.list.d/gcc-8.list
deb http://old-releases.ubuntu.com/ubuntu/ impish main restricted universe multiverse
EOF
sudo apt update
apt-cache policy g++-8
apt-cache show g++-8
sudo apt install g++-8
Be sure to read it How to choose the default gcc and g++ version?
Johan Palych
- 1,401
1
The g++-8 package has been discontinued in the Ubuntu 22.04 and later default repositories. To install the g++-8 package from Ubuntu 21.10 in Ubuntu 22.04 run the following commands:
sudo apt update
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/g++-8_8.5.0-0ubuntu4_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/gcc-8_8.5.0-0ubuntu4_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/gcc-8-base_8.5.0-0ubuntu4_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/libgcc-8-dev_8.5.0-0ubuntu4_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/cpp-8_8.5.0-0ubuntu4_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/libmpx2_8.5.0-0ubuntu4_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/libstdc++-8-dev_8.5.0-0ubuntu4_amd64.deb
sudo apt install ./libmpx2_8.5.0-0ubuntu4_amd64.deb ./cpp-8_8.5.0-0ubuntu4_amd64.deb ./gcc-8-base_8.5.0-0ubuntu4_amd64.deb ./libgcc-8-dev_8.5.0-0ubuntu4_amd64.deb ./gcc-8_8.5.0-0ubuntu4_amd64.deb ./libstdc++-8-dev_8.5.0-0ubuntu4_amd64.deb ./g++-8_8.5.0-0ubuntu4_amd64.deb
karel
- 122,292
- 133
- 301
- 332