CentOS 7 /RHEL 7: How To Change The System Locale
2016-03-28 11:23
411 查看
The system localeare used to control the language setting of system services and the UI before the user logs in. How Do I change the default system locale in CentOS 7 linux system? How to check the current locate setting under centos 7 or RHEL 7 ? How to get the list of all available locales in current linux system? In this post you will see that how to set the system locale.
Output:
Example: If you want to select a EN_US locale, then you can list all EN_US locales by issue the following command:
Outputs:
Edit “/etc/locale.conf” file using “vim” command and search “LANG” line and change its value as what you want to select the locale. such as: change locale to “en_us.iso88591″.vim /etc/locale.conf
Before:
After:
Save and exit the above configuration file and reboot the system, then the changes will take effect.
# Set the system locale via localectl command
To set the default system locale, you can use the following command:
you need to replace the locale name as you want to select the locale.
Example: changing the default locale to german locale, issue the following command:
Outputs:
Note:you must log on the system with root user to run localectl command .
CentOS 7/ RHEL 7 Check Current System Locale Settings
To show the current locale settings, you can view the “/etc/locale.conf” configuration file via “cat /etc/locale.conf” command or issue the following “localectl status” command.1 2 3 | cat / etc / locale.conf OR localectl status |
1 2 3 4 5 6 | [ root @ devops ~ ] # cat /etc/locale.conf LANG =es_US.utf8 [ root @ devops ~ ] # localectl status System Locale: LANG =es_US.utf8 VC Keymap: us X11 Layout: us |
CentOS 7 / RHEL 7 List All Available Locales
Before changing the system locale, you must know that which locales are available on the current system, issue the following command:localectl list-locales |
localectl list-locales | grep en_US |
1 2 3 4 5 | [ root @ devops ~ ] # localectl list-locales | grep en_US en_US en_US.iso88591 en_US.iso885915 en_US.utf8 |
CentOS 7 / RHEL Change The System Locale
There are two ways to change the system locale by through modifying the “/etc/locale.conf” configuration file or using a new command “localect” which is newly added in centos 7 or RHEL 7 operating system.Edit “/etc/locale.conf” file using “vim” command and search “LANG” line and change its value as what you want to select the locale. such as: change locale to “en_us.iso88591″.vim /etc/locale.conf
Before:
LANG =es_US.utf8 |
LANG =en_US.iso88591 |
# Set the system locale via localectl command
To set the default system locale, you can use the following command:
localectl set-locale LANG = < locale name > |
Example: changing the default locale to german locale, issue the following command:
localectl set-locale LANG =de_DE.UTF- 8 |
1 2 3 4 5 | [ root @ devops ~ ] # localectl set-locale LANG=de_DE.UTF-8 [ root @ devops ~ ] # localectl status System Locale: LANG =de_DE.UTF- 8 VC Keymap: us X11 Layout: us |
相关文章推荐
- 配置Linux日志文件
- linux下的 fork vfork和clone函数
- linux随生成机数
- Linux ulimit 系统资源控制
- linux 下 pac 使用
- linux 下 pac 使用
- Linux date命令
- Linux配置SSH免密码登陆
- linux 多线程的实现的基本原理
- linux c socket 并发 服务端
- Linux内核时间管理相关的接口
- 高性能Linux服务器 第11章 构建高可用的LVS负载均衡集群
- linux第六周
- CentOS下Radius服务器搭建
- Linux中的 僵尸进程 和 孤儿进程
- 在 Linux 上构建一个 RADIUS 服务器
- 【linux】修改纯终端下键盘映射
- 一起来学Makefile、make
- linux 基础命令
- Linux――JDK的部署