Ubuntu 22.04 の fcitx5-mozc に UT を導入する

Ubuntu
スポンサーリンク

20.04 に UT2 を入れる方法にそれなりのアクセスがあるようなので、今使っている UT2 の導入方法を紹介します。

と思っていたら、UTが権利関係で少し揉めていたのがアクセスの要因だったようです。新しい仕様に対応したものを作り直しました。

今は apt-src を使って自前でビルドするので問題なく動いています。

# Install Mozc UT for fcitx5
# uninstall current mozc if neeeded
sudo apt list --installed | rg fcitx | grep -o "^[^/]*" | xargs | xargs -I{} echo apt remove --allow-change-held-packages -y {} | sudo bash
sudo apt list --installed | rg mozc | grep -o "^[^/]*" | xargs | xargs -I{} echo apt remove --allow-change-held-packages -y {} | sudo bash

cd $(mktemp -d)
git clone https://github.com/utuhiro78/merge-ut-dictionaries.git
cd merge-ut-dictionaries/src/
git clone https://github.com/utuhiro78/mozcdic-ut-jawiki.git
git clone https://github.com/utuhiro78/mozcdic-ut-neologd.git
git clone https://github.com/utuhiro78/mozcdic-ut-personal-names.git
git clone https://github.com/utuhiro78/mozcdic-ut-place-names.git
git clone https://github.com/utuhiro78/mozcdic-ut-sudachidict.git
cp mozcdic-ut-*/mozcdic-ut-*.txt.tar.bz2 .
for f in mozcdic-ut-*.txt.tar.bz2; do tar xf "$f"; done
bash make.sh
cd ../..
mkdir mozc-src
cd mozc-src

sudo apt update
sudo apt install -y apt-src
apt-src update
apt-src install fcitx5
apt-src install fcitx5-mozc

cat ../merge-ut-dictionaries/src/mozcdic-ut-*.txt >> $(fd dictionary00.txt)
# Need to install a package with apt command if you get message like 
# "dpkg-checkbuilddeps: error: Unmet build dependencies: ..."
apt-src build fcitx5
apt-src build fcitx5-mozc

sudo dpkg -i fcitx5-data_*.deb
sudo dpkg -i libfcitx5utils2_*.deb
sudo dpkg -i libfcitx5config6_*.deb
sudo dpkg -i libfcitx5core7_*.deb
sudo dpkg -i libfcitx5utils2_*.deb
sudo dpkg -i fcitx5-modules_*.deb
sudo dpkg -i fcitx5-module-emoji_*.deb
sudo dpkg -i fcitx5-module-quickphrase_*.deb
sudo dpkg -i fcitx5-module-wayland_*.deb
sudo dpkg -i fcitx5-module-xorg_*.deb
sudo dpkg -i fcitx5_*.deb
sudo dpkg -i mozc-server*.deb
sudo dpkg -i mozc-data_*.deb
sudo dpkg -i fcitx-mozc-data_*.deb
sudo dpkg -i fcitx5-mozc_*.deb
sudo dpkg -i mozc-*.deb
sudo apt install -y fcitx5-config-qt
sudo apt list --installed | rg fcitx | grep -o "^[^/]*" | xargs | xargs -I{} echo apt-mark hold {} | sudo bash
sudo apt list --installed | rg mozc | grep -o "^[^/]*" | xargs | xargs -I{} echo apt-mark hold {} | sudo bash


コメント

タイトルとURLをコピーしました