[Solved] Terminal not opening – Ubuntu

I was facing this problem on my PC yesterday (This is an updated post, this yesterday is long back!!). I had to use Xterm instead of Gnome Terminal. I searched a lot on Internet and finally got a solution.

Error details are pasted below:

Unable to access the Terminal session.

Accessed Xterm and executed the following command to access the Gnome Terminal manually.

gnome-terminal

I got the following error while doing so:

root@Work-station:~# gnome-terminal

(process:2689): Gtk-WARNING **: Locale not supported by C library.
        Using the fallback 'C' locale.

Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Error calling StartServiceByName for org.gnome.Terminal: GDBus.Error:org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.gnome.Terminal exited with status 9

Solution

This post was published on Jan, 2018. Please see Jishnu's comment below if the solution mentioned here is not working!! In case of any issues, please comment. Our team will reply or update the post as soon as possible.

I tried to update the Gnome Terminal. However, that didn’t work. Finally I had to purge “locale-gen” on the system to fix the problem with Gnome Terminal.

Executed the following command:

locale-gen --purge
root@Work-station:~# locale-gen --purge
Generating locales (this might take a while)...
  en_AG.UTF-8... done
  en_AU.UTF-8... done
  en_BW.UTF-8... done
  en_CA.UTF-8... done
  en_DK.UTF-8... done
  en_GB.UTF-8... done
  en_HK.UTF-8... done
  en_IE.UTF-8... done
  en_IN.UTF-8... done
  en_NG.UTF-8... done
  en_NZ.UTF-8... done
  en_PH.UTF-8... done
  en_SG.UTF-8... done
  en_US.UTF-8... done
  en_ZA.UTF-8... done
  en_ZM.UTF-8... done
  en_ZW.UTF-8... done
Generation complete.

Yup, try to access the Gnome Terminal now!
Let me know if you have any questions.

If you are interested in new technologies please read about how Prometheus helps on monitoring. All these docs are under this category, Prometheus. Stay tuned! Please do follow the LinkedIn page. I will update and we can continue discussion there!

Post navigation

Arunlal A

Senior System Developer at Zeta. Linux lover. Traveller. Let's connect! Whether you're a seasoned DevOps pro or just starting your journey, I'm always eager to engage with like-minded individuals. Follow my blog for regular updates, connect on social media, and let's embark on this DevOps adventure together! Happy coding and deploying!

35 thoughts on “[Solved] Terminal not opening – Ubuntu

  1. i am click on terminal,but it will not open ,how can i fix this, i already try above command,can u suggest me how can i fix it.

    1. It worked perfectly fine. Thanks. Had to use VS code terminal to chmod the gnome-terminal and then edit it to 3.6

      1. Can you explain how did you do that? I installed VNC server, now terminal will not launch unless I reboot pc.

  2. Hello Arunlal,
    I was getting python errors while opening the terminal using XTerm. I tried the fix you mentioned but unfortunately it could not fix the issue. The good news I could at last find solution and it’s given below.
    Recently I upgraded Python and I think that caused the issue. I upgraded it to Python 3.6 (here in the shebang line you should mention 3.5)
    I have modified the below file:

    sudo vim /usr/bin/gnome-terminal
    Modify the first line from #!/usr/bin/python to #!/usr/bin/python3.5

    Try to start the terminal now 🙂

    1. Thank you.
      It works… we faced same problem for python 3.6 to 3.7 and we resolve the problem with your instruction.

    2. This was the key. I upgraded to python3.7 and changed the symlinks to set this as default python3, and this broke the terminal. So specifically setting python3.5 fixed the issue.
      Thanks!

      1. Oops! Actually, it didn’t work. But it gave the right hint. python3.6 was the right option for my Ubuntu 18.04.
        Also, instead of changing the header of the file, I used update-alternatives to set python3.6 by default.
        Thanks again for giving the right hint!

    1. I can’t believe it!! I thought it was a joke but really saved my precious time.
      Thanks a bunch.

  3. Hi,

    I’ll share my experience. Not sure if the cause was the same as yours but it’s worth to document.

    In my case, I just had installed a new version of python: in this case python 3.8.
    The thing is I still had python 3.6 installed and, after some browsing, saw that the best solution was to have both python 3 versions and to switch the one used by means of the “update-alternatives –configg python3” command.

    After I reverted the “default” to 3.6, terminal works normally

  4. I think which to be logic and most approved solution is to :
    open the python installation file with ==> sudo gedit /usr/bin/gnome-terminal
    this will open a python file and replace python 3 with python 3.6 in the first line #!usr….python3.6

  5. Jishnu’s solution worked for me when Terminal wouldn’t open after clicking the icon in Ubuntu 20.04.1 LTS. I had to download Xterm from Ubuntu Software Updater (red suitcase with ‘A’ on it) since I couldn’t modify the read only file gnome-terminal. Then type
    cd /usr
    cd /bin
    sudo gedit gnome-terminal
    Then add .8 to Python3 in the first line since I upgraded to Python version 3.8 (which is what I originally needed to run matplotlib), Save and then Voila, it worked!

  6. Running from root desktop, had incorrect environmental $LANG set (en_US) from .bashrc, fixed by correcting and logging in/out. Thanks for the tip.

Leave a Reply

Your email address will not be published. Required fields are marked *