Accidentaly uninstalled python3 from NGX xavier

Hello, I’m using an Nvidia Jetson Xavier NGX, and I accidentally used “apt-get remove python3 -y” instead of “apt-get remove python3.8.” Now, my Jetson is not booting. I checked the apt logs and found the applications that I uninstalled. How can I fix this?

Now I know why not use -y :|

I don’t think you can recover it other than re-flashing.
A lot of system services rely on python 3 to work.

Considering that I still have acess to tty consoles, can I flash by command lines?

Of course.

How can I do this, is there a guide to it?

https://docs.nvidia.com/jetson/archives/r35.5.0/DeveloperGuide/IN/QuickStart.html

I do not have acess to the Jetson buttons, do I really need to access, or can I force the recovery mode by terminal?

Yes you do.
You can only enter force recovery mode without physical buttons when the device is still in the Linux environment, and you run this on the device:

sudo reboot --force forced-recovery

Actually, I think you didn’t quite get the TTY access part. I have access to those terminals on the Jetson, and I wanted to re-flash it directly there. Is there any way to do that, or do I necessarily need a second PC with Ubuntu? The reboot with command works

So you are still able to login to the device? But you said it was not booting in the first post.
Or you mean only GUI was broken?

Anyway, if you are talking about something like self-reflashing, then it’s not possible, and you need a host PC for that.

Yes, sorry, it’s just the GUI that broke, I can force login into tty, do you think there is another solution?

Then can’t you fix it by just getting python 3 back?

I tried reinstalling Python 3, but it requires other packages that were uninstalled along with it

Put the exact error here.
You can do

sudo apt install -f

to fix missing dependencies.

I’m not getting any errors; it’s just that the GUI doesn’t start. It stays on the NVIDIA screen, and then I switch to the tty consoles and can use it. I tried running the command, but all dependencies were already installed.

This is the apt log after uninstalling Python 3.

