-1

I have confused to uninstall python3 or fix my VPS Ubuntu

Im using Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-31-generic x86_64)

I tried to uninstall all python packages

sudo apt-get purge python3

And getting this error

dpkg: error processing package python3-pkg-resources (--remove):
 subprocess installed pre-removal script returned error exit status 127                               Processing triggers for libc-bin (2.23-0ubuntu10) ...
Errors were encountered while processing:
 python3-lxml
 python3-pip
 python3-apt
 python3-pyparsing
 gir1.2-ibus-1.0:amd64
 hplip-data
 python3-blinker
 python3-bs4
 python3-cairo
 python3-chardet
 python3-dbus
 python3-defer
 python3-feedparser
 python3-gi
 python3-guacamole
 python3-httplib2
 python3-idna
 python3-jwt
 python3-louis
 python3-markupsafe
 python3-padme
 python3-setuptools
 python3-problem-report
 python3-ptyprocess
 python3-pyasn1
 python3-pycurl
 python3-six
 python3-wheel
 python3-xdg
 python3-xkit
 python3-xlsxwriter
 dh-python
 python3
 python3-pkg-resources
E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried other way from other site,error still same And i tried to reinstall my ubuntu with command line

apt-get install --reinstall ubuntu-desktop

I dont know should i do to fix my ubuntu and reinstall my python.

Note: I tried to run python3 it not working with reasons python3 is not package and i run python3.7 it working fine,idk python3.7 thats reall python package i have or something else :/

Im so appreciate any help

2 Answers2

1

Ubuntu 16.04 comes with Python3 installed by default. If you want to install Python 2 you can run:

sudo apt install python-minimal

On the command line you should use python3 or python2 to execute scripts.

Also take note that ubuntu-desktop is a package that will install a full display system such as X server and Gnome packages, none of which you'll have much use for if connecting over SSH.

However, the problem you may have now is that you've attempted (or succeeded to some degree) in removing Python, which is actually what the package management tool apt uses to install/remove packages.

1

This seems like an XY-problem. Problem Y, uninstalling Python 3, will break your OS. Don't do that.

Problem X is not clear, but assuming it's that the system Python 3 executable is damaged, you can reinstall it via the package python3.5-minimal:

sudo apt-get install --reinstall python3.5-minimal
wjandrea
  • 14,504