Opengist

Explore

  • All gists
  • Topics
  • Users
Give feedback on the new UI Powered by Opengist ⋅ 17ms

user:thomas gists created by user

title:mygist gists with given title

description:sync gists with given description

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

all:systemctl search all fields

Login
s

system-settings

Recently created Least recently created Recently updated Least recently updated

timmy / 設定與啟用 en_US.UTF-8 語言環境

Last active 6 hours ago automation bash environment linux locale system-settings utf-8

此腳本啟用 en_US.UTF-8 語言環境,更新 locale.gen,並將環境變數寫入 .bashrc 以確保設定持久化,適用於國際化與多語系支援。

1 0 0 1
1 #!/bin/bash
2
3 # 啟用 en_US.UTF-8 語言環境
4 echo "啟用 en_US.UTF-8 語言環境..."
5 sudo sed -i '/^# en_US.UTF-8 UTF-8/s/^# //' /etc/locale.gen
6 sudo locale-gen
7
8 # 設定語言環境變數
9 echo "設定語言環境變數..."
10 export LANG=en_US.UTF-8