中国地域のクイックセットアップ
この記事は中国本土のユーザーを対象としており、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 入力メソッドまたは別のサードパーティ入力メソッドを使用したい場合は、公式 Web サイトから 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 キーを使用して「OK」を選択し、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 を完全に体験してください。
関連記事
- インストール後のセットアップ — 一般的なインストール後の構成ガイド
- ソフトウェアのインストール — apt、Snap、Flatpak、およびその他のソフトウェアのインストール方法の詳細ガイド
- 入力方式の構成 — 入力方式フレームワークの詳細な構成とトラブルシューティング