xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

2023 最新的如何树莓派上安装中文输入法和设置中文语言环境教程 All In One

2023 最新的如何树莓派上安装中文输入法和设置中文语言环境教程 All In One

亲测有效:Raspberry Pi 3B + Raspberry Pi OS (64-bit)

desc screenshot
Raspberry Pi 3B Raspberry Pi 3B
Raspberry Pi OS (64-bit) Raspberry Pi OS (64-bit)

https://www.cnblogs.com/xgqfrms/p/17300085.html#5166108

操作步骤

  1. 安装 install

安装中文输入法 & 安装中文字体

SCIM(Smart Common Input Method )

# 安装中文输入法 chinese input ✅
$ sudo apt-get install scim-pinyin

# 安装中文字体,防止出现乱码问题
$ sudo apt-get install ttf-wqy-zenhei

# 刷新字库缓存 ❓
$ sudo fc-cache

  1. 设置 setting

设置默认语言环境

# 安装后,需要设置默认语言环境 ⚠️
# GUI 图形化配置界面  🚀
$ sudo raspi-config

选择 localization options

localization options

使用 PageDown 键,翻页到最后面;
使用 space 键,选中 zh_CN.UTF-8 UTF-8, OK 确认

设置默认的 locale 语言环境为 zh_CN.UTF-8 UTF-8, OK 确认

⚠️ 如果使用的是 macOS 上的 Terminal 出错了,需要手动关闭本地环境变量,即取消勾选

  1. 重启 reboot

重启系统

# 重启系统
$ sudo reboot
# 或者
$ sudo shutdown -r now

  1. 测试 test

测试验证

# disk free / 查看磁盘使用情况
$ df
$ df -h
$ df -Th

安装中文输入法,前 ❌
image

安装中文输入法,后 ✅
image

demos

https://www.cnblogs.com/xgqfrms/p/5355330.html#5166258

others

raspi-config command

# raspi-config 命令行界面
$ sudo raspi-config nonint <command> <arguments>

https://www.raspberrypi.com/documentation/computers/configuration.html#raspi-config-cli

切换回 en-US

# ???
$ cat /etc/profile


$ cd /etc/profile.d && ls -al
总用量 36
drwxr-xr-x   2 root root 4096  4月 10 01:31 .
drwxr-xr-x 121 root root 4096  4月 10 02:22 ..
-rw-r--r--   1 root root   95  4月 29  2019 at-dbus-fix.sh
-rw-r--r--   1 root root  726  8月 12  2020 bash_completion.sh
-rw-r--r--   1 root root  349 12月 18  2020 im-config_wayland.sh
-rw-r--r--   1 root root  324  6月  8  2022 sshpwd.sh
-rw-r--r--   1 root root 1384  2月 18  2021 vte-2.91.sh
-rw-r--r--   1 root root  966  2月 18  2021 vte.csh
-rw-r--r--   1 root root  450  7月 22  2019 wifi-check.sh

/etc/profile

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "$(id -u)" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games"
fi
export PATH

if [ "${PS1-}" ]; then
  if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "$(id -u)" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

refs

https://www.raspberrypi.com/documentation/computers/configuration.html#raspi-config

https://blog.nowcoder.net/n/d22f861d07f146c6a6a637f1d2f8bb95

https://askubuntu.com/questions/599808/cannot-set-lc-ctype-to-default-locale-no-such-file-or-directory



©xgqfrms 2012-2025

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!


posted @   xgqfrms  阅读(5614)  评论(7编辑  收藏  举报
相关博文:
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· NetPad:一个.NET开源、跨平台的C#编辑器
· PowerShell开发游戏 · 打蜜蜂
· 凌晨三点救火实录:Java内存泄漏的七个神坑,你至少踩过三个!
历史上的今天:
2022-04-10 如何在 Apple Mac 上获得 IP 地址 All In One
2022-04-10 Custom HTML5 Video Download All-in-One
2021-04-10 DOM & window & document & html & body All In One
2021-04-10 how to using js get window bind events length
2021-04-10 how to using js get addEventListener bind events length
2020-04-10 MongoDB 101
2020-04-10 Regular Expressions All In One
点击右上角即可分享
微信分享提示