[DE] Fehler beim Deinstallieren von python-pycurl [gelöst]

Started by orinoco, 2026/06/07, 00:47:24

Previous topic - Next topic

orinoco

Hallo,
wenn ich das Paket python-pycurl deinstallieren will, erhalte ich folgende Fehlermeldung
Removing python-pycurl (7.43.0.2-2) ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
dpkg: error processing package python-pycurl (--remove):
old python-pycurl package prerm maintainer script subprocess failed with exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
python-pycurl
Processing was halted because there were too many errors.
Error: Sub-process /usr/bin/dpkg returned an error code (1)
Wie werde ich dieses Paket wieder los?

orinoco

#1
Ich habe mir dieses "prerem maintainer script" angeschaut:
$ cat /var/lib/dpkg/info/python-pycurl.prerm
#!/bin/sh
set -e

# Automatically added by dh_python2:
if which pyclean >/dev/null 2>&1; then
        pyclean -p python-pycurl
else
        dpkg -L python-pycurl | grep '\.py$' | while read file
        do
                rm -f "${file}"[co] >/dev/null
        done
fi

# End automatically added section
Das sieht nach Python2 aus. Mir war nicht bewusst, das ich das noch (in Fragmenten) drauf habe. Die Plattform-Meldungen könnten von pyclean kommen:
$ pyclean --help
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site

DeepDayze

That has to be Python2 as python 3 has command called py3clean to do the same thing IIRC.

orinoco

Ich bin das Paket losgeworden. Ich habe das Prerem-Skript mit Kommentarzeichen so angepasst, dass effektiv nur die Zeilen des Else-Blocks ausgeführt worden. Das hat bei mir funktioniert. Wer das nachmachen will. sollte unbedingt ein funktionierendes Backup in der Hinterhand haben.