I try to uninstall system's python 3.8 in my Ubuntu 20.04 with this command in terminal.

To list all python versions in default locations

ls /usr/bin/python*

To remove just python3 package sudo apt-get remove python3.8

plus it's dependent packages

sudo apt-get remove --auto-remove python3.8

plus configuration and/or data files of python3

sudo apt-get purge python3.8

both configuration and/or data files of python3.5 and it's dependencies

sudo apt-get purge --auto-remove python3.5 ) , i get this command in Github and it remove many applications including terminal ,i install python 3.7.7 in this os. does i have any way to fix it?

  • 2
    Please don't. Python is necessary for essential system functions, including package management with apt. – Jos Nov 5 '20 at 20:46
  • As Jos said, python3.8 is the default python for ubuntu20.04 so removing it will most probably break essential parts of your system. Why don't you just install the python version that you want to work with and do update-alternatives? – maxis Nov 5 '20 at 21:19

Python 3.8 is a part of your operating system and many tools depend on it.
When you remove Python from your system you have removed these tools as well.
If you are using Desktop version and I assume you do, you will not be able to boot to the desktop but the system should boot to CLI mode.
Login and remove the version of python you have installed from /usr/local/lib/ and /usr/local/bin/

Make sure your networking is up.

ip -br add

It should return information about interfaces and their state. Since networking tools such as netplan and network-manager rely on python, they are removed as well.
Enable the port:

sudo ip link set dev {port label} up

If you have dhcp server:

sudo dhclient

If you use static IP:

sudo ip addr add {IP address}/{mask in CIDR} dev {port label} 
sudo ip route default via {gateway IP}
sudo systemd-resolve --set-dns= --interface={port label}

If you have entered correct information you should have internet access.
Now let's reinstall all packages that your command would remove:

