Gut. Ja. Wollte einen Neuanfang, weil ich Abhängigkeitsverwirrungen hatte, also lief ich "whereis python" und löschte buchstäblich alle Dateien und Verzeichnisse, die auftauchten. Wenn ich dann apt-get install python starte, bekomme ich natürlich viele Fehler. Gibt es eine Möglichkeit, Python auf Ubuntu neu zu installieren, ohne nur einen sauberen Löschvorgang durchzuführen?
Hier ist die Ausgabe des Versuchs, Python Binary zu installieren:
root@ubuntu14-server:/home/kpoole# apt-get install python
Reading package lists... Done
Building dependency tree
Reading state information... Done
python is already the newest version.
The following packages were automatically installed and are no longer required:
libexpat1-dev libpython-dev libpython2.7-dev
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
15 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up python-chardet (2.0.1-2build2) ...
/var/lib/dpkg/info/python-chardet.postinst: 6: /var/lib/dpkg/info/python-chardet.postinst: pycompile: not found
dpkg: error processing package python-chardet (--configure):
subprocess installed post-installation script returned error exit status 127
Setting up python-colorama (0.2.5-0.1ubuntu1) ...
/var/lib/dpkg/info/python-colorama.postinst: 6: /var/lib/dpkg/info/python-colorama.postinst: pycompile: not found
dpkg: error processing package python-colorama (--configure):
subprocess installed post-installation script returned error exit status 127
Setting up python-distlib (0.1.8-1) ...
/var/lib/dpkg/info/python-distlib.postinst: 6: /var/lib/dpkg/info/python-distlib.postinst: pycompile: not found
dpkg: error processing package python-distlib (--configure):
subprocess installed post-installation script returned error exit status 127
Setting up python-django (1.6.1-2ubuntu0.5) ...
/var/lib/dpkg/info/python-django.postinst: 6: /var/lib/dpkg/info/python-django.postinst: pycompile: not found
dpkg: error processing package python-django (--configure):
subprocess installed post-installation script returned error exit status 127
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of python-django-tables2:
python-django-tables2 depends on python-django (>= 1.4.5); however:
Package python-django is not configured yet.
dpkg: error processing package python-django-tables2 (--configure):
dependency problems - leaving unconfigured
Setting up python-six (1.5.2-1) ...
No apport report written because MaxReports is reached already
/var/lib/dpkg/info/python-six.postinst: 6: /var/lib/dpkg/info/python-six.postinst: pycompile: not found
dpkg: error processing package python-six (--configure):
subprocess installed post-installation script returned error exit status 127
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of python-html5lib:
python-html5lib depends on python-six; however:
Package python-six is not configured yet.
dpkg: error processing package python-html5lib (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Setting up python-lxml (3.3.3-1ubuntu0.1) ...
/var/lib/dpkg/info/python-lxml.postinst: 6: /var/lib/dpkg/info/python-lxml.postinst: pycompile: not found
dpkg: error processing package python-lxml (--configure):
subprocess installed post-installation script returned error exit status 127
No apport report written because MaxReports is reached already
Setting up python-minimal (2.7.5-5ubuntu3) ...
/var/lib/dpkg/info/python-minimal.postinst: 4: /var/lib/dpkg/info/python-minimal.postinst: python2.7: not found
dpkg: error processing package python-minimal (--configure):
subprocess installed post-installation script returned error exit status 127
Setting up python-pkg-resources (3.3-1ubuntu1) ...
No apport report written because MaxReports is reached already
/var/lib/dpkg/info/python-pkg-resources.postinst: 6: /var/lib/dpkg/info/python-pkg-resources.postinst: pycompile: not found
dpkg: error processing package python-pkg-resources (--configure):
subprocess installed post-installation script returned error exit status 127
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of python-setuptools:
python-setuptools depends on python-pkg-resources (= 3.3-1ubuntu1); however:
Package python-pkg-resources is not configured yet.
dpkg: error processing package python-setuptools (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of python-urllib3:
python-urllib3 depends on python-six; however:
Package python-six is not configured yet.
dpkg: error processing package python-urllib3 (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of python-requests:
python-requests depends on python-chardet; however:
Package python-chardet is not configured yet.
python-requests depends on python-urllib3 (>= 1.7.1); however:
Package python-urllib3 is not configured yet.
dpkg: error processing package python-requests (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of python-pip:
python-pip depends on python-colorama; however:
Package python-colorama is not configured yet.
python-pip depends on python-distlib; however:
Package python-distlib is not configured yet.
python-pip depends on python-html5lib; however:
Package python-html5lib is not configured yet.
python-pip depends on python-pkg-resources; however:
Package python-pkg-resources is not configured yet.
python-pip depends on python-setuptools (>= 0.6c1); however:
Package python-setuptools is not configured yet.
python-pip depends on python-six; however:
Package python-six is not configured yet.
python-pip depends on python-requests; however:
Package python-requests is not configured yet.
dpkg: error processing package python-pip (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of python-virtualenv:
python-virtualenv depends on python-pkg-resources; however:
Package python-pkg-resources is not configured yet.
python-virtualenv depends on python-setuptools; however:
Package python-setuptools is not configured yet.
dpkg: error processing package python-virtualenv (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Errors were encountered while processing:
python-chardet
python-colorama
python-distlib
python-django
python-django-tables2
python-six
python-html5lib
python-lxml
python-minimal
python-pkg-resources
python-setuptools
python-urllib3
python-requests
python-pip
python-virtualenv
E: Sub-process /usr/bin/dpkg returned an error code (1)
Nach dem von ike vorgeschlagenen Weg:
root@ubuntu14-server:/home/kpoole# apt-get install --reinstall python
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
python : Depends: python2.7 (>= 2.7.5-1~) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
root@ubuntu14-server:/home/kpoole# apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
libexpat1-dev libpython-dev libpython2.7-dev
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
python python2.7
Suggested packages:
python-doc python-tk python2.7-doc
The following NEW packages will be installed:
python python2.7
0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded.
14 not fully installed or removed.
Need to get 0 B/330 kB of archives.
After this operation, 1,042 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Selecting previously unselected package python2.7.
(Reading database ... 73738 files and directories currently installed.)
Preparing to unpack .../python2.7_2.7.6-8_amd64.deb ...
Unpacking python2.7 (2.7.6-8) ...
Selecting previously unselected package python.
Preparing to unpack .../python_2.7.5-5ubuntu3_amd64.deb ...
Unpacking python (2.7.5-5ubuntu3) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for mime-support (3.54ubuntu1) ...
Setting up python-minimal (2.7.5-5ubuntu3) ...
/var/lib/dpkg/info/python-minimal.postinst: 4: /var/lib/dpkg/info/python-minimal.postinst: python2.7: not found
dpkg: error processing package python-minimal (--configure):
subprocess installed post-installation script returned error exit status 127
Setting up python2.7 (2.7.6-8) ...
/var/lib/dpkg/info/python2.7.postinst: 9: /var/lib/dpkg/info/python2.7.postinst: python2.7: not found
dpkg: error processing package python2.7 (--configure):
subprocess installed post-installation script returned error exit status 127
dpkg: dependency problems prevent configuration of python:
python depends on python2.7 (>= 2.7.5-1~); however:
Package python2.7 is not configured yet.
python depends on python-minimal (= 2.7.5-5ubuntu3); however:
Package python-minimal is not configured yet.
dpkg: error processing package python (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-chardet:
python-chardet depends on python (>= 2.7); however:
Package python is not configured yet.
python-chardet depends on python (<< 2.8); however:
Package python is not configured yet.
python-chardet depends on python:any (>= 2.7.1-0ubuntu2); however:
Package python is not configured yet.
dpkg: error processing package python-chardet (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-colorama:
python-colorama depends on python (>= 2.7); however:
Package python is not configured yet.
python-coNo apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
lorama depends on python (<< 2.8); however:
Package python is not configured yet.
python-colorama depends on python:any (>= 2.7.1-0ubuntu2); however:
Package python is not configured yet.
dpkg: error processing package python-colorama (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-distlib:
python-distlib depends on python:any (<< 2.8); however:
Package python is not configured yet.
python-distlib depends on python:any (>= 2.7.5-5~); however:
Package python is not configured yet.
dpkg: error processing package python-distlib (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-django:
python-django depends on python (>= 2.7); however:
Package python is not configured yet.
python-django depends on python (<< 2.8); however:
Package python is not configured yet.
python-django depends on python:any (>= 2.7.1-0ubuntu2); however:
Package pythNo apport report written because MaxReports is reached already
on is not configured yet.
dpkg: error processing package python-django (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-django-tables2:
python-django-tables2 depends on python (>= 2.7); however:
Package python is not configured yet.
python-django-tables2 depends on python (<< 2.8); however:
Package python is not configured yet.
python-django-tables2 depends on python:any (>= 2.7.1-0ubuntu2); however:
Package python is not configured yet.
python-django-tables2 depends on python-django (>= 1.4.5); however:
Package python-django is not configured yet.
dpkg: error processing package python-django-tables2 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-six:
python-six depends on python (>= 2.7); however:
Package python is not configured yet.
python-six depends on python (<< 2.8); however:
Package python is not configured yet.
python-six depends on python:any (>= 2.7.1-0ubuntu2); however:
Package python is not configured yet.
dpkg: error processing package python-six (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-html5lib:
python-html5lib depends on python:any (<< 2.8); however:
Package python is not configured yet.
python-html5lib depends on python:any (>= 2.7.5-5~); however:
Package python is not configured yet.
python-html5lib depends on python-six; however:
Package python-six is not configured yet.
dpkg: error processing package python-html5lib (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-lxml:
python-lxml depends on python (>= 2.7); however:
Package python is not configured yet.
python-lxml depends on python (<< 2.8); however:
Package python is not configured yet.
python-lxml depends on python:any (>= 2.7.1-0ubuntu2); however:
Package python is not configured yet.
dpkg: error processing package python-lxml (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-pkg-resources:
python-pkg-resources depends on python:any (>= 2.7); however:
Package python is not configured yet.
python-pkg-resources depends on python:any (<< 2.8); however:
Package python is not configured yet.
dpkg: error processing package python-pkg-resources (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-setuptools:
python-setuptools depends on python:any (>= 2.7); however:
Package python is not configured yet.
python-setuptools depends on python:any (<< 2.8); however:
Package python is not configured yet.
python-setuptools depends on python-pkg-resources (= 3.3-1ubuntu1); however:
Package python-pkg-resources is not configured yet.
dpkg: error processing package python-setuptools (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-urllib3:
python-urllib3 depends on python:any (>= 2.7.5-5~); however:
Package python is not configured yet.
python-urllib3 depends on python:any (<< 2.8); however:
Package python is not configured yet.
python-urllib3 depends on python-six; however:
Package python-six is not configured yet.
dpkg: error processing package python-urllib3 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-requests:
python-requests depends on python:any (>= 2.7.5-5~); however:
Package python is not configured yet.
python-requests depends on python:any (<< 2.8); however:
Package python is not configured yet.
python-requests depends on python-chardet; however:
Package python-chardet is not configured yet.
python-requests depends on python-urllib3 (>= 1.7.1); however:
Package python-urllib3 is not configured yet.
dpkg: error processing package python-requests (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-pip:
python-pip depends on python (>= 2.7); however:
Package python is not configured yet.
python-pip depends on python (<< 2.8); however:
Package python is not configured yet.
python-pip depends on python:any (>= 2.7.1-0ubuntu2); however:
Package python is not configured yet.
python-pip depends on python-colorama; however:
Package python-colorama is not configured yet.
python-pip depends on python-distlib; however:
Package python-distlib is not configured yet.
python-pip depends on python-html5lib; however:
Package python-html5lib is not configured yet.
python-pip depends on python-pkg-resources; however:
Package python-pkg-resources is not configured yet.
python-pip depends on python-setuptools (>= 0.6c1); however:
Package python-setuptools is not configured yet.
python-pip depends on python-six; however:
Package python-six is not configured yet.
python-pip depends on python-requests; however:
Package python-requests is not c
dpkg: error processing package python-pip (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
python-minimal
python2.7
python
python-chardet
python-colorama
python-distlib
python-django
python-django-tables2
python-six
python-html5lib
python-lxml
python-pkg-resources
python-setuptools
python-urllib3
python-requests
python-pip
E: Sub-process /usr/bin/dpkg returned an error code (1)
python : Depends: python2.7 (>= 2.7.5-1~) but it is not going to be installed
. Ich denke, Ihre früheren Abhängigkeitskonflikte beunruhigen Sie immer noch. Können Sie auch Ausgabe vondpkg -l | grep python
Antworten:
Mach das in Zukunft nicht mehr. Entfernen Sie keine Dateien, die über Paketverwaltungstools installiert wurden (oder verwirren Sie sie auf andere Weise) (es sei denn, sie sind explizit dafür eingerichtet, wie Konfigurationsdateien usw.).
Wenn Sie jedoch nicht in der Lage sind (und es sieht so aus, als ob dies der Fall sein könnte),
apt-get
um diese Situation zu beheben, da Teile des Prozesses davon ausgehen, dass Python bereits installiert ist, haben Sie einige Optionen (nicht alle) wird unbedingt funktionieren).Sie können die Python-
.deb
Dateien (und verwandte Dateien) manuell abrufen und versuchen,dpkg
sie manuell zu installieren (Sie müssen die Abhängigkeitsreihenfolge manuell auflösen, um sicherzustellen, dass dies ordnungsgemäß funktioniert). Etwas wie:Sie sollten nach anderen fehlenden Binärdateien suchen
pycompile
und dieselbe Lösung anwenden.Danach ist es empfehlenswert, die dpkg-Datenbank nach nicht konfigurierten, halbkonfigurierten und nur entpackten Paketen zu durchsuchen:
Lesen Sie die Nachrichten und wenden Sie Korrekturen an, aber normalerweise wird danach gefragt
sudo dpkg --configure -a
. Einsudo apt-get -f install
könnte je nach Situation helfen.Möglicherweise können Sie auch einen Wiederherstellungsmodus für Installationsmedien (oder eine Neuinstallation) verwenden, um dies zu beheben.
quelle
Ja. Neuinstallation ohne Formatierung.
Dies ist auch die schnellste Methode, um dies zu beheben, da Sie wahrscheinlich bereits eine Live-DVD haben.
quelle
rm
es leicht entfernen und wiederherstellen . Python ist nur ein Spaziergang im Park.Öffnen Sie ein Terminal und geben Sie die folgenden Befehle ein:
Erster Versuch
Wenn das nicht funktioniert, versuchen Sie es
Wenn Sie immer noch Probleme haben, führen Sie aus
Als letzten Ausweg müssen Sie diese Pakete möglicherweise mit dem folgenden Befehl entfernen und diese Pakete dann mit dem obigen Befehl neu installieren. Wenn dies der Fall ist, müssen Sie sehr genau aufpassen. Mit dem folgenden Befehl wird eine Liste der deinstallierten Pakete angezeigt. Sie müssen diese Liste kopieren und in gedit einfügen. Drücken Sie bei geöffnetem gedit und der Liste der in gedit eingefügten Pakete ctrl+ hund geben Sie \ n ein, gefolgt von zwei Leerzeichen in "Suchen nach" und einem Leerzeichen in "Ersetzen durch", um alle Absätze und zusätzlichen Leerzeichen zu entfernen, bevor Sie auf "Alle ersetzen" klicken Liste enthält eine Liste von Paketen, die nur durch einzelne Leerzeichen getrennt sind.
Führen Sie
sudo apt-get install
abschließend Folgendes aus : und fügen Sie die Liste der Pakete von gedit ein, um alles neu zu installieren.quelle
apt-get install --reinstall python
sollte es abdecken.sudo apt-get install --reinstall ubuntu-desktop
wird alle Extras abdecken, die Sie erwähnt haben. [Einheit, Bereiche, Python, Account Manager, etc.]Sie sollten jedes Paket entfernen, das Ihnen Schwierigkeiten bereitet, und es dann neu installieren.
Informationen zum Entfernen ohne Entfernen von Abhängigkeiten finden Sie unter /ubuntu//a/32899/176376 .
Sie sollten zuerst alle Probleme entfernen und sie dann erneut installieren.
Führen Sie einen
sudo apt-get install -f
undsudo dpkg --configure -a
alle paar Befehle.quelle
Ich sehe, Sie haben folgende Fehler:
Dies bedeutet, dass die ausführbare Datei für Python 2.7 nicht gefunden werden kann. Ich habe diesen Befehl verwendet, um das Paket zu finden, das ihn enthält (das würde auf Ihrem kaputten System jedoch wahrscheinlich nicht funktionieren).
Sie müssen es neu installieren, aber zuerst müssen Sie die Abhängigkeiten durchgehen. Verwenden Sie diese Befehle, um sie aufzulisten:
libpython2.7-minimal ist wahrscheinlich beschädigt. Daher empfehle ich Ihnen die erste Ausgabe:
dann:
und dann hoffentlich dein
wird gelingen.
quelle
Das ist erwartetes Verhalten. Das Löschen von Dateien ist nicht dasselbe wie das Deinstallieren eines Pakets oder Programms.
Sie haben alle Python-bezogenen Inhalte aus Ihrer Installation gelöscht, aber Ihr Paketmanager weiß dies nicht. Wenn Sie Python erneut installieren, erwartet apt, dass alle diese Dateien noch vorhanden sind, und versucht nicht, sie erneut herunterzuladen. Was apt betrifft, ist immer noch die gesamte Python installiert. Du hast es nie anders gesagt.
Sie können Folgendes versuchen, um dies zu korrigieren:
sudo apt-get install --reinstall python
In Zukunft mit Deinstallation von Paketen
apt-get remove
oderapt-get purge
oder grafisch aus der Ubuntu Software Center.quelle