Score:0

Hi, I'm new to Ubuntu. I'm using Ubuntu 22.04 and I want to install an older version of gcc -gcc-7

nl flag

which gcc gives - /usr/bin/gcc

gcc version shows - gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)

update-alternatives --query gcc gives - no alternatives for gcc

sudo apt-get install g++-7 gives - Reading package lists... Done Building dependency tree... Done Reading state information... Done Package g++-7 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'g++-7' has no installation candidate

sudo apt install build-essential sudo apt -y install gcc-7 g++-7 gives - Reading package lists... Done Building dependency tree... Done Reading state information... Done Package g++-7 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

Package gcc-7 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Unable to locate package install E: Package 'gcc-7' has no installation candidate E: Package 'g++-7' has no installation candidate

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 7 gives - update-alternatives: error: alternative path /usr/bin/gcc-7 doesn't exist

sudo update-alternatives --config gcc gives - update-alternatives: error: no alternatives for gcc

rocky rocky avatar
kn flag
The gcc-7 package still exists in Ubuntu 20.04 (Focal Fossa).
cc flag
Install it if you must, but do not even think of using update-alternatives to change the system-wide gcc default -- a sure way to break things. Do you really need an old gcc?
cn flag
what makes you believe you need it?
Humaira avatar
nl flag
I need it for installing StaMPS. The src code in StaMPS supports gcc-7 only .
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.