How to reinstall OS if bash not installed

Hi, I was successfully using Ubuntu 18.04.3 on the TX2 and while trying to install ROS-Melodic I ran into some broken package errors which eventually led me to accidentally uninstalling bash (and also Ubuntu-desktop). Now when the TX2 boots up it gives various errors and the only option is to log in and then give password. After login there is an error saying “Cannot execute /bin/bash: no such file or directory” and it logs me out immediately.

The SDK Manager seems to expect Ubuntu 18 to be working properly before flashing a new OS, but how do you reset the TX2 if there is not a working OS? Is there some way to factory reset? I have a flash drive ready with an image (formatted as Ext4) to install Ubuntu 18 but the TX2 ignores it on startup.

You can flash at any time, but this will erase/reset everything. If you happen to have ssh available, and your host PC is running a GUI, then you might try ssh forwarding to bring up an alternate terminal (e.g., “lxterm” or “uxterm” or “xterm”).

Example of running “xterm” from a remote system if your user name is “ubuntu” and the remote IP is “192.168.55.2”:
ssh -Y ubuntu@192.168.55.2 xterm

That should bring up a terminal on your host PC. From there:
sudo apt-get install bash

The micro-B USB cable is used for flash, and if you need information on flashing, just ask…but I’m thinking simply remote package install of bash will be easier for you.

The SDK Manager seems to expect Ubuntu 18 to be working properly before flashing a new OS, but how do you reset the TX2 if there is not a working OS? Is there some way to factory reset? I have a flash drive ready with an image (formatted as Ext4) to install Ubuntu 18 but the TX2 ignores it on startup.

I am little confused by your description. If you are tying to install the “sdk”, then you need to have a working OS on tegra. For example, the cuda package installation.

However, if you are talking about re-flashing the board, then it has nothing to do with the OS running on jetson. When putting the device into recovery mode, the OS is not even up, sdkmanager would not know what was installed your tegra.

So we need to know what error did you hit during flash.

Thank you both for your responses.

@linuxdev - The system would allow me to SSH but it would immediately kick me out of the session.

@WayneWWW - I was confused because I was flashing the board through the “SDK Manager” interface. I ended up exploring U-boot and digging through forums for a few hours to change the boot order to first try SD card&USB. In the end I just tried flashing it again over the micro-usb with the flash script from the terminal instead of with the SDK Manager. I believe that the times I had tried it before I simply didn’t enter recovery mode correctly.

I see. This error would be gone after your re-flash. Have you tried it?

Yes, I was able to re-flash correctly and then everything was fine.