How to set LC_ALL for systemwide changes?

本文介绍如何在Red Hat Enterprise Linux 7中永久设置LC_ALL环境变量,以实现系统范围内的语言和区域设置更改。通过修改/etc/environment文件,可以在系统重启后保持这些设置不变。

https://access.redhat.com/solutions/3533681

How to set LC_ALL for systemwide changes?

 SOLUTION UNVERIFIED - 已更新 2018年七月19日02:20 - 

English 

环境

  • Red Hat Enterprise Linux 7

问题

  • How to set LC_ALL in Red Hat Enterprise Linux 7?

  • How to set LC_ALL to persist after system reboot?

决议

  • Append LC_ALL and the required locale to /etc/environment file and log out for the changes to take effect.

For Example:

Raw

[root@example ~]# locale 
LANG=en_AU.UTF-8
LC_CTYPE="en_AU.UTF-8"
LC_NUMERIC="en_AU.UTF-8"
LC_TIME="en_AU.UTF-8"
LC_COLLATE="en_AU.UTF-8"
LC_MONETARY="en_AU.UTF-8"
LC_MESSAGES="en_AU.UTF-8"
LC_PAPER="en_AU.UTF-8"
LC_NAME="en_AU.UTF-8"
LC_ADDRESS="en_AU.UTF-8"
LC_TELEPHONE="en_AU.UTF-8"
LC_MEASUREMENT="en_AU.UTF-8"
LC_IDENTIFICATION="en_AU.UTF-8"
LC_ALL=

[root@example ~]# cat /etc/locale.conf 
LANG="en_AU.UTF-8"

  • To set LC_ALL=en_US.UTF-8 append this entry in /etc/environment

Raw

[root@example ~]# cat /etc/environment 
LC_ALL=en_US.UTF-8

Logout and then log in for the effect to take place

Raw

[root@example ~]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
  • This changes can also be performed in /etc/locale.conf however, the Lang parameter will not change and if the output of #localecommand is checked, it will show the original value. To avoid confusion, it is better to modify /etc/environment
1. Metadata key 首次开机创建: fscrypt_mount_metadata_encrypted read_key  retrieveOrGenerateKey generateStorageKey storeKeyAtomically //建立备份 非首次开机读取: fscrypt_mount_metadata_encrypted read_key retrieveOrGenerateKey retrieveKey //若读取失败从备份中再读取,记录埋点 2. Device key 首次开机创建: fbeEnable fscrypt_initialize_systemwide_keys retrieveOrGenerateKey generateStorageKey storeKeyAtomically //建立备份 非首次开机读取: fbeEnable fscrypt_initialize_systemwide_keys retrieveOrGenerateKey retrieveKey //若读取失败从备份中再读取,记录埋点 3. user_key de 首次开机创建: init_user_0 fscrypt_init_user0 create_and_install_user_keys generateStorageKey storeKeyAtomically //建立备份 非首次开机读取: init_user_0 fscrypt_init_user0 load_all_de_keys retrieveKey //若读取失败从备份中再读取,记录埋点 4. user_key ce 首次开机创建: init_user_0 fscrypt_init_user0 create_and_install_user_keys generateStorageKey storeKeyAtomically //建立备份 非首次开机读取: storageManager.unlockuserkey fscrypt_unlock_user_key read_and_install_user_ce_key read_and_fixate_user_ce_key retrieveKey //若读取失败从备份中再读取 ,记录埋点 fscrypt_clear_user_key_auth fscrypt_rewrap_user_key  //用于在用户添加解锁密码或删除解锁密码时 retrieveKey  //若读取失败从备份中再读取,记录埋点 你看我这个调用关系对不对,如果对的话,转换为表格,其中竖排为这四种key,横排分别为首次开机创建、非首次开机读取、备注。其中首次开机创建栏包含创建它的函数,非首次开机栏读取包括读取它的函数,备注栏包含备份存储位置的选择,是否需要备份
08-27
# Configuration for systemwide password quality limits # Defaults: # # Number of characters in the new password that must not be present in the # old password. # difok = 5 # # Minimum acceptable size for the new password (plus one if # credits are not disabled which is the default). (See pam_cracklib manual.) # Cannot be set to lower value than 6. # minlen = 6 # # The maximum credit for having digits in the new password. If less than 0 # it is the minimum number of digits in the new password. # dcredit = 1 # # The maximum credit for having uppercase characters in the new password. # If less than 0 it is the minimum number of uppercase characters in the new # password. # ucredit = 1 # # The maximum credit for having lowercase characters in the new password. # If less than 0 it is the minimum number of lowercase characters in the new # password. # lcredit = 1 # # The maximum credit for having other characters in the new password. # If less than 0 it is the minimum number of other characters in the new # password. # ocredit = 1 # # The minimum number of required classes of characters for the new # password (digits, uppercase, lowercase, others). # minclass = 2 # # The maximum number of allowed consecutive same characters in the new password. # The check is disabled if the value is 0. # maxrepeat = 0 # # The maximum number of allowed consecutive characters of the same class in the # new password. # The check is disabled if the value is 0. # maxclassrepeat = 0 # # Whether to check for the words from the passwd entry GECOS string of the user. # The check is enabled if the value is not 0. # gecoscheck = 0 # # Path to the cracklib dictionaries. Default is to use the cracklib default. # dictpath =
10-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值