I am currently using Ubuntu 18.04, and I need gcc 4.8 for MATLAB. So I tried to install gcc-4.8 using
$ sudo apt-get install gcc-4.8
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/l/linux/linux-libc-dev_4.15.0-117.118_amd64.deb 404 Not Found [IP: 2403:8940:3:1::f 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
so I ran the command
sudo apt-get update
I didn't show any error but running gcc version command gave this
$ gcc -v
Command 'gcc' not found, but can be installed with:
sudo apt install gcc
previously I used to have 7.5 but now it is not.
Open the terminal and type:
In your terminal type:
sudo apt install gcc
andenter
. That should install the latest version ofgcc
.If you want to install GCC 4.8 specifically, you may follow the post: How to install gcc-4.8.
As GCC 4.8 is available in the default repository on Ubuntu 18.04, then you can simply do
Or type
sudo apt-get install gcc-4
in terminal and presstab
. If GCC 4.8 is available it will either auto-complete or show the available versions. If there are versions available other than 4.8 as well, add.8
aftersudo apt-get install gcc-4
and pressenter
to install.