关于Putty显示中文的问题

本文介绍如何为Ubuntu 18.04系统配置中文环境。首先更换国内源以提高下载速度,接着安装中文语言包并设置系统语言环境为中文。通过这些步骤确保系统支持中文显示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一般unbuntu里面没有安装中文包,所以第一步先进行换源,然后在下载 中文包会比较快

    第一步,换源

        

Ubuntu 18.04换国内源

编辑/etc/apt/sources.list文件, 在文件最前面添加以下条目(操作前请做好相应备份):

 

阿里源

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

然后执行命令:

sudo apt-get update
sudo apt-get upgrade 

更新好了之后

第二步:安装中文包

sudo apt-get install  language-pack-zh-han*

安装好了之后重启服务器

reboot unbuntu

在运行代码进行 修改文件

这样启动终端的时候就是选UTF-8的编码了,然后设置/etc/environment
sudo vi /etc/environment
然后在PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"下面添加
LANGUAGE="zh_CN:zh:en_US:en"
LC_ALL=zh_CN.UTF-8
LANG=zh_CN

然后去Putty里面进行设置

然后再

然后open 就可以了

如图所示

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值