1

My ubuntu terminal is not opening for unknown reasons. The last thing I remember is that I removed the old snap using this link. My terminal starts and suddenly crashes without showing any error. Things that I've tried:

  • I tried reinstalling gnome-terminal using grub safe-mode and entering root.
  • I tried the following command using alt+f2:

env SHELL=/bin/sh gnome-terminal

and I was able to open the terminal (not bash shell though). Now if I run bash I get the following error:

bash: VIRTUAL_ENV: unbound variable

I don't remember changing anything related to python or virtualenvs, or changing .bashrc or .profile. Now I'm stuck and I can't use bash. Even the TTY terminals are not working (jumps back to login after login).

If you need any extra information, please let me know. Thanks in advance.

  • @David No, I don't think that I have removed gnome. That script only removes "disabled" snaps. I still have gnome when I run "snap list". – Amin Kashiri Oct 27 '22 at 14:41
  • @David if the OP had removed the `gnome-terminal` application, they would get a `command not found` error and wouldn't be able to open the terminal at all (here, they _can_ but it crashes) and also wouldn't be able to run `sh` manually which they have done. – terdon Oct 28 '22 at 15:09
  • @AminKashiri if `SHELL=/bin/sh gnome-terminal` works, you have an error in your bash initialization files. Please [edit] your question and post the output of running `grep VIRTUAL_ENV ~/.bashrc ~/.bash_profile ~/.profile ~/bash.login ~/.bash_aliases /etc/bash.bashrc /etc/profile /etc/profile.d/* /etc/environment 2> /dev/null` (you can run this in the terminal you open with `SHELL=/bin/sh gnome-terminal`). If that returns nothing, we will need to see the full contents of your `~/.bashrc` file. – terdon Oct 28 '22 at 15:11

0 Answers0