Issue
I'm trying to install gcc version 4.9 on Ubuntu to replace the current version 7.5 (because Torch is not compatible with version 6 and above). However, even following precise instructions, I can't install it. I did:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo aot-get remove gcc
sudo apt-get install gcc-4.9.
Note that I already have CUDA installed. When I try installing version 4.9., it gives this:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'gcc-4.9-hppa-linux-gnu' for regex 'gcc-4.9.'
Note, selecting 'gcc-4.9-m68k-linux-gnu' for regex 'gcc-4.9.'
Note, selecting 'gcc-4.9-sh4-linux-gnu' for regex 'gcc-4.9.'
Note, selecting 'gcc-4.9-mips64el-linux-gnuabi64' for regex 'gcc-4.9.'
Note, selecting 'gcc-4.9-aarch64-linux-gnu' for regex 'gcc-4.9.'
Note, selecting 'gcc-4.9-hppa64' for regex 'gcc-4.9.'
Note, selecting 'gcc-4.9-sparc-linux-gnu' for regex 'gcc-4.9.'
Note, selecting 'gcc-4.9-powerpc-linux-gnuspe' for regex 'gcc-4.9.'
Note, selecting 'gcc-4.9-s390x-linux-gnu' for regex 'gcc-4.9.'
Note, selecting 'gcc-4.9-arm-linux-gnueabihf' for regex 'gcc-4.9.'
Note, selecting 'gcc-4.9-mips64-linux-gnuabi64' for regex 'gcc-4.9.'
Note, selecting 'gcc-4.9-powerpc64le-linux-gnu' for regex 'gcc-4.9.'
Note, selecting 'gcc-4.9-powerpc-linux-gnu' for regex 'gcc-4.9.'
Note, selecting 'gcc-4.9-powerpc64-linux-gnu' for regex 'gcc-4.9.'
Note, selecting 'gcc-4.9-sparc64-linux-gnu' for regex 'gcc-4.9.'
Note, selecting 'gcc-4.9-mipsel-linux-gnu' for regex 'gcc-4.9.'
Note, selecting 'gcc-4.9-alpha-linux-gnu' for regex 'gcc-4.9.'
Note, selecting 'gcc-4.9-mips-linux-gnu' for regex 'gcc-4.9.'
Note, selecting 'gcc-4.9-arm-linux-gnueabi' for regex 'gcc-4.9.'
The following packages were automatically installed and are no longer required:
cuda-cudart-10-2 cuda-cudart-dev-10-2 cuda-cufft-10-2 cuda-cufft-dev-10-2
cuda-cuobjdump-10-2 cuda-curand-10-2 cuda-curand-dev-10-2 cuda-cusolver-10-2
cuda-cusolver-dev-10-2 cuda-cusparse-10-2 cuda-cusparse-dev-10-2
cuda-driver-dev-10-2 cuda-gdb-10-2 cuda-libraries-10-2
cuda-libraries-dev-10-2 cuda-license-10-2 cuda-memcheck-10-2
cuda-misc-headers-10-2 cuda-npp-10-2 cuda-npp-dev-10-2 cuda-nsight-10-2
cuda-nsight-compute-10-2 cuda-nsight-systems-10-2 cuda-nvdisasm-10-2
cuda-nvgraph-10-2 cuda-nvgraph-dev-10-2 cuda-nvjpeg-10-2
cuda-nvjpeg-dev-10-2 cuda-nvml-dev-10-2 cuda-nvprof-10-2 cuda-nvprune-10-2
cuda-nvrtc-10-2 cuda-nvrtc-dev-10-2 cuda-nvtx-10-2 cuda-nvvp-10-2
cuda-sanitizer-api-10-2 cuda-visual-tools-10-2 freeglut3-dev g++-7
libcublas-dev libcublas10 libnvidia-extra-440 libxi-dev libxmu-dev
libxmu-headers libxt-dev nsight-compute-2019.5.0 nsight-systems-2019.5.2
nvidia-compute-utils-440 nvidia-kernel-common-440 nvidia-kernel-source-440
nvidia-modprobe nvidia-utils-440 xserver-xorg-video-nvidia-440
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
For whatever reason, it does not want to install it. When I type sudo apt-get install gcc
on the other hand, it just re-installs version 7.5.
What can I do to replace GCC (and G++) with version 4.9?
Solution
GCC 4.9 repo is still available officially just add these in your repo
deb http://dk.archive.ubuntu.com/ubuntu/ xenial main
deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe
Then update and install again.
Answered By - Mainak Mukhopadhyay