CentOS 7 更新到 AlmaLinux 指令變成中文如何改回英文

今天使用 AlmaLinux 發現它指令的回應都從英文變成了中文,這樣使用實在是很不習慣。

而且使用 sudo su 的時候會發生一連串的錯誤

[[email protected]]$ sudo su
shell-init:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
shell-init:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
shell-init:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
shell-init:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
ERROR: error getting working directory name: no such file or directory
      while executing
  "pwd"
      (procedure "getAbsolutePath" line 9)
      invoked from within
  "getAbsolutePath $::argv0"
      (procedure "cmdModuleAutoinit" line 11)
      invoked from within
  "cmdModuleAutoinit"
      (procedure "module" line 325)
      invoked from within
  "module autoinit"
      ("eval" body line 1)
      invoked from within
  "eval $execcmdlist"
  Please report this issue at https://github.com/cea-hpc/modules/issues
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
sed: 無法讀取 /usr/share/Modules/init/.modulespath: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory
job-working-directory:錯誤檢索當前目錄: getcwd: 無法訪問上層目錄: No such file or directory

所以想要把它改回英文的模式,找了一下發現只要編輯 /etc/environment 新增以下兩行就可以了

LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8