Showing posts with label Lubuntu. Show all posts
Showing posts with label Lubuntu. Show all posts

Sunday, March 03, 2024

How to fix error: No module named 'apt_pkg' on Ubuntu 18.04

 Ubuntu 18.04 has python3.6.x installed but after install python3.8 and used "update-alternatives" to change the default python3 to python3.8, got the following error when running unknown command on the terminal

$ dummyyycommand  
    from CommandNotFound import CommandNotFound
  File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 19, in
    from CommandNotFound.db.db import SqliteDatabase
  File "/usr/lib/python3/dist-packages/CommandNotFound/db/db.py", line 5, in
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

This is caused because python3.8 cannot load "apt_pkg.cpython-36m-x86_64-linux-gnu.so"

$ cd /usr/lib/python3/dist-packages; ls -al | grep apt
drwxr-xr-x   4 root root   4096 Mar  3 22:23 apt
drwxr-xr-x   4 root root   4096 Jun  1  2021 aptdaemon
-rw-r--r--   1 root root  51576 Dec  1  2022 apt_inst.cpython-36m-x86_64-linux-gnu.so
-rw-r--r--   1 root root    227 Dec  1  2022 apt_inst.pyi
-rw-r--r--   1 root root 346784 Dec  1  2022 apt_pkg.cpython-36m-x86_64-linux-gnu.so
-rw-r--r--   1 root root   8900 Dec  1  2022 apt_pkg.pyi
drwxr-xr-x   3 root root   4096 Mar  3 22:23 aptsources
-rw-r--r--   1 root root    226 Dec  1  2022 python_apt-1.6.6.egg-info

To fix this issue:


To fix this issue just create a link named 'apt_pkg.so' points to "/usr/lib/python3/dist-packages/apt_pkg.cpython-36m-x86_64-linux-gnu.so"

$ cd /usr/lib/python3/dist-packages
$ sudo ln -s apt_pkg.cpython-36m-x86_64-linux-gnu.so  apt_pkg.so

Saturday, June 03, 2023

Lubuntu 20.04で日本語入力

Lubuntu 20.04 は少し古い (・・・現時点(2023年)ではかなり古い?)Distroで日本語入力の設定(fcitx-mozc)で上手く動かすことができない.おそらく繰り返してupdate/upgradeしていたが,fcitxは開発が止まっているため,不具合が出ているかもしれない・・(この記事によれば)

上記の記事に従って fcitxではなくfcitx5とfcitx5-mozcをインストールしたら上手く日本語入力ができるようになった

実施手順:

下記のコマンドで表示される古いfcitx関連パッケージをすべて削除(apt remove)

% apt search "^fcitx" | grep installed

その後,上記の記事の手順に従ってfcitx5-mozcをインストール

% sudo add-apt-repository ppa:ikuya-fruitsbasket/fcitx5

% sudo apt install fcitx5 fcitx5-mozc

後は下記のようにmozcをInput Methodに追加しCtrl + Spaceで入力を切り替えれば日本語入力できるようになる




Friday, May 20, 2022

Bring back taskbar to the default one after accidentally changed it in Lubuntu

Default lxpanel setting: /usr/share/lxpanel/profile/Lubuntu/panels/panel 

So just need to copy it to: ~/.config/lxpanel/Lubuntu/panels/panel