Python versehentlich mit „sudo apt-get remove python“ entfernt

Python versehentlich mit „sudo apt-get remove python“ entfernt

Ich habe versehentlich die Standardversion von Python entfernt, die mit Ubuntu geliefert wird, und dabei wurden auch einige Systemabhängigkeiten entfernt.

Jetzt kann ich nicht mit "sudo apt-get install python" neu installieren

     sudo apt-get install python
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python is already the newest version (2.7.15~rc1-1).
The following packages were automatically installed and are no longer required:
  gir1.2-harfbuzz-0.0 icu-devtools ieee-data libboost-atomic-dev libboost-atomic1.65-dev libboost-atomic1.65.1 libboost-chrono-dev libboost-chrono1.65-dev
  libboost-container-dev libboost-container1.65-dev libboost-container1.65.1 libboost-context-dev libboost-context1.65-dev libboost-context1.65.1 libboost-coroutine-dev
  libboost-coroutine1.65-dev libboost-coroutine1.65.1 libboost-date-time-dev libboost-date-time1.65-dev libboost-dev libboost-exception-dev libboost-exception1.65-dev
  libboost-fiber-dev libboost-fiber1.65-dev libboost-fiber1.65.1 libboost-filesystem-dev libboost-filesystem1.65-dev libboost-graph-dev libboost-graph-parallel-dev
  libboost-graph-parallel1.65-dev libboost-graph-parallel1.65.1 libboost-graph1.65-dev libboost-graph1.65.1 libboost-iostreams-dev libboost-iostreams1.65-dev
  libboost-locale-dev libboost-locale1.65-dev libboost-log-dev libboost-log1.65-dev libboost-math-dev libboost-math1.65-dev libboost-math1.65.1 libboost-mpi-dev
  libboost-mpi1.65-dev libboost-mpi1.65.1 libboost-numpy-dev libboost-numpy1.65-dev libboost-numpy1.65.1 libboost-program-options-dev libboost-program-options1.65-dev
  libboost-python1.65.1 libboost-random-dev libboost-random1.65-dev libboost-random1.65.1 libboost-regex-dev libboost-regex1.65-dev libboost-serialization-dev
  libboost-serialization1.65-dev libboost-serialization1.65.1 libboost-signals-dev libboost-signals1.65-dev libboost-signals1.65.1 libboost-stacktrace-dev
  libboost-stacktrace1.65-dev libboost-stacktrace1.65.1 libboost-system-dev libboost-system1.65-dev libboost-test-dev libboost-test1.65-dev libboost-test1.65.1
  libboost-thread-dev libboost-thread1.65-dev libboost-timer-dev libboost-timer1.65-dev libboost-timer1.65.1 libboost-tools-dev libboost-type-erasure-dev
  libboost-type-erasure1.65-dev libboost-type-erasure1.65.1 libboost-wave-dev libboost-wave1.65-dev libboost-wave1.65.1 libboost1.65-dev libboost1.65-tools-dev libfabric1
  libglib2.0-dev libglib2.0-dev-bin libgraphite2-dev libharfbuzz-dev libharfbuzz-gobject0 libhwloc-dev libhwloc-plugins libhwloc5 libibverbs-dev libicu-dev
  libicu-le-hb-dev libicu-le-hb0 libiculx60 libjs-async libjs-inherits libjs-node-uuid libjs-sphinxdoc libjs-underscore libnuma-dev libopenmpi-dev libopenmpi2 libpcre16-3
  libpcre3-dev libpcre32-3 libpsm-infinipath1 libpython-all-dev libpython-dev libpython2.7-dev librsync1 libsdl-ttf2.0-0 libssl1.0-dev libuv1-dev mpi-default-bin
  mpi-default-dev node-abbrev node-ansi node-ansi-color-table node-archy node-async node-balanced-match node-block-stream node-brace-expansion node-builtin-modules
  node-combined-stream node-concat-map node-cookie-jar node-delayed-stream node-forever-agent node-form-data node-fs.realpath node-fstream node-fstream-ignore
  node-github-url-from-git node-glob node-graceful-fs node-hosted-git-info node-inflight node-inherits node-ini node-is-builtin-module node-isexe node-json-stringify-safe
  node-lockfile node-lru-cache node-mime node-minimatch node-mkdirp node-mute-stream node-node-uuid node-nopt node-normalize-package-data node-npmlog node-once node-osenv
  node-path-is-absolute node-pseudomap node-qs node-read node-read-package-json node-request node-retry node-rimraf node-semver node-sha node-slide node-spdx-correct
  node-spdx-expression-parse node-spdx-license-ids node-tar node-tunnel-agent node-underscore node-validate-npm-package-license node-which node-wrappy node-yallist
  openmpi-bin openmpi-common pkg-config python-apt python2.7-dev zlib1g-dev
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 209 not upgraded.
4 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-dnspython (1.15.0-1) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error processing package python-dnspython (--configure):
 installed python-dnspython package post-installation script subprocess returned error exit status 1
