0

I updated my distro a week ago Linux *** 5.10.41-1-MANJARO x86_64 GNU/Linux recent gcc and gcc-lib version 11.1.0 But need to work with gcc 10.2.0 and its coworker gcc-libs 10.2.0

I downgraded gcc and glib according to this guide

There is no problem with this but other thing get break like Firefox, Chromium etc and it gives the following error

firefox
/usr/lib/firefox/firefox: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/lib/firefox/firefox)

How can I downgrade gcc and coworker libs which I think its glib

I don't know how to deal with glib

sudo downgrade glib-
glib-compile-resources  glib-genmarshal         glib-mkenums
glib-compile-schemas    glib-gettextize 

Should I downgrade a glib thing belongs to them?

Wieland
  • 6,489
  • 3
    Nowadays, you just fire a container running older software (older gcc etc) so the host doesn't get this kind of problem. Btw, don't confuse gcc-libs, glibc2 or stdlibc++ with GLib. – A.B Jun 13 '21 at 13:53
  • 2
    @A.B I think your comment has all that an answer would need (maybe with a few words on why firefox now won't work) – Marcus Müller Jun 13 '21 at 14:26
  • 1
    From the link: Warning: Downgrading packages will almost always leave you in an unsupported partial upgrade state. These instructions are intended for advanced users who understand the consequences of downgrading packages I'll strongly recommend you roll back your downgrad, maxemilian. – Marcus Müller Jun 13 '21 at 14:26
  • Good idea, yeah I have problem with them @A.B – maxemilian Jun 13 '21 at 15:05
  • @MarcusMüller Exactly, I did, it turned to more complex I think – maxemilian Jun 13 '21 at 15:08
  • 1
    it really isn't; people used to do prefixes and if very complex chroots for decades, but with the advent of containers, having a little isolated environment for your special-needs programs is pretty easy. A simple sudo pacman -S podman and you can do things like podman run -it -v /home/maxemilian:/data:Z manjarolinux/base and get cozy little system in a box that you can modify to your heart's delight without damaging your main system! – Marcus Müller Jun 13 '21 at 15:22
  • I'm pretty new to Linux and this sounds very interesting. Would you mind linking some useful resources where I could learn how to do something like that? – telometto Jun 13 '21 at 16:04

1 Answers1

1

The documentation you linked to states:

Warning: Downgrading packages will almost always leave you in an unsupported partial upgrade state. These instructions are intended for advanced users who understand the consequences of downgrading packages

and that's exactly what happened here; you've now got dependencies (probably not even glibc, but others) that aren't compatible with your currently installed software. So, you had to roll back.

As A.B said:

Nowadays, you just fire a container running older software (older gcc etc) so the host doesn't get this kind of problem. Btw, don't confuse gcc-libs, glibc2 or stdlibc++ with GLib.

Now, on manjaro you can use docker or podman; both do the same thing: run containers, which are essentially Linux systems "in a box", nicely isolated from the rest of your system. podman is slightly more modern, and runs better without root privileges, but supports the same commands and options as docker (where that's possible).

For example, after installing podman (sudo pacman -S podman) you can run

podman run --name myfirstcontainer -it  -v /home/maxemilian:/data:Z manjarolinux/base

and it will download and run a manjaro image, give you an interactive shell on it (-it), bind what you have under /home/maxemilian as volume visible in the container as /data (using your own ownerships Z). Your container persists after exit (check podman ps -a), and can be started again using podman start --attach myfirstcontainer.

You can do the downgrade within that container, and not touch anything outside. Through the volume, your container can access the source files you need to compile!

It's very common to run a distcc as "server" compiler inside the container. You need to add --publish 3632 for that to work, and, on your development machine (i.e. your "normal" manjaro), instead of using e.g. gcc as compiler, use distcc.

podman run -it --publish 3632 --name buildserver manjarolinux/base #install gcc, distcc distccd --daemon

Try! Make a file test.c:

#include <stdio.h>
int main() {
  printf("GCC %d.%d.%d", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
  return 0;
}

Run

export CC=distcc
export DISTCC_HOSTS=localhost
$CC -o test test.c
./test
  • Could you share /etc/containers/registries.conf setting I can't fetch the image. I added some combination of regitry but its giving Error: error loading registries configuration "/etc/containers/registries.conf": toml: cannot load TOML value of type map[string]interface {} into a Go slice like those things – maxemilian Jun 15 '21 at 09:31