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.
I got the following error while doing so:
[email protected]:~# 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
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:
[email protected]:~# 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!
35 thoughts on “[Solved] Terminal not opening – Ubuntu”
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.
It worked perfectly fine. Thanks. Had to use VS code terminal to chmod the gnome-terminal and then edit it to 3.6
Can you explain how did you do that? I installed VNC server, now terminal will not launch unless I reboot pc.
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 🙂
Thanks It worked for me.
Thanks, it works for me
Yup, that worked for me too: changing to #!/usr/bin/python3.6
It works… we faced same problem for python 3.6 to 3.7 and we resolve the problem with your instruction.
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.
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!
How did you update it ?
I use pycharm terminal :))))
worked, thanks man
Worked for me too! thx!
thanks it woooooorked.
Thank you so much, this worked for me.
thanks a lot. I searched a lot but nothing worked except this.
Sorry but not surprisingly, it didnt work for me as python3 is a symbolic link.
it is showing cannot open instead of done
It works for me too but I had to restart.
Another way iresolved is set python2 instead of python3 in /usr/bin/gnome-terminal
Don’t try too hard..
just right click on your desktop and click on open terminal and see the magin 🙂
I can’t believe it!! I thought it was a joke but really saved my precious time.
Thanks a bunch.
Ok, so what’s the actual magic behind it? How does it work?
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
Thanks. The GUI for grub-customizer now working, too.
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
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
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!
uncommenting the below statement in ~/.vnc/xstartup solved the problem
Running from root desktop, had incorrect environmental $LANG set (en_US) from .bashrc, fixed by correcting and logging in/out. Thanks for the tip.