K
K
Kirill Novak2021-07-26 20:35:57
GCC
Kirill Novak, 2021-07-26 20:35:57

How to install an older version (Ubuntu) package?

I'm trying to install gcc version 7.3.0 because version 7.5.0 (the latest for gcc-7) does not compile the package I'm trying to install.

I got a list of package versions with this

apt-cache policy gcc-7

command

Version table:
     7.5.0-3ubuntu1~18.04 500
        500 http://mirror.yandex.ru/ubuntu bionic-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
     7.3.0-16ubuntu3 500
        500 http://mirror.yandex.ru/ubuntu bionic/main amd64 Packages


I'm trying to put 7.3.0

sudo apt-get install gcc-7=7.3.0-16ubuntu3

But I get an error

The following information may help to resolve the situation:

The following packages have unmet dependencies:
 gcc-7 : Depends: cpp-7 (= 7.3.0-16ubuntu3) but 7.5.0-3ubuntu1~18.04 is to be installed
         Depends: gcc-7-base (= 7.3.0-16ubuntu3) but 7.5.0-3ubuntu1~18.04 is to be installed
         Depends: libgcc-7-dev (= 7.3.0-16ubuntu3) but 7.5.0-3ubuntu1~18.04 is to be installed
         Recommends: libc6-dev (>= 2.13-0ubuntu6) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.


How to be?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Karabanov, 2021-07-26
@kinojs

Of course, you can tinker, but this dependency hell is not at all fun to rake.
There is a Docker container with GCC, collect in it what you need to build there.

V
Valdemar Smorman, 2021-07-27
@smorman

You can download the required package in the Terminal forcibly from the Ubuntu rep, install it and, on the message about dependencies, perform the correction of this trouble in it, but !!!
You are trying to install a package for a non-standard architecture.
Take a look at this package.
What architecture is it for?
60ffbe8a4fc0d783762361.png
Namely, only for:
arm64
armhf
ppc64el
s390x

But not for amd64 and i386 !!!
And there are simply no other options!
Therefore, install the package or simply by typing: without any tails for other architectures and the system itself will install what it needs ...
sudo apt install gcc-7
Or, if the version is not suitable, look for the version that is suitable, download forcibly from rap, as I wrote above.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question