Start-Date: 2024-04-09 04:43:20
Commandline: apt-get remove python3
Requested-By: mic-730ai (1000)
Remove: lxde-core:arm64 (10), python3-defer:arm64 (1.0.6-2build1), python3-distro-info:arm64 (0.18ubuntu0.18.04.1), python3-dev:arm64 (3.6.7-1~18.04), nvidia-l4t-jetson-io:arm64 (32.6.1-20210726122859), xserver-xorg:arm64 (1:7.7+19ubuntu7.1), python3-html5lib:arm64 (0.999999999-1), python3-cupshelpers:arm64 (1.5.11-1ubuntu2), unity-scope-firefoxbookmarks:arm64 (0.1+13.10.20130809.1-0ubuntu1), python3-webencodings:arm64 (0.5-2), update-manager-core:arm64 (1:18.04.11.23), networkd-dispatcher:arm64 (1.7-0ubuntu3.5), python3-zope.interface:arm64 (4.3.2-1build2), gedit:arm64 (3.28.1-1ubuntu1.2), libgnomeui-0:arm64 (2.24.5-3.2), python3-distutils:arm64 (3.6.9-1~18.04), system-config-printer:arm64 (1.5.11-1ubuntu2), unity-session:arm64 (3.28.1-0ubuntu3), python3-dateutil:arm64 (2.6.1-1), unity-scope-virtualbox:arm64 (0.1+13.10.20130723-0ubuntu1), gnome-control-center:arm64 (1:3.28.2-0ubuntu0.18.04.6), python3-pyxattr:arm64 (0.6.0-2build2), python3-mako:arm64 (1.0.7+ds1-1ubuntu0.2), ubuntu-pro-client:arm64 (31.2~18.04), python3-software-properties:arm64 (0.96.24.32.22), python3-icu:arm64 (1.9.8-0ubuntu1), python3-wadllib:arm64 (1.3.2-3ubuntu0.18.04.1), foomatic-db-compressed-ppds:arm64 (20180306-1), python3-xkit:arm64 (0.5.0ubuntu2), onboard-common:arm64 (1.4.1-2ubuntu1), gnome-software-plugin-snap:arm64 (3.28.1-0ubuntu4.18.04.15), update-notifier-common:arm64 (3.192.1.21), python3-macaroonbakery:arm64 (1.1.3-1), python3-pandas-lib:arm64 (0.22.0-4ubuntu1), apturl-common:arm64 (0.5.2ubuntu14.2), python3-jwt:arm64 (1.5.3+ds1-1ubuntu0.1), onboard:arm64 (1.4.1-2ubuntu1), python3-systemd:arm64 (234-1build1), ubuntu-system-service:arm64 (0.3.1), snapd:arm64 (2.58+18.04.1), update-manager:arm64 (1:18.04.11.23), ubuntu-advantage-tools:arm64 (31.2~18.04), python3-asn1crypto:arm64 (0.24.0-1), python3-protobuf:arm64 (3.0.0-9.1ubuntu1.1), python3-urllib3:arm64 (1.22-1ubuntu0.18.04.2), rhythmbox-plugin-alternative-toolbar:arm64 (0.18.0-1), python3-aptdaemon.gtk3widgets:arm64 (1.1.1+bzr982-0ubuntu19.5), language-selector-common:arm64 (0.188.3), lxsession-default-apps:arm64 (0.5.3-2ubuntu1), python3-gi-cairo:arm64 (3.26.1-2ubuntu1), gnome-software:arm64 (3.28.1-0ubuntu4.18.04.15), python3-pam:arm64 (0.4.2-13.2ubuntu4), python3-pyqt5:arm64 (5.10.1+dfsg-1ubuntu2), python3-brlapi:arm64 (5.5-4ubuntu2.0.1), python3-pip:arm64 (9.0.1-2.3~ubuntu1.18.04.8), python3-keyring:arm64 (10.6.0-1), ubuntu-session:arm64 (3.28.1-0ubuntu3), python3-wheel:arm64 (0.30.0-0.2ubuntu0.1), ubuntu-desktop:arm64 (1.417.5), python3:arm64 (3.6.7-1~18.04), python3-pyatspi:arm64 (2.26.0+dfsg-1), python3-louis:arm64 (3.5.0-1ubuntu0.5), python3-idna:arm64 (2.6-1), unity-scope-manpages:arm64 (3.0+14.04.20140324-0ubuntu3), python3-matplotlib:arm64 (2.1.1-2ubuntu3), python3-pandas:arm64 (0.22.0-4ubuntu1), unity-scope-colourlovers:arm64 (0.1+13.10.20130723-0ubuntu1), rhythmbox-plugins:arm64 (3.4.2-4ubuntu1), python3-lazr.restfulclient:arm64 (0.13.5-1), python3-sip:arm64 (4.19.7+dfsg-1ubuntu0.1), python3-six:arm64 (1.11.0-2), unity:arm64 (7.5.0+18.04.20190304-0ubuntu1), lxde:arm64 (10), orca:arm64 (3.28.0-3ubuntu1), unity-scope-zotero:arm64 (0.1+13.10.20130723-0ubuntu1), gdm3:arm64 (3.28.3-0ubuntu18.04.6), unity-lens-photos:arm64 (1.0+17.10.20170605-0ubuntu3), nautilus-extension-gnome-terminal:arm64 (3.28.2-1ubuntu1~18.04.1), python3-lazr.uri:arm64 (1.0.3-2build1), python3-numpy:arm64 (1:1.13.3-2ubuntu1), software-properties-gtk:arm64 (0.96.24.32.22), python3-uno:arm64 (1:6.0.7-0ubuntu0.18.04.13), python3-cycler:arm64 (0.10.0-1), python3-requests:arm64 (2.18.4-2ubuntu0.1), libicu-le-hb-dev:arm64 (1.0.3+git161113-4), python3-httplib2:arm64 (0.9.2+dfsg-1ubuntu0.3), unity-scope-yelp:arm64 (0.1+13.10.20130723-0ubuntu1), python3-cups:arm64 (1.9.73-2), unity-control-center:arm64 (15.04.0+18.04.20180216-0ubuntu1), python3-pyparsing:arm64 (2.2.0+dfsg1-2), apturl:arm64 (0.5.2ubuntu14.2), python3-xdg:arm64 (0.25-4ubuntu1.1), python3-pymacaroons:arm64 (0.13.0-1), apt-clone:arm64 (0.4.1ubuntu2), python3-simplejson:arm64 (3.13.2-1), apport:arm64 (2.20.9-0ubuntu7.29), rhythmbox-plugin-zeitgeist:arm64 (3.4.2-4ubuntu1), nautilus-share:arm64 (0.7.3-2ubuntu3), libharfbuzz-dev:arm64 (1.7.2-1ubuntu1), python3-pyqt5.qtwebkit:arm64 (5.10.1+dfsg-1ubuntu2), libglib2.0-dev-bin:arm64 (2.56.4-0ubuntu0.18.04.9), ubuntu-drivers-common:arm64 (1:0.8.6.3~0.18.04.2), python3-speechd:arm64 (0.8.8-1ubuntu1), blueman:arm64 (2.0.5-1ubuntu1.1), ubuntu-advantage-desktop-daemon:arm64 (1.10~18.04.1), python3-cryptography:arm64 (2.1.4-1ubuntu1.4), python3-distupgrade:arm64 (1:18.04.45), python3-debconf:arm64 (1.5.66ubuntu1), unity-scope-home:arm64 (6.8.2+16.04.20160212.1-0ubuntu3), nvidia-l4t-gputools:arm64 (32.6.1-20210726122859), ubuntu-software:arm64 (3.28.1-0ubuntu4.18.04.15), python3-update-manager:arm64 (1:18.04.11.23), ubuntu-release-upgrader-core:arm64 (1:18.04.45), lxsession:arm64 (0.5.3-2ubuntu1), python3-apport:arm64 (2.20.9-0ubuntu7.29), python3-cffi-backend:arm64 (1.11.5-1), unity-scope-openclipart:arm64 (0.1+13.10.20130723-0ubuntu1), python3-click:arm64 (6.7-3), unity-scope-calculator:arm64 (0.1+14.04.20140328-0ubuntu3), youtube-dl:arm64 (2018.03.14-1ubuntu18.04.1), indicator-bluetooth:arm64 (0.0.6+17.10.20170605-0ubuntu3), libxml2-dev:arm64 (2.9.4+dfsg1-6.1ubuntu1.9), python3-markupsafe:arm64 (1.0-1build1), ibus-table:arm64 (1.9.14-3), python3-blinker:arm64 (1.4+dfsg1-0.1), system-config-printer-udev:arm64 (1.5.11-1ubuntu2), python3-pyqt5.qtsvg:arm64 (5.10.1+dfsg-1ubuntu2), python3-decorator:arm64 (4.1.2-1), python3-lib2to3:arm64 (3.6.9-1~18.04), gedit-common:arm64 (3.28.1-1ubuntu1.2), python3-yaml:arm64 (3.12-1build2), libglib2.0-dev:arm64 (2.56.4-0ubuntu0.18.04.9), python3-pkg-resources:arm64 (39.0.1-2ubuntu0.1), compiz-gnome:arm64 (1:0.9.13.1+18.04.20180302-0ubuntu1), libgnome-2-0:arm64 (2.32.1-6), gnome-online-accounts:arm64 (3.28.0-0ubuntu2.1), dh-python:arm64 (3.20180325ubuntu2), openprinting-ppds:arm64 (20180306-1), python3-rfc3339:arm64 (1.0-4), totem-plugins:arm64 (3.26.0-0ubuntu6.2), compiz:arm64 (1:0.9.13.1+18.04.20180302-0ubuntu1), python3-dbus.mainloop.pyqt5:arm64 (5.10.1+dfsg-1ubuntu2), xorg:arm64 (1:7.7+19ubuntu7.1), libbonoboui2-0:arm64 (2.24.5-4), python3-dbus:arm64 (1.2.6-1), ibus:arm64 (1.5.17-3ubuntu5.3), python3-keyrings.alt:arm64 (3.0-1), python3-cairo:arm64 (1.16.2-1), python3-aptdaemon:arm64 (1.1.1+bzr982-0ubuntu19.5), lsb-release:arm64 (9.20170808ubuntu1), apport-gtk:arm64 (2.20.9-0ubuntu7.29), ubuntu-release-upgrader-gtk:arm64 (1:18.04.45), libgnomevfs2-common:arm64 (1:2.24.4-6.1ubuntu2), python3-gi:arm64 (3.26.1-2ubuntu1), python3-crypto:arm64 (2.6.1-8ubuntu2), ubuntu-pro-client-l10n:arm64 (31.2~18.04), python3-tk:arm64 (3.6.9-1~18.04), python3-tz:arm64 (2018.3-2), gir1.2-ibus-1.0:arm64 (1.5.17-3ubuntu5.3), python3-oauthlib:arm64 (2.0.6-1), libicu-dev:arm64 (60.2-3ubuntu3.2), python3-launchpadlib:arm64 (1.10.6-1), python3-jetson-gpio:arm64 (2.0.17), apparmor:arm64 (2.12-4ubuntu5.3), python3-oauth:arm64 (1.0.1-5), ssh-import-id:arm64 (5.7-0ubuntu1.1), python3-nacl:arm64 (1.1.2-1build1), gnome-shell:arm64 (3.28.4-0ubuntu18.04.7), openbox-lxde-session:arm64 (0.99.2-3), python3-requests-unixsocket:arm64 (0.1.5-3), python3-urwid:arm64 (2.0.1-2), aptdaemon:arm64 (1.1.1+bzr982-0ubuntu19.5), libgnomevfs2-0:arm64 (1:2.24.4-6.1ubuntu2), unity-scope-tomboy:arm64 (0.1+13.10.20130723-0ubuntu1), language-selector-gnome:arm64 (0.188.3), system-config-printer-common:arm64 (1.5.11-1ubuntu2), python3-debian:arm64 (0.1.32), printer-driver-ptouch:arm64 (1.4.2-3), python3-lxml:arm64 (4.2.1-1ubuntu0.6), gnome-terminal:arm64 (3.28.2-1ubuntu1~18.04.1), unity-scope-texdoc:arm64 (0.1+14.04.20140328-0ubuntu1), indicator-applet:arm64 (12.10.2+17.10.20170425-0ubuntu1), python3-scipy:arm64 (0.19.1-2ubuntu1), unity-scope-devhelp:arm64 (0.1+14.04.20140328-0ubuntu3), unity-scope-chromiumbookmarks:arm64 (0.1+13.10.20130723-0ubuntu1), python3-certifi:arm64 (2018.1.18-2), python3-secretstorage:arm64 (2.3.1-2), update-notifier:arm64 (3.192.1.21), python3-chardet:arm64 (3.0.4-1), python3-problem-report:arm64 (2.20.9-0ubuntu7.29), python3-colorama:arm64 (0.3.7-1), gconf2:arm64 (3.2.6-4ubuntu1), libgnome2-common:arm64 (2.32.1-6), python3-apt:arm64 (1.6.6), python3-setuptools:arm64 (39.0.1-2ubuntu0.1), python3-bs4:arm64 (4.6.0-1), python3-feedparser:arm64 (5.2.1-1), gnome-menus:arm64 (3.13.3-11ubuntu1.1), software-properties-common:arm64 (0.96.24.32.22)
End-Date: 2024-04-09 04:45:10

OK, I got what you mean.
So apparently you need at least ubuntu-desktop back.

Ok, I run sudo apt install ubuntu-desktop, but still not loads, now it gives the ok messages of running scripts in background but it appears the NVIDIA logo again and does not start.

Then you’d better re-flash it.

Hello again!, I reached the device, and it’s a MIC-730AI module, so I tried to flash using SDKManager and didn’t work, so can you help me with how can I flash it?