0

i want to install a previous version of gcc (7.3.0). Currently, i have installed gcc in version 7.4.0.

I uninstalled gcc with sudo apt-get remove gcc; sudo apt-get autoremove and tried to install the previous version with

sudo apt-get install gcc=4:7.3.0-3ubuntu2

After installing it, the output ofgcc --version shows:

gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

So the installed version of gcc is still 7.4.0. Why does apt not install the specified version?

Thank you for ur help!

2
  • This version is not compatible. I got the package+version(gcc=4:7.3.0-3ubuntu2) while using sudo apt-cache policy gcc. Commented Jun 30, 2019 at 15:21
  • I got an error, because I did not install the additional required packages. This works now. Thank you for the help. My problem is fixed. Commented Jun 30, 2019 at 16:38

1 Answer 1

3

The gcc package is a metapackage which pulls in the appropriate compiler package; downgrading it won’t downgrade the compiler itself. You need to downgrade gcc-7, which is the appropriate compiler package in Ubuntu 18.04:

sudo apt install gcc-7=7.3.0-16ubuntu3

and any required package.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.