중국 지역 빠른 설정
이 문서는 Ubuntu 26.04을 설치한 후 필요한 모든 현지화 구성을 통합하는 중국 본토 사용자를 대상으로 합니다. 중국에서 최적의 사용을 위해 시스템을 신속하게 조정하려면 다음 단계를 따르십시오.
중국 미러 소스로 전환
Ubuntu의 기본 소프트웨어 소스 서버는 해외에 위치하여 중국에서의 접속 속도가 느립니다. 가정용 미러로 전환하면 소프트웨어 설치 및 업데이트 속도가 크게 향상될 수 있습니다.
권장 미러 소스
| 미러 사이트 | 주소 | 메모 |
|---|---|---|
| 알리바바 클라우드 | mirrors.aliyun.com | 안정적이고 빠릅니다. 대부분의 사용자에게 권장 |
| 칭화대학교 | mirrors.tuna.tsinghua.edu.cn | 교육 네트워크 사용자를 위한 최고의 선택 |
| USTC | mirrors.ustc.edu.cn | 교육 네트워크 사용자에게 권장됩니다. |
변경 방법
Ubuntu 26.04은 소스 구성 파일에 DEB822 형식을 사용합니다.
# Back up the original source configuration
sudo cp /etc/apt/sources.list.d/ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources.bak
# Replace with Alibaba Cloud mirror using sed
# (cn\.)? matches both cn.archive.ubuntu.com and archive.ubuntu.com, avoiding invalid domains
# Only the hostname is replaced; the http/https protocol is left unchanged
sudo sed -i -E 's|(cn\.)?archive.ubuntu.com|mirrors.aliyun.com|g' /etc/apt/sources.list.d/ubuntu.sources
sudo sed -i -E 's|security.ubuntu.com|mirrors.aliyun.com|g' /etc/apt/sources.list.d/ubuntu.sources
# To use the Tsinghua mirror instead:
# sudo sed -i -E 's|(cn\.)?archive.ubuntu.com|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/ubuntu.sources
# sudo sed -i -E 's|security.ubuntu.com|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list.d/ubuntu.sources
# To use the USTC mirror:
# sudo sed -i -E 's|(cn\.)?archive.ubuntu.com|mirrors.ustc.edu.cn|g' /etc/apt/sources.list.d/ubuntu.sources
# sudo sed -i -E 's|security.ubuntu.com|mirrors.ustc.edu.cn|g' /etc/apt/sources.list.d/ubuntu.sources
# Update the package index
sudo apt updateUbuntu 설치 중에 중국 시간대를 선택한 경우 설치 프로그램이 cn.archive.ubuntu.com을 자동으로 구성했을 수 있지만 해당 주소는 최상의 속도를 제공하지 못할 수 있습니다. 위에 나열된 미러 사이트 중 하나로 수동으로 전환하는 것이 좋습니다.
중국어 언어 팩 설치
시스템 인터페이스, 날짜 형식, 정렬 규칙 등이 완전히 현지화되도록 완전한 중국어 지원을 설치하십시오.
# Install Chinese language packs
sudo apt install language-pack-zh-hans language-pack-gnome-zh-hans -y
# Generate the Chinese locale
sudo locale-gen zh_CN.UTF-8
# Set the system default language to Chinese
sudo update-locale LANG=zh_CN.UTF-8 LANGUAGE=zh_CN:zh
# Log out and log back in for the settings to take effect영어 인터페이스를 유지하고 중국어 입력 방법을 사용하려는 경우 update-locale 단계를 건너뛰고 언어 팩만 설치할 수 있습니다.
중국어 입력 방법 구성
Ubuntu 26.04은 중국어 입력 엔진과 쌍을 이루는 Fcitx5 입력 방법 프레임워크를 권장합니다.
Fcitx5 설치
# Install Fcitx5 core and Chinese input engine
sudo apt install fcitx5 fcitx5-chinese-addons fcitx5-frontend-gtk3 fcitx5-frontend-gtk4 fcitx5-frontend-qt5 -y
# Install the configuration tool
sudo apt install fcitx5-config-qt -y기본 입력 방법으로 설정
# Set Fcitx5 as the default input method framework
im-config -n fcitx5환경 변수 구성
26.04의 Wayland 그래픽 세션에서는 일반적으로 im-config -n fcitx5이면 충분합니다. 입력 방법 환경 변수는 im-config에 의해 자동으로 처리되므로 수동 설정은 일반적으로 필요하지 않습니다. ~/.bashrc에 변수를 쓰는 것은 GNOME 그래픽 세션에도 영향을 미치지 않습니다(그래픽 세션은 ~/.bashrc을 읽지 않습니다). 특정 응용 프로그램이 중국어를 입력할 수 없는 경우에만 수동으로 설정하십시오.
수동으로 설정해야 하는 경우 시스템 그래픽 세션에 적용되는 /etc/environment에 기록합니다.
# Write the input method environment variables to /etc/environment (applies to the graphical session)
sudo tee -a /etc/environment << 'EOF'
# Fcitx5 input method environment variables
XMODIFIERS=@im=fcitx
QT_IM_MODULE=fcitx
# Under Wayland, GTK apps usually don't need GTK_IM_MODULE;
# uncomment the next line only if some GTK app can't accept input
# GTK_IM_MODULE=fcitx
EOF로그아웃했다가 다시 로그인한 후 시스템 트레이에서 Fcitx5 아이콘을 찾아 마우스 오른쪽 버튼을 클릭하고 “구성”을 선택한 다음 “병음” 입력 방법을 추가하세요. 중국어와 영어 간 전환을 위한 기본 단축키는 Ctrl+Space입니다.
Sogou 입력 방법이나 다른 타사 입력 방법을 선호하는 경우 해당 공식 웹사이트에서 Linux .deb 패키지를 다운로드할 수 있습니다. 그러나 Fcitx5에 내장된 병음 입력 방법은 이미 우수하여 클라우드 병음, 사전 가져오기 등을 지원합니다. 먼저 시도해 볼 가치가 있습니다.
중국어 글꼴 설치
Ubuntu의 기본 중국어 글꼴 범위는 포괄적이지 않습니다. 다음 글꼴 패키지를 설치하는 것이 좋습니다.
# Install Noto CJK fonts (by Google, covering all CJK characters)
sudo apt install fonts-noto-cjk fonts-noto-cjk-extra -y
# Install WenQuanYi fonts
sudo apt install fonts-wqy-microhei fonts-wqy-zenhei -y
# Refresh the font cache
fc-cache -fv설치 후 “설정 - 모양”에서 원하는 중국어 글꼴을 선택할 수 있습니다.
시간대 설정
설치 중에 시간대가 올바르게 설정되지 않은 경우 수동으로 설정할 수 있습니다.
# Check the current timezone
timedatectl
# Set to the Shanghai timezone (China Standard Time)
sudo timedatectl set-timezone Asia/Shanghai
# Confirm the timezone has been changed
dateWindows 및 Ubuntu을 이중 부팅하는 경우 시간 비동기 문제가 발생할 수 있습니다. 수정 사항:
# Make Ubuntu treat the hardware clock as local time (consistent with Windows)
sudo timedatectl set-local-rtc 1공통 소프트웨어 설치
브라우저
# Firefox is pre-installed (Snap version)
# Install Google Chrome
wget -q -O /tmp/chrome.deb "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
sudo apt install /tmp/chrome.deb -y오피스 스위트
# LibreOffice is pre-installed; install the Chinese language pack
sudo apt install libreoffice-l10n-zh-cn -y
# Install WPS Office (download the .deb package from the official website)
# Visit https://linux.wps.cn/ to download, then install
# sudo apt install ./wps-office_*.deb -y채팅 애플리케이션
# Install WeChat (Snap version)
sudo snap install wechat-universal
# Install QQ (download from the official website)
# Visit https://im.qq.com/linuxqq/ to download the .deb package
# sudo apt install ./linuxqq_*.deb -y오디오 및 비디오
# Install VLC media player
sudo apt install vlc -y
# Install multimedia codecs
sudo apt install ubuntu-restricted-extras -yubuntu-restricted-extras을 설치하면 EULA 계약 확인 화면이 나타납니다. Tab 키를 사용하여 “확인”을 선택하고 Enter를 눌러 확인합니다.
네트워크 환경 구성
Git 중국용 가속
# Use a GitHub mirror (if direct GitHub access is slow)
git config --global url."https://ghfast.com/https://github.com/".insteadOf "https://github.com/"npm 미러
# Set npm to use the Taobao mirror
npm config set registry https://registry.npmmirror.com핍 미러
# Set pip to use the Tsinghua mirror
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn시스템 프록시 설정
HTTP 프록시를 구성해야 하는 경우:
# Temporary setting (valid for current terminal only)
export http_proxy="http://127.0.0.1:7890"
export https_proxy="http://127.0.0.1:7890"
# Permanent setting (written to ~/.bashrc)
cat >> ~/.bashrc << 'EOF'
export http_proxy="http://127.0.0.1:7890"
export https_proxy="http://127.0.0.1:7890"
export no_proxy="localhost,127.0.0.1,192.168.0.0/16"
EOF“설정 - 네트워크 - 네트워크 프록시”에서 GUI를 통해 프록시를 구성할 수도 있습니다.
올인원 명령 요약
다음 명령은 이 문서의 모든 주요 작업을 요약합니다. 필요에 따라 복사하여 실행할 수 있습니다. 한 번에 모든 것을 붙여넣기보다는 단계별로 실행하여 각 단계의 출력을 관찰하는 것이 좋습니다.
# 1. Switch mirror sources (using Alibaba Cloud as an example; (cn\.)? also matches cn.archive.ubuntu.com)
sudo sed -i -E 's|(cn\.)?archive.ubuntu.com|mirrors.aliyun.com|g' /etc/apt/sources.list.d/ubuntu.sources
sudo sed -i -E 's|security.ubuntu.com|mirrors.aliyun.com|g' /etc/apt/sources.list.d/ubuntu.sources
sudo apt update
# 2. Install Chinese language packs
sudo apt install language-pack-zh-hans language-pack-gnome-zh-hans -y
sudo locale-gen zh_CN.UTF-8
sudo update-locale LANG=zh_CN.UTF-8 LANGUAGE=zh_CN:zh
# 3. Install Chinese input method
sudo apt install fcitx5 fcitx5-chinese-addons fcitx5-frontend-gtk3 fcitx5-frontend-gtk4 fcitx5-frontend-qt5 fcitx5-config-qt -y
im-config -n fcitx5
# 4. Install Chinese fonts
sudo apt install fonts-noto-cjk fonts-noto-cjk-extra fonts-wqy-microhei fonts-wqy-zenhei -y
fc-cache -fv
# 5. Set timezone
sudo timedatectl set-timezone Asia/Shanghai
# 6. Install common software
sudo apt install vlc ubuntu-restricted-extras libreoffice-l10n-zh-cn -y
wget -q -O /tmp/chrome.deb "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
sudo apt install /tmp/chrome.deb -y
# 7. Configure development tool mirrors (as needed)
# npm config set registry https://registry.npmmirror.com
# pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple위 구성을 완료한 후 로그아웃했다가 다시 로그인하여 전체 중국어 Ubuntu 환경을 즐기세요.