LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-18-2021, 06:00 AM   #1
fritzmuster
LQ Newbie
 
Registered: Mar 2021
Distribution: Kubuntu 20.04 64bit
Posts: 3

Rep: Reputation: Disabled
After downgrade gcc Nvidia driver doesen't work,fallback to default gcc doesn't work


Hello together

as I downgrade the gcc to 4.4 I changed the symlinks to the 4.4 Version. This doesen't work and now my System doesen't boot. As I learned now the Nvidia driver need the gcc compiler to work. Now I would like to get back to the default gcc but it doesen't work. What did I done yet

Code:
$ sudo apt remove build-essential
$ sudo apt purge gcc
$ sudo apt-get autoremove
$ sudo apt update
$ sudo apt upgrade
$ sudo apt full-upgrade
Then

Code:
sudo dpkg --configure -a
and

Code:
sudo apt-get install -f
After that I tried to install the build essential package, but this ended with errors. The gcc and g++ package is not configured and so the dependencies of build essential doesn't exist

Code:
$ [sudo apt-get install build-essential
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen.... Fertig
Die folgenden zusätzlichen Pakete werden installiert:
g++ g++-9 gcc libstdc++-9-dev
Vorgeschlagene Pakete:
g++-multilib g++-9-multilib gcc-9-doc gcc-multilib autoconf automake libtool flex bison gcc-doc libstdc++-9-doc
Die folgenden NEUEN Pakete werden installiert:
build-essential g++ g++-9 gcc libstdc++-9-dev
0 aktualisiert, 5 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
Es müssen noch 0 B von 10,1 MB an Archiven heruntergeladen werden.
Nach dieser Operation werden 46,8 MB Plattenplatz zusätzlich benutzt.
Möchten Sie fortfahren? [J/n] j
Vormals nicht ausgewähltes Paket gcc wird gewählt.
(Lese Datenbank ... 262920 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../gcc_4%3a9.3.0-1ubuntu2_amd64.deb ...
Entpacken von gcc (4:9.3.0-1ubuntu2) ...
Vormals nicht ausgewähltes Paket libstdc++-9-dev:amd64 wird gewählt.
Vorbereitung zum Entpacken von .../libstdc++-9-dev_9.3.0-17ubuntu1~20.04_amd64.deb ...
Entpacken von libstdc++-9-dev:amd64 (9.3.0-17ubuntu1~20.04) ...
Vormals nicht ausgewähltes Paket g++-9 wird gewählt.
Vorbereitung zum Entpacken von .../g++-9_9.3.0-17ubuntu1~20.04_amd64.deb ...
Entpacken von g++-9 (9.3.0-17ubuntu1~20.04) ...
Vormals nicht ausgewähltes Paket g++ wird gewählt.
Vorbereitung zum Entpacken von .../g++_4%3a9.3.0-1ubuntu2_amd64.deb ...
Entpacken von g++ (4:9.3.0-1ubuntu2) ...
Vormals nicht ausgewähltes Paket build-essential wird gewählt.
Vorbereitung zum Entpacken von .../build-essential_12.8ubuntu1.1_amd64.deb ...
Entpacken von build-essential (12.8ubuntu1.1) ...
libstdc++-9-dev:amd64 (9.3.0-17ubuntu1~20.04) wird eingerichtet ...
gcc (4:9.3.0-1ubuntu2) wird eingerichtet ...
update-alternatives: Fehler: Alternativen-Pfad /usr/bin/gcc existiert nicht
dpkg: Fehler beim Bearbeiten des Paketes gcc (--configure):
»installiertes gcc-Skript des Paketes post-installation«-Unterprozess gab den Fehlerwert 2 zurück
g++-9 (9.3.0-17ubuntu1~20.04) wird eingerichtet ...
dpkg: Abhängigkeitsprobleme verhindern Konfiguration von g++:
g++ hängt ab von gcc (= 4:9.3.0-1ubuntu2); aber:
Paket gcc ist noch nicht konfiguriert.
dpkg: Fehler beim Bearbeiten des Paketes g++ (--configure):
Abhängigkeitsprobleme - verbleibt unkonfiguriert
Es wurde kein Apport-Bericht verfasst, da die Fehlermeldung darauf hindeutet, dass dies lediglich ein Folgefehler eines vorherigen Problems ist.
Es wurde kein Apport-Bericht verfasst, da die Fehlermeldung darauf hindeut
et, dass dies lediglich ein Folgefehler eines vorherigen Problems ist.
dpkg: Abhängigkeitsprobleme verhindern Konfiguration von build-essential:
build-essential hängt ab von gcc (>= 4:9.2); aber:
Paket gcc ist noch nicht konfiguriert.
build-essential hängt ab von g++ (>= 4:9.2); aber:
Paket g++ ist noch nicht konfiguriert.
dpkg: Fehler beim Bearbeiten des Paketes build-essential (--configure):
Abhängigkeitsprobleme - verbleibt unkonfiguriert
Trigger für man-db (2.9.1-1) werden verarbeitet ...
Fehler traten auf beim Bearbeiten von:
gcc
g++
build-essential
E: Sub-process /usr/bin/dpkg returned an error code (1)
The symlinks are

Code:
lrwxrwxrwx 1 root root           5 Mär 20  2020  x86_64-linux-gnu-g++ -> g++-9
-rwxr-xr-x 1 root root     1158288 Aug  8  2020  x86_64-linux-gnu-g++-9
lrwxrwxrwx 1 root root           5 Mär 20  2020  x86_64-linux-gnu-gcc -> gcc-9
-rwxr-xr-x 1 root root     1154192 Aug  8  2020  x86_64-linux-gnu-gcc-9
lrwxrwxrwx 1 root root           8 Mär 20  2020  x86_64-linux-gnu-gcc-ar -> gcc-ar-9
-rwxr-xr-x 1 root root       35464 Aug  8  2020  x86_64-linux-gnu-gcc-ar-9
lrwxrwxrwx 1 root root           8 Mär 20  2020  x86_64-linux-gnu-gcc-nm -> gcc-nm-9
-rwxr-xr-x 1 root root       35464 Aug  8  2020  x86_64-linux-gnu-gcc-nm-9
lrwxrwxrwx 1 root root          12 Mär 20  2020  x86_64-linux-gnu-gcc-ranlib -> gcc-ranlib-9
-rwxr-xr-x 1 root root       35464 Aug  8  2020  x86_64-linux-gnu-gcc-ranlib-9
My question is how can I install the default gcc.Thanks for any hints.
 
Old 03-18-2021, 11:25 PM   #2
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
If you tell us which version of Ubuntu, I could probably give similar information to below which is with Linux Mint. The first code box below shows what would get installed if I were to install build-essential in Linux Mint.
The second code box is the packages with gcc in their name installed in Linux Mint current. This is to show what may have been removed when you purged gcc.
build-essential:
Quote:
To be installed
g++
g++-9
lib-dev-bin
libc6-dev
libcrypt-dev
libstdc++-9-dev
Quote:
gcc-10-base/focal-updates,focal-security,now 10.2.0-5ubuntu1~20.04 amd64 [installed]
gcc-9-base/focal-updates,focal-security,now 9.3.0-17ubuntu1~20.04 amd64 [installed]
gcc-9/focal-updates,focal-security,now 9.3.0-17ubuntu1~20.04 amd64 [installed]
gcc/focal,now 4:9.3.0-1ubuntu2 amd64 [installed]
libgcc-9-dev/focal-updates,focal-security,now 9.3.0-17ubuntu1~20.04 amd64 [installed]
libgcc-s1/focal-updates,focal-security,now 10.2.0-5ubuntu1~20.04 amd64 [installed]
libuno-cppuhelpergcc3-3/focal-updates,now 1:6.4.6-0ubuntu0.20.04.1 amd64 [installed]
libuno-purpenvhelpergcc3-3/focal-updates,now 1:6.4.6-0ubuntu0.20.04.1 amd64 [installed]
libuno-salhelpergcc3-3/focal-updates,now 1:6.4.6-0ubuntu0.20.04.1 amd64 [installed]
The next code box shows the name you would use to install/remove any of the packages above.
Quote:
$ dpkg --get-selections | grep -v deinstall | grep gcc
gcc
gcc-10-base
gcc-9
gcc-9-base
libgcc-9-dev
libgcc-s1
libuno-cppuhelpergcc3-3
libuno-purpenvhelpergcc3-3
libuno-salhelpergcc3-3
Quote:
jo@jo-GT72-6QD:~$ sudo apt purge gcc
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
gcc*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 51.2 kB disk space will be freed.
Do you want to continue? [Y/n]

Last edited by Brains; 03-18-2021 at 11:50 PM.
 
Old 03-19-2021, 02:42 AM   #3
fritzmuster
LQ Newbie
 
Registered: Mar 2021
Distribution: Kubuntu 20.04 64bit
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for your reply. My System is a Kubuntu 20.04 64bit

As I searched further I found following broken links

Quote:
$/usr/bin$ find . -xtype l
./gcc-nm
./gcc-ar
./x86_64-linux-gnu-gcc
./x86_64-linux-gnu-gcc-nm
./gcc-ranlib
./x86_64-linux-gnu-gcc-ar
./clhsdb
./x86_64-linux-gnu-gcc-ranlib
./gcc
./hsdb
Now my question is how can I fix these broken links? I know the syntax to make the links but how are the sources and the targets of the links?

Last edited by fritzmuster; 03-19-2021 at 08:24 AM.
 
Old 03-21-2021, 01:10 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
@fritzmuster : Welcome to LQ.

1. You can have as many versions of gcc as you want, installed at the same time.
2. You are not supposed the remove the system gcc. Never.

Re #3 : Removed system packages can be reinstalled with
sudo apt install --reinstall [package name]
.... This should also make the broken links work again, I think.

-
 
Old 03-22-2021, 07:07 AM   #5
fritzmuster
LQ Newbie
 
Registered: Mar 2021
Distribution: Kubuntu 20.04 64bit
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks a lot for the hints. So I could solved my problem last weekend. Here a summary what I done.

A user posted in another forum the default symlinks for his 20.04 64bit Distr.

Code:
-rwxr-xr-x 1 root root 428 May 7 2006 c89-gcc
-rwxr-xr-x 1 root root 454 Apr 11 2011 c99-gcc
lrwxrwxrwx 1 root root 5 Mar 20 2020 gcc -> gcc-9
lrwxrwxrwx 1 root root 22 Aug 8 2020 gcc-9 -> x86_64-linux-gnu-gcc-9
lrwxrwxrwx 1 root root 8 Mar 20 2020 gcc-ar -> gcc-ar-9
lrwxrwxrwx 1 root root 25 Aug 8 2020 gcc-ar-9 -> x86_64-linux-gnu-gcc-ar-9
lrwxrwxrwx 1 root root 8 Mar 20 2020 gcc-nm -> gcc-nm-9
lrwxrwxrwx 1 root root 25 Aug 8 2020 gcc-nm-9 -> x86_64-linux-gnu-gcc-nm-9
lrwxrwxrwx 1 root root 12 Mar 20 2020 gcc-ranlib -> gcc-ranlib-9
lrwxrwxrwx 1 root root 29 Apr 2 2020 gcc-ranlib-8 -> x86_64-linux-gnu-gcc-ranlib-8
lrwxrwxrwx 1 root root 29 Aug 8 2020 gcc-ranlib-9 -> x86_64-linux-gnu-gcc-ranlib-9
lrwxrwxrwx 1 root root 5 Mar 20 2020 x86_64-linux-gnu-gcc -> gcc-9
-rwxr-xr-x 1 root root 1154192 Aug 8 2020 x86_64-linux-gnu-gcc-9
lrwxrwxrwx 1 root root 8 Mar 20 2020 x86_64-linux-gnu-gcc-ar -> gcc-ar-9
-rwxr-xr-x 1 root root 35464 Aug 8 2020 x86_64-linux-gnu-gcc-ar-9
lrwxrwxrwx 1 root root 8 Mar 20 2020 x86_64-linux-gnu-gcc-nm -> gcc-nm-9
-rwxr-xr-x 1 root root 35464 Aug 8 2020 x86_64-linux-gnu-gcc-nm-9
lrwxrwxrwx 1 root root 12 Mar 20 2020 x86_64-linux-gnu-gcc-ranlib -> gcc-ranlib-9
-rwxr-xr-x 1 root root 35464 Aug 8 2020 x86_64-linux-gnu-gcc-ranlib-9
Now I was able to define my missing symlinks and also check my existing ones if they are correct. The missing ones I defined like that:

Code:
sudo ln -s gcc-9 gcc
sudo ln -s gcc-nm-9 gcc-nm
sudo ln -s gcc-ar-9 gcc-ar
sudo ln -s x86_64-linux-gnu-gcc-nm-9 gcc-nm-9
sudo ln -s gcc-ranlib-9 gcc-ranlib
sudo ln -s x86_64-linux-gnu-gcc-ar-9 gcc-ar-9
sudo ln -s x86_64-linux-gnu-gcc-ranlib-9 gcc-ranlib-9

After that I could reinstall the gcc package with sudo
Code:
apt-get install --reinstall gcc
And at the end I installed the package build-essentials. Now gcc is OK and the nvidia driver works perfectly.
 
  


Reply

Tags
gcc



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cheese doesen't work, skype does with my cam firekage Ubuntu 2 07-30-2012 01:25 PM
Interpretation required for '(none) dhcpd: Sending on Socket/fallback/fallback-net' ttomsant Linux - Newbie 0 04-07-2009 02:31 PM
Why my soundcard doesen't work? qpasp Linux - Hardware 6 11-20-2007 10:40 AM
Mouse doesen't work with Kernel 2.6.0 fedivh Linux - General 9 02-07-2004 01:39 PM
setting vga= in lilo doesen't work - penguin interference ... Daniel S Linux - Newbie 1 10-28-2002 07:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration