G ++ kann nicht auf Ubuntu installiert werden

7902
Erel Segal-Halevi

Ich habe kein g ++:

erelsgl@ubuntu:/etc/apt$ which g++ erelsgl@ubuntu:/etc/apt$   erelsgl@ubuntu:/etc/apt$ g++ The program 'g++' can be found in the following packages: * g++ * pentium-builder Try: sudo apt-get install <selected package> 

Also versuche ich es zu installieren:

erelsgl@ubuntu:~/srilm$ sudo apt-get install g++ Reading package lists... Done Building dependency tree  Reading state information... Done g++ is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded. 2 not fully installed or removed. After this operation, 0B of additional disk space will be used. Setting up g++ (4:4.4.3-1ubuntu1) ... update-alternatives: error: alternative path /usr/bin/g++ doesn't exist. dpkg: error processing g++ (--configure): subprocess installed post-installation script returned error exit status 2 dpkg: dependency problems prevent configuration of build-essential: build-essential depends on g++ (>= 4:4.3.1); however: Package g++ is not configured yet. dpkg: error processing build-essential (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. Errors were encountered while processing: g++ build-essential E: Sub-process /usr/bin/dpkg returned an error code (1) 

Ich versuche auch, build-essential zu installieren, und erhalte die gleichen Ergebnisse.

Ich habe auch versucht "sudo apt-get Update" - hat nicht geholfen.

Das ist mein apt-cache:

erelsgl@ubuntu:/etc/apt$ apt-cache policy g++ build-essential g++: Installed: 4:4.4.3-1ubuntu1 Candidate: 4:4.4.3-1ubuntu1 Version table: *** 4:4.4.3-1ubuntu1 0 500 http://il.archive.ubuntu.com/ubuntu/ lucid/main Packages 100 /var/lib/dpkg/status build-essential: Installed: 11.4build1 Candidate: 11.4build1 Version table: *** 11.4build1 0 500 http://il.archive.ubuntu.com/ubuntu/ lucid/main Packages 100 /var/lib/dpkg/status erelsgl@ubuntu:/etc/apt$  

Ich habe das auch ausprobiert und den gleichen Fehler erhalten:

erelsgl@ubuntu:~/Ace/Files/corpus$ sudo dpkg --configure -a Setting up g++ (4:4.4.3-1ubuntu1) ... update-alternatives: error: alternative path /usr/bin/g++ doesn't exist. dpkg: error processing g++ (--configure): subprocess installed post-installation script returned error exit status 2 dpkg: dependency problems prevent configuration of build-essential: build-essential depends on g++ (>= 4:4.3.1); however: Package g++ is not configured yet. dpkg: error processing build-essential (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: g++ build-essential 
1
Sieht aus, als würden Sie Ubuntu Lucid ausführen. Könnten Sie die Ausgabe von "apt-cache policy g ++ build-essential" hinzufügen? Lekensteyn vor 12 Jahren 0
Sie haben Recht! Ich habe die Ausgabe hinzugefügt. Erel Segal-Halevi vor 12 Jahren 0

3 Antworten auf die Frage

2
dtech

Sounds like there is a problem with your current g++ installation. First remove it:

Get your installed g++ package: dpkg --list 'g++'

Remove it: dpkg --purge g++XXXX

Then install it again: apt-get install g++

Going to the package with synaptic (gui) or aptitude (command-line) might also give more information about the status of the package.

Das klingt vielversprechend, aber ich kann die Ausgabe nicht herausfinden: erelsgl @ ubuntu: ~ / Ace / Files / corpus $ sudo dpkg --list 'g ++' Desired = Unknown / Install / Remove / Purge / Hold | Status = Nicht / Inst / Cfg-Dateien / Unpacked / Failed-cfg / Halbinst / trig-aWait / Trig-pend | / Err? = (Keine) / Reinst-erforderlich (Status, Err: Großbuchstaben = schlecht) || / Name Versionsbeschreibung +++ - ============== - =============== - ============ ================================ iF g ++ 4: 4.4.3-1ubunt Der GNU C ++ - Compiler Erel Segal-Halevi vor 12 Jahren 0
Es scheint, ich habe Version 4.4.3, aber ich kann sie nicht entfernen: erelsgl @ ubuntu: ~ / Ace / Files / corpus $ sudo dpkg --purge 'g ++ 4.4.3' dpkg: Warnung: Die Anforderung zum Entfernen von g + wird ignoriert +4.4.3, das nicht installiert ist Ich habe auch 'g ++ - 4.4.3', 'g ++ 4.4.3-1ubunt', 'g ++ 4.4.3-1ubuntu' 'g ++ - 4.4.3-1ubunt', 'g ++ - 4.4.3-1ubuntu ausprobiert '- Ich vermisse wahrscheinlich die richtige Variante Erel Segal-Halevi vor 12 Jahren 0
probiere einfach "dpkg --purge g ++" dtech vor 12 Jahren 0
OK, die Bereinigung hat funktioniert, aber die Installation gibt immer noch den gleichen Fehler aus ... Erel Segal-Halevi vor 12 Jahren 0
0
Erel Segal-Halevi

Ich habe keine Lösung für dieses und andere ähnliche Probleme in Ubuntu 10.04 gefunden, also habe ich endlich auf 12.04 aufgerüstet und jetzt funktioniert alles gut ... Manchmal wird das Paketsystem verwirrt, also ist die beste Lösung nur ein Upgrade.

-1
Richard Kettlewell

Es hört sich an, als wäre G ++ halb installiert. Versuchen:

sudo dpkg --configure -a 
Ich habe es versucht und die gleiche Fehlermeldung erhalten - siehe meine letzte Bearbeitung oben. Erel Segal-Halevi vor 12 Jahren 1