sudo apt-get update && sudo apt-get install -y\
  apg apparmor apport apport-gtk apport-symptoms aptdaemon aptdaemon-data apturl apturl-common avahi-utils command-not-found cups-pk-helper dc deja-dup distro-info-data docbook-xml duplicity firefox foomatic-db-compressed-ppds fprintd gdb gdbserver gdm3\
  gedit gedit-common gir1.2-accountsservice-1.0 gir1.2-atspi-2.0 gir1.2-dbusmenu-glib-0.4 gir1.2-dee-1.0 gir1.2-gck-1 gir1.2-gcr-3 gir1.2-gdm-1.0 gir1.2-geoclue-2.0 gir1.2-gnomebluetooth-1.0 gir1.2-goa-1.0 gir1.2-graphene-1.0 gir1.2-gst-plugins-base-1.0\
  gir1.2-gstreamer-1.0 gir1.2-gtksource-4 gir1.2-gudev-1.0 gir1.2-gweather-3.0 gir1.2-ibus-1.0 gir1.2-javascriptcoregtk-4.0 gir1.2-json-1.0 gir1.2-mutter-6 gir1.2-nm-1.0 gir1.2-nma-1.0 gir1.2-notify-0.7 gir1.2-packagekitglib-1.0 gir1.2-polkit-1.0\
  gir1.2-rb-3.0 gir1.2-rsvg-2.0 gir1.2-secret-1 gir1.2-snapd-1 gir1.2-soup-2.4 gir1.2-totem-1.0 gir1.2-totemplparser-1.0 gir1.2-udisks-2.0 gir1.2-unity-5.0 gir1.2-upowerglib-1.0 gir1.2-vte-2.91 gir1.2-webkit2-4.0 gir1.2-wnck-3.0 gkbd-capplet\
  gnome-control-center gnome-control-center-faces gnome-getting-started-docs gnome-menus gnome-online-accounts gnome-session-bin gnome-session-common gnome-shell gnome-shell-common gnome-shell-extension-appindicator gnome-shell-extension-desktop-icons\
  gnome-shell-extension-ubuntu-dock gnome-startup-applications gnome-terminal gnome-terminal-data gnome-user-docs gvfs-backends hplip hplip-data ibus ibus-data ibus-table ippusbxd language-selector-common language-selector-gnome libamtk-5-0\
  libamtk-5-common libbabeltrace1 libc6-dbg libcc1-0 libcdio-cdda2 libcdio-paranoia2 libcdio18 libcolord-gtk1 libdmapsharing-3.0-2 libdw1 libfprint-2-2 libglu1-mesa libgnomekbd-common libgnomekbd8 libgpod-common libgpod4 libgsound0 libgssdp-1.2-0\
  libgupnp-1.2-0 libgupnp-av-1.0-2 libgupnp-dlna-2.0-3 libhpmud0 libimagequant0 libldb2 liblirc-client0 libmspack0 libmtp-common libmtp-runtime libmtp9 libmutter-6-0 libnetplan0 libnfs13 libpam-fprintd libpython3-stdlib librsync2 librygel-core-2.6-2\
  librygel-db-2.6-2 librygel-renderer-2.6-2 librygel-server-2.6-2 libsane-hpaio libsgutils2-2 libsmbclient libtalloc2 libtepl-4-0 libtevent0 libwbclient0 libwhoopsie-preferences0 libwnck-3-0 libwnck-3-common libxatracker2 libxcb-icccm4 libxcb-image0\
  libxcb-keysyms1 libxcb-render-util0 libxcb-res0 libxcb-xkb1 libxcb-xv0 libxfont2 libxkbcommon-x11-0 libxklavier16 libxmlsec1-openssl libxres1 libxss1 libxvmc1 libyelp0 lsb-release mobile-broadband-provider-info mscompress mutter mutter-common\
  nautilus-extension-gnome-terminal nautilus-share netplan.io network-manager-gnome networkd-dispatcher openprinting-ppds orca plymouth-label plymouth-theme-spinner plymouth-theme-ubuntu-text printer-driver-foo2zjs\
  printer-driver-foo2zjs-common printer-driver-hpcups printer-driver-m2300w printer-driver-postscript-hp printer-driver-ptouch printer-driver-pxljr printer-driver-sag-gdi python-apt-common python3 python3-apport python3-apt python3-aptdaemon\
  python3-aptdaemon.gtk3widgets python3-bcrypt python3-blinker python3-brlapi python3-cairo python3-certifi python3-cffi-backend python3-chardet python3-click python3-colorama python3-commandnotfound python3-cryptography python3-cups python3-cupshelpers\
  python3-dateutil python3-dbus python3-debconf python3-debian python3-defer python3-distro python3-distro-info python3-distupgrade python3-entrypoints python3-fasteners python3-future python3-gdbm python3-gi python3-gi-cairo python3-httplib2\
  python3-ibus-1.0 python3-idna python3-jwt python3-keyring python3-launchpadlib python3-lazr.restfulclient python3-lazr.uri python3-lib2to3 python3-lockfile python3-louis python3-macaroonbakery python3-mako python3-markupsafe python3-minimal\
  python3-monotonic python3-nacl python3-netifaces python3-oauthlib python3-olefile python3-paramiko python3-pexpect python3-pil python3-pkg-resources python3-problem-report python3-protobuf python3-ptyprocess python3-pyatspi python3-pymacaroons\
  python3-renderpm python3-reportlab python3-reportlab-accel python3-requests python3-requests-unixsocket python3-rfc3339 python3-secretstorage python3-simplejson python3-six python3-software-properties python3-speechd python3-systemd python3-talloc\
  python3-tz python3-uno python3-update-manager python3-urllib3 python3-wadllib python3-xdg python3-xkit python3-yaml python3.8 python3.8-minimal rhythmbox-plugin-alternative-toolbar rhythmbox-plugins rygel samba-libs sgml-base sgml-data snapd\
  software-properties-common software-properties-gtk ssh-import-id switcheroo-control syslinux syslinux-common syslinux-legacy system-config-printer system-config-printer-common system-config-printer-udev totem-plugins ubuntu-advantage-tools\
  ubuntu-desktop ubuntu-desktop-minimal ubuntu-docs ubuntu-drivers-common ubuntu-minimal ubuntu-release-upgrader-core ubuntu-release-upgrader-gtk ubuntu-session ubuntu-standard ufw unattended-upgrades update-manager update-manager-core update-notifier\
  update-notifier-common usb-creator-common usb-creator-gtk whoopsie-preferences x11-apps x11-session-utils x11-xkb-utils xbitmaps xbrlapi xfonts-base xfonts-encodings xfonts-scalable xfonts-utils xinit xinput xml-core xorg xserver-common xserver-xephyr\
  xserver-xorg xserver-xorg-core xserver-xorg-input-all xserver-xorg-input-libinput xserver-xorg-input-wacom xserver-xorg-legacy xserver-xorg-video-all xserver-xorg-video-amdgpu xserver-xorg-video-ati xserver-xorg-video-fbdev xserver-xorg-video-intel\
  xserver-xorg-video-nouveau xserver-xorg-video-qxl xserver-xorg-video-radeon xserver-xorg-video-vesa xwayland yelp yelp-xsl

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.