I'm attempting to install a specific version of gcc to Ubuntu 18.04.
By default the version of Ubuntu at the time of this writing is 18.04.5
. Installing it with sudo apt-get install gcc-7
results in the following:
user@server:~$ gcc-7 -v
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
user@server:~$ sudo apt-cache policy gcc-7
gcc-7:
Installed: 7.5.0-3ubuntu1~18.04
Candidate: 7.5.0-3ubuntu1~18.04
Version table:
*** 7.5.0-3ubuntu1~18.04 500
500 http://hr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
500 http://hr.archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages
7.3.0-16ubuntu3 500
500 http://hr.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
Apt recognizes two versions and has installed the 7.5.0-3ubuntu1~18.04
one.
I need the version 7.4.0
.
I have found a package mirror which has the required package version (gcc-7-multilib_7.4.0-1ubuntu1~18.04.1_amd64.deb
) and did the following:
# Add "deb https://mirror.squ.edu.om/ubuntuarchive/ubuntu bionic main restricted multiverse universe" to /etc/apt/sources.list
user@server:~$ sudo apt-get update
user@server:~$ sudo apt-cache policy gcc-7
gcc-7:
Installed: 7.5.0-3ubuntu1~18.04
Candidate: 7.5.0-3ubuntu1~18.04
Version table:
*** 7.5.0-3ubuntu1~18.04 500
500 http://hr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
500 http://hr.archive.ubuntu.com/ubuntu bionic-security/main amd64 Packages
7.3.0-16ubuntu3 500
500 http://hr.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
500 https://mirror.squ.edu.om/ubuntuarchive/ubuntu bionic/main amd64 Packages
However this only added a new mirror to the 7.3.0-16ubuntu3
. It didn't introduce the version 7.4.0-1ubuntu1~18.04
which exists as a package in the mirrors. I expected to see the new versions available.
Am looking for an explanation for this behavior and ways to add the 7.4.0
version?