最近在安装各种乱七八糟的开发环境,有一次重启机器后打不开ubuntu自带的终端terminal了,也就是gnome-terminal无法打开,无论是检查python版本,还是更换语言环境都不行。

原因:最后找到一个博客上的方法解决了,原因是可能之前在locale上加了LC_ALL=C,或者是编码问题。
LC_ALL=C的作用是为了去除所有本地化的设置,让命令能正确执行。

操作:

1、首先安装一个其他终端,sudo apt install terminator,使用terminator启动gnome-terminal命令提示如下的错误:

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 8

2、选择想要的编码:
使用命令sudo dpkg-reconfigure locales添加一遍你想要的编码
在这里插入图片描述
3、去掉 export LC_ALL=C。

# 进入locale去掉export LC_ALL=C
sudo gedit /etc/default/locale

去掉之后如下图,然后重启电脑:
在这里插入图片描述

参考网址:https://blog.csdn.net/Mr__G/article/details/54092532

GitHub 加速计划 / term / terminal
94.53 K
8.17 K
下载
The new Windows Terminal and the original Windows console host, all in the same place!
最近提交(Master分支:1 个月前 )
494bc5bd Closes #17505 3 天前
36f064cf The settings UI and settings model allow you to set the icon to "none" to hide the icon (you can actually see this effect in the settings UI when changing the value of the profile icon). However, during settings validation, "none" is considered a file path, which is then failed to be parsed, resulting in the icon being marked as invalid and immediately clearing the value. This PR fixes this issue by considering "none" to be an accepted value during validation. Related to #15843 Closes #17943 ## Validation Steps Performed When an icon is set to "none", ... ✅ no more warning ✅ the icon is hidden 3 天前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