Setting up python-minimal (2.7.15~rc1-1) ...
dpkg: error processing package python-minimal (--configure):
 installed python-minimal package post-installation script subprocess returned error exit status 1
Setting up python-six (1.11.0-2) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error processing package python-six (--configure):
 installed python-six package post-installation script subprocess returned error exit status 1
Setting up python-apt (1.6.5ubuntu0.2) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error processing package python-apt (--configure):
 installed python-apt package post-installation script subprocess returned error exit status 1
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 python-dnspython
 python-minimal
 python-six
 python-apt
E: Sub-process /usr/bin/dpkg returned an error code (1)

Ich habe überprüft, welche Abhängigkeiten entfernt wurden, indem ich /var/log/apt/history.log ausgecheckt habe.

Start-Date: 2020-03-19  21:01:03
Commandline: apt-get remove python
Requested-By: xxx (1000)
Remove: python-six:amd64 (1.11.0-2), python-tdb:amd64 (1.3.15-2), python-pathlib2:amd64 (2.3.0-1), python-xmltodict:amd64 (0.11.0-1), python-openssl:amd64 (17.5.0-1ubuntu1), python-jmespath:amd64 (0.9.3-1ubuntu1), python-samba:amd64 (2:4.7.6+dfsg~ubuntu-0ubuntu2.15), python-configparser:amd64 (3.5.0-1), python-logilab-common:amd64 (1.4.1-1), steam-launcher:amd64 (1.0.0.61), python-xdg:amd64 (0.25-4ubuntu1), python-markupsafe:amd64 (1.0-1build1), python-isort:amd64 (4.3.4+ds1-1), python-yaml:amd64 (3.12-1build2), python-requests:amd64 (2.18.4-2ubuntu0.1), python-simplejson:amd64 (3.13.2-1), node-gyp:amd64 (3.6.2-1ubuntu1), python-gi:amd64 (3.26.1-2ubuntu1), libboost-all-dev:amd64 (1.65.1.0ubuntu1), python-fasteners:amd64 (0.12.0-3), python-tk:amd64 (2.7.16-2~18.04), python-dbus:amd64 (1.2.6-1), python-libcloud:amd64 (2.2.1-1), python-pickleshare:amd64 (0.7.4-2), python-wcwidth:amd64 (0.1.7+dfsg1-1), slack-desktop:amd64 (4.3.2), python-monotonic:amd64 (1.1-2), gyp:amd64 (0.1+20150913git1f374df9-1ubuntu1), python-certifi:amd64 (2018.1.18-2), libboost-mpi-python1.65-dev:amd64 (1.65.1+dfsg-0ubuntu5), python-chardet:amd64 (3.0.4-1), python-selinux:amd64 (2.7-2build2), python-mccabe:amd64 (0.6.1-2), python:amd64 (2.7.15~rc1-1), python-enum34:amd64 (1.1.6-2), python-pexpect:amd64 (4.2.1-1), python-lockfile:amd64 (1:0.12.2-2), python-kerberos:amd64 (1.1.14-1), npm:amd64 (3.5.2-0ubuntu4), python-cryptography:amd64 (2.1.4-1ubuntu1.3), python-crypto:amd64 (2.6.1-8ubuntu2), libboost-python1.65-dev:amd64 (1.65.1+dfsg-0ubuntu5), python-keyrings.alt:amd64 (3.0-1), python-cffi-backend:amd64 (1.11.5-1), python-ipaddress:amd64 (1.0.17-1), python-ptyprocess:amd64 (0.5.2-1), python-lazy-object-proxy:amd64 (1.3.1-1), libboost-mpi-python-dev:amd64 (1.65.1.0ubuntu1), python-jinja2:amd64 (2.10-1ubuntu0.18.04.1), python-paramiko:amd64 (2.0.0-1ubuntu1.2), python-astroid:amd64 (1.6.0-1), python-scandir:amd64 (1.7-1), python-pygments:amd64 (2.2.0+dfsg-1), nginx-amplify-agent:amd64 (1.7.0-5~bionic), python-netaddr:amd64 (0.7.19-1), libboost-mpi-python1.65.1:amd64 (1.65.1+dfsg-0ubuntu5), python-pkg-resources:amd64 (39.0.1-2), python-all:amd64 (2.7.15~rc1-1), python-apt:amd64 (1.6.5ubuntu0.2), python-urllib3:amd64 (1.22-1ubuntu0.18.04.1), python-secretstorage:amd64 (2.3.1-2), python-dev:amd64 (2.7.15~rc1-1), python-pyasn1:amd64 (0.4.2-3), python-setuptools:amd64 (39.0.1-2), python-prompt-toolkit:amd64 (1.0.15-1), python-keyring:amd64 (10.6.0-1), samba-common-bin:amd64 (2:4.7.6+dfsg~ubuntu-0ubuntu2.15), pylint:amd64 (1.8.3-1), python-backports-shutil-get-terminal-size:amd64 (1.0.0-5), python-ipython:amd64 (5.5.0-1), nodejs-dev:amd64 (8.10.0~dfsg-2ubuntu0.4), python-decorator:amd64 (4.1.2-1), libboost-python-dev:amd64 (1.65.1.0ubuntu1), ipython:amd64 (5.5.0-1), python-traitlets:amd64 (4.3.2-1), python-singledispatch:amd64 (3.4.0.3-2), python-idna:amd64 (2.6-1), python-ipython-genutils:amd64 (0.2.0-1), python-concurrent.futures:amd64 (3.2.0-1), python-wheel:amd64 (0.30.0-0.2), duplicity:amd64 (0.7.17-0ubuntu1.1), python-ldb:amd64 (2:1.2.3-1ubuntu0.1), python-wrapt:amd64 (1.9.0-3), ansible:amd64 (2.5.1+dfsg-1ubuntu0.1), python-egenix-mxtools:amd64 (3.2.9-1), python-egenix-mxdatetime:amd64 (3.2.9-1), python-pip:amd64 (9.0.1-2.3~ubuntu1.18.04.1), python-asn1crypto:amd64 (0.24.0-1), python-backports.functools-lru-cache:amd64 (1.4-2), python-simplegeneric:amd64 (0.8.1-1), python-all-dev:amd64 (2.7.15~rc1-1), python-httplib2:amd64 (0.9.2+dfsg-1ubuntu0.1)
Error: Sub-process /usr/bin/dpkg returned an error code (1)
End-Date: 2020-03-19  21:01:24

Start-Date: 2020-03-19  21:01:58
Commandline: apt --fix-broken install
Requested-By: xxx (1000)
Install: python:amd64 (2.7.15~rc1-1, automatic)
End-Date: 2020-03-19  21:02:01

Kann mir bitte jemand helfen, wie ich das Problem beheben kann?

Danke!

BEARBEITEN 1:

Es sieht so aus, als würde es auch Pip entfernen und bei der Neuinstallation ist mir der folgende Fehler aufgefallen

Setting up python-dnspython (1.15.0-1) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
ModuleNotFoundError: No module named 'ConfigParser'
dpkg: error processing package python-dnspython (--configure):
 installed python-dnspython package post-installation script subprocess returned error exit status 1

verwandte Informationen