-2

I am still able to run Anaconda, but the Python installation is suffering some issues after accidentally creating a wrong symbolic link and then trying to upgrade Python version

The following additional packages will be installed:
apport apport-gtk aptdaemon python3-apport python3-apt python3-aptdaemon python3-aptdaemon.gtk3widgets                  python3-distupgrade python3-software-properties python3-update-manager ubuntu-drivers-common                            ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk unattended-upgrades update-manager-core update-notifier        update-notifier-common
Suggested packages:
x-terminal-emulator python3-launchpadlib python3-apt-dbg python-apt-doc python3-aptdaemon.pkcompat bsd-mailx            default-mta | mail-transport-agent needrestart
The following NEW packages will be installed:
apport apport-gtk aptdaemon python3-apport python3-apt python3-aptdaemon python3-aptdaemon.gtk3widgets                  python3-distupgrade python3-software-properties python3-update-manager ubuntu-release-upgrader-core                     ubuntu-release-upgrader-gtk unattended-upgrades update-manager-core update-notifier update-notifier-common            The following packages will be upgraded:                                                                                  ubuntu-drivers-common

...

Preparing to unpack .../00-python3-apt_1.6.5ubuntu0.5_amd64.deb ...
Unpacking python3-apt (1.6.5ubuntu0.5) ...
Preparing to unpack .../01-ubuntu-drivers-common_1%3a0.8.6.3~0.18.04.1_amd64.deb ...
File "/usr/bin/py3clean", line 4
SyntaxError: Non-ASCII character '\xc2' in file /usr/bin/py3clean on line 4, but no encoding declared;
see http://python.org/dev/peps/pep-0263/ for details
dpkg: error processing archive /tmp/apt-dpkg-install-UU4SRN/01-ubuntu-drivers-common_1%3a0.8.6.3~0.18.04.1_amd64.deb (--unpack):

new ubuntu-drivers-common package pre-removal script subprocess returned error exit status 1
File "/usr/bin/py3compile", line 4
SyntaxError: Non-ASCII character '\xc2' in file /usr/bin/py3compile on line 4, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
    
dpkg: error while cleaning up:
installed ubuntu-drivers-common package post-installation script subprocess returned error exit status 1

...

Errors were encountered while processing:
/tmp/apt-dpkg-install-UU4SRN/01-ubuntu-drivers-common_1%3a0.8.6.3~0.18.04.1_amd64.deb

Cannot run neither sudo dpkg --configure -a nor sudo apt-get install -f

1 Answers1

0

Your post is a little thin on details (what do you exectly did? why including anaconda in the description? etc); however, manually upgrading the system-wide python installation is a bad idea, as many system utilities depends on the correct python version. I strongly advise you to revert your change and, if a newer python version is required, to build a python virtual environment.

That said, the only issue I can see is that a single package (01-ubuntu-drivers-common_1%3a0.8.6.3~0.18.04.1_amd64.deb) can not be installed, due to an unexpected char in the installation script. Are we sure it depends on the python upgrade? If so, why?

Please revert your python upgrade and try again.

shodanshok
  • 44,038
  • 6
  • 98
  • 162
  • There is not much that I know about the details. This is the current state of the server and I need to fix it and not lose any data. As far as I know, Ubuntu does not have 'revert' actions taken previously like windows, for example has revert to previous state. So, I am not sure how to go about solving this issue – Boris Mocialov Apr 28 '21 at 06:54
  • In this case, if you don't know what caused the issue in the first place, I strongly recommend to ask for professional support. Any action taken without knowing the (approximate) system state is like asking for more troubles. – shodanshok Apr 28 '21 at 11:04