I tried to uninstall python3.5
from my Ubuntu 16.04 by using the command sudo apt-get remove python3
within the directory /usr/bin
. When I tried to install it again, using sudo apt-get install python3
, I am getting the following error:
>> /usr/bin$ sudo apt-get remove python3
>> Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'python3' is not installed, so not removed
The following packages were automatically installed and are no longer required:
gir1.2-glib-2.0 libexpat1-dev libgirepository-1.0-1 libpython3-dev libpython3.5-dev python-pip-whl python-pycurl python3.5-dev
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 61 not upgraded.
>> python3 -V
>> bash: /usr/bin/python3: No such file or directory
>> sudo apt-get install python3
>> Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gir1.2-glib-2.0 libexpat1-dev libgirepository-1.0-1 libpython3-dev libpython3.5-dev python-pip-whl python-pycurl python3.5-dev
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
dh-python
Suggested packages:
python3-doc python3-tk python3-venv
The following NEW packages will be installed:
dh-python python3
0 upgraded, 2 newly installed, 0 to remove and 61 not upgraded.
Need to get 0 B/82.7 kB of archives.
After this operation, 436 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Selecting previously unselected package dh-python.
(Reading database ... 180938 files and directories currently installed.)
Preparing to unpack .../dh-python_2.20151103ubuntu1.2_all.deb ...
Unpacking dh-python (2.20151103ubuntu1.2) ...
Selecting previously unselected package python3.
Preparing to unpack .../python3_3.5.1-3_amd64.deb ...
Unpacking python3 (3.5.1-3) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up python3 (3.5.1-3) ...
running python rtupdate hooks for python3.5...
/usr/share/python3/runtime.d/dh-python.rtupdate: 5: /usr/share/python3/runtime.d/dh-python.rtupdate: py3clean: not found
error running python rtupdate hook dh-python
dpkg: error processing package python3 (--configure):
subprocess installed post-installation script returned error exit status 4
dpkg: dependency problems prevent configuration of dh-python:
dh-python depends on python3:any (>= 3.3.2-2~); however:
Package python3 is not configured yet.
dpkg: error processing package dh-python (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
python3
dh-python
E: Sub-process /usr/bin/dpkg returned an error code (1)
>> whereis python3
>> python3: /usr/bin/python3.6m /usr/bin/python3.6 /usr/bin/python3.5m /usr/bin/python3 /usr/lib/python3.5 /usr/lib/python3.6 /usr/lib/python3 /etc/python3.5 /etc/python3.6 /etc/python3 /usr/local/lib/python3.5 /usr/local/lib/python3.6 /usr/share/python3 /usr/share/man/man1/python3.1.gz
Please suggest a solution.