4

I made a stupid mistake of complete deleting python 3.10 from my laptop with Ubuntu 20.04, when I tried to update it to 22.04 version. After doing this, I can only access tty1 mode (i.e. a black screen with a very few available options).

I tried to reinstall ubuntu-desktop as it was recommended, but unfortunately this didn't work and raised an error - kind of cannot find it or smth like that.

I saw posts with similar problems, like this - Cannot connect to the Internet after removing python3 from Xubuntu, but not pretty sure how to manually install missing dependencies to get access to the internet via tty1 from USB.

Could you, please, help me to fix this error and assist with instalation of required packages in this tty1 mode.

  • Are you saying that you deleted the system-provided Python 3.10 from your newly-upgraded Ubuntu 22.04? And now you don't have any Python 3 installed at all? Or are you saying something else? – user535733 Sep 28 '23 at 20:38
  • 2
    You may find it easier to reinstall – Archisman Panigrahi Sep 28 '23 at 21:44
  • I deleted Python 3.10 when tried to install new version of Ubuntu (didn't succeed though). Since Python is a heart of Ubuntu, my laptop supports only tty1 mode (it's kind of in coma right now) – dzhu_man_dzhi Sep 28 '23 at 22:16

2 Answers2

5

Assuming that you completely removed all versions of Python3, and therefore cannot use apt.

  1. Go to https://packages.ubuntu.com . Search for the python3 package. Select the package that matches your release of Ubuntu.

    Here's what it looks like for Ubuntu 22.04

    enter image description here

  2. Look at the list of "Other Packages Related to python3"

    There are three packages listed as dependencies. Now you know the four packages you need to download from http://packages.ubuntu.com

  • python3

  • python3-minimal

  • libpython3-stdlib

  • python 3.10

    Note: Be sure to download for the correct release of Ubuntu. Don't mix versions. If you download the wrong version, the next step won't work.

  1. After downloading, you should have all four deb packages in your Downloads folder. Use dpkg to install them in this order. Use tab-completion to get package names correct.

    cd ~/Downloads
    sudo dpkg -i python3-minimal_3.10.6-1~22.04_amd64.deb
    sudo dpkg -i libpython3-stdlib_3.10.6-1~22.04_amd64.deb
    sudo dpkg -i python3.10_3.10.12-1~22.04.2_amd64.deb
    sudo dpkg -i python3_3.10.6-1~22.04_amd64.deb
    

That should restore Python3 on your 22.04 system, including apt functionality.

user535733
  • 62,253
1

First you need to add a python repository , type all commands in the tty1 mode :

Just enter these commands

sudo apt-get install --reinstall python python-chardet python-colorama python-distlib python-django python-django-tables2 python-six python-html5lib python-lxml python-minimal python-pkg-resources python-setuptools python-urllib3 python-requests python-pip python-virtualenv

sudo apt-get install --reinstall python-dnspython

sudo apt autoremove

sudo apt-get -f install

If you don't have internet connection type nmcli device to see available networks

Then type it for connecting :

nmcli device wifi connect <SSID> password <password>
No-one
  • 274