3

I am trying to install OpenFace toolkit on my system using Ubuntu 20.04 Terminal. The installation requires gcc/g++ version 8 for installation. I checked the current gcc version on my system, and it shows that the installed version is gcc-11. Is there a way of replacing the gcc-11 version with gcc-8, or of downloading the gcc-8 package, and then installing it? help would be appreciated, thanks.

karel
  • 114,770
  • No. This is a X-Y problem. – ChanganAuto Jul 20 '22 at 11:52
  • 1
    If you need to run legacy software, the recommended approach is to use containers or VM's with an older OS (to isolated vulnerabilities and minimize impact of dependency issues). – Artur Meinild Jul 20 '22 at 13:30
  • 1
    Also, the files for OpenFace toolkit are at least 3 years old. Again, if you install unmaintained software, be prepared to do a little legwork yourself if you want to run it on a current system. – Artur Meinild Jul 20 '22 at 13:34
  • @ChanganAuto can you please specify – UTSAV PANDYA Jul 21 '22 at 05:50
  • @UTSAVPANDYA Artur Meinild already did it. – ChanganAuto Jul 21 '22 at 05:53
  • @ArturMeinild i tried pretty much everything i could, but am not getting anywhere. Also, I am not from computer/software background so you can assume i'm a total newbie in terms of Ubuntu/Linux, neither do I want to dig too deep in the field. So it would be a huge help if you can point to exactly what should I do. Thanks! – UTSAV PANDYA Jul 21 '22 at 05:56
  • @karel thanks for the suggestion, but I already tried it and it still gives the same problem. I think the issue is not that my package isn't updating--its the opposite: it is getting updated to the newest version which isn't supported by the software that i'm trying to install. – UTSAV PANDYA Jul 21 '22 at 06:00
  • In that case I can answer your question. All you need to do is to run this one-line command: sudo apt update && sudo apt remove gcc-11 && sudo apt install gcc-8 If you comment that the command worked, I'll post it as an answer to this question. – karel Jul 21 '22 at 06:22
  • @karel it didn't work. Only half of it worked, as in the gcc-11 was removed successfully but the version gcc-8 didn't install, throwing the same error as before: "Package 'gcc-8' has no installation candidate". I also looked up the total packages included in the gcc for my current ubuntu version(22.04), and appearantly there are all the versions included starting from gcc-4 to gcc-11, EXCEPT for the version gcc-8. anything else that I should do? Thanks. – UTSAV PANDYA Jul 21 '22 at 07:17
  • @karel Thanks. The error regarding gcc-8 has resolved and gcc-8 has been installed but another error for g++-8 has appeared. By running the similar commands will I be able to download and install g++-8 too? If so, what changes should I make? Thanks for the help so far. – UTSAV PANDYA Jul 21 '22 at 08:07
  • @karel https://askubuntu.com/questions/1419726/how-to-solve-package-g-8-has-no-installation-candidate-error-on-ubuntu-22 here is the separate question for g++-8, please post the solution for g++-8 on the same. The error is the same except for the gcc-8 package and g++-8. Thanks. – UTSAV PANDYA Jul 21 '22 at 09:11

3 Answers3

4

The gcc-8 package has been discontinued in the Ubuntu 22.04 and later default repositories, but it is still available in the Ubuntu 20.04 default repositories. To install the gcc-8 package from Ubuntu 20.04 in Ubuntu 22.04 run the following commands:

sudo apt update
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/gcc-8_8.4.0-3ubuntu2_amd64.deb
wget http://mirrors.edge.kernel.org/ubuntu/pool/universe/g/gcc-8/gcc-8-base_8.4.0-3ubuntu2_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/libgcc-8-dev_8.4.0-3ubuntu2_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/cpp-8_8.4.0-3ubuntu2_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/universe/g/gcc-8/libmpx2_8.4.0-3ubuntu2_amd64.deb
wget http://mirrors.kernel.org/ubuntu/pool/main/i/isl/libisl22_0.22.1-1_amd64.deb
sudo apt install ./libisl22_0.22.1-1_amd64.deb ./libmpx2_8.4.0-3ubuntu2_amd64.deb ./cpp-8_8.4.0-3ubuntu2_amd64.deb ./libgcc-8-dev_8.4.0-3ubuntu2_amd64.deb ./gcc-8-base_8.4.0-3ubuntu2_amd64.deb ./gcc-8_8.4.0-3ubuntu2_amd64.deb

Original answer (now obsolete):

The gcc-8 package has been discontinued in the Ubuntu 22.04 and later default repositories. To install the gcc-8 package from Ubuntu 21.10 in Ubuntu 22.04 run the following commands:

sudo apt update
sudo apt remove gcc-11 # optional
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
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

I removed gcc-11 in the above commands because you mentioned in your question that you also wanted to remove it. If you want to keep gcc-11 installed alongside gcc-8 then omit the sudo apt remove gcc-11 command.

karel
  • 114,770
1

Another solution is what Jodeli proposed 'gcc-7' has not installation candidate issue.

In terminal type sudo nano /etc/apt/sources.list and add the following at the end of file:

deb [arch=amd64] http://archive.ubuntu.com/ubuntu focal main universe

Then execute:

sudo apt update
sudo apt install gcc-8 g++-8

Also a good practice is using update-alternatives to manage different versions of gcc. For example, if after these steps you have gcc-8 and gcc-11 in you /usr/bin directory, run in terminal:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 10
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 20
sudo update-alternatives --config gcc

I'm not sure if it is much better than karel's one since they all can lead to problems with dependencies. I guess editing /etc/apt/sources.list can be more comfortable because one doesn't have to download all packages manually.

BayerG
  • 11
0

I think you didn't upgrade your OpenFace version from 2.0.0 to 2.2.0

the script already upgrade 14 months ago.

 ...
 # If we're not on 18.04 
 sudo apt-get -y update

if [[ lsb_release -rs != "18.04" ]] then
echo "Adding ppa:ubuntu-toolchain-r/test apt-repository " sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y sudo apt-get -y update fi

sudo apt-get -y install build-essential sudo apt-get -y install gcc-8 g++-8 ...

Related:

https://github.com/TadasBaltrusaitis/OpenFace

Hope this helps.

  • Thanks for the answer, but I have downloaded and trying to install the latest OpenFace 2.2.0 version. Also, i have installed and updated the repository as well. – UTSAV PANDYA Jul 21 '22 at 09:37
  • @UTSAVPANDYA great. the result will same when you download it using wget and install it manually or add repository from their script. – abu-ahmed al-khatiri Jul 21 '22 at 09:51