のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

kali linux jp keyboard

kali linuxでキーボードがうまく設定できない。 note-pcの panasonic CF-S9、日本語配列。

$ localectl                                                        
   System Locale: LANG=en_US.UTF-8
       VC Keymap: n/a
      X11 Layout: us
       X11 Model: pc105
                                                                           
$ sudo localectl set-keymap jp106
$ sudo localectl set-keymap jp-OADG109A
                                                                           
$ localectl
   System Locale: LANG=en_US.UTF-8
       VC Keymap: jp-OADG109A
      X11 Layout: jp
       X11 Model: jp106
     X11 Options: terminate:ctrl_alt_bksp

やったけど、うまく動かない。 :が’になる。

日本語用のパッケージを入れる必要があるようだ。

WSLのUbuntu環境を日本語化する:Tech TIPS - @IT

$ sudo apt -y install language-pack-ja
E: Unable to locate package language-pack-ja

aptがupdateされてないようだ。 $ sudo apt update $sudo apt upgrade を行った。

$ sudo apt update           
Hit:1 http://linux3.yz.yamagata-u.ac.jp/pub/linux/kali kali-rolling InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
                                                                           
$ sudo apt list --upgradable
Listing... Done

UbuntuでUnable to locate packageのエラー解決法 - Qiita

$ sudo apt -y install language-pack-ja
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package language-pack-ja
                                                                           
$ cat /etc/apt/sources.list                                        100 ⨯
# See https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/
deb http://http.kali.org/kali kali-rolling main contrib non-free

# Additional line for source packages
# deb-src http://http.kali.org/kali kali-rolling main contrib non-free
                          
#手動で設定しないといけないのか。                                                 
$ dpkg-reconfigure locales
/usr/sbin/dpkg-reconfigure must be run as root
                                                                           
$ sudo dpkg-reconfigure locales                                      1 ⨯
Generating locales (this might take a while)...
  en_US.UTF-8... done
  ja_JP.UTF-8... done
Generation complete.
                                                                           
$ locale                             
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
                       
$reboot                                                    

Linux - Kali linuxでtask-japaneseがインストールできない|teratail Kali Linuxのアップデートが遅いときの対処 | NETWIZ.JP Kali Linux ver2019.4の導入と日本語化 - Qiita

f:id:none53:20210317105712p:plain
locale

localeが変わった。keyboardも治った。

$ locale
LANG=ja_JP.UTF-8
LANGUAGE=
LC_CTYPE="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_COLLATE="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_PAPER="ja_JP.UTF-8"
LC_NAME="ja_JP.UTF-8"
LC_ADDRESS="ja_JP.UTF-8"
LC_TELEPHONE="ja_JP.UTF-8"
LC_MEASUREMENT="ja_JP.UTF-8"
LC_IDENTIFICATION="ja_JP.UTF-8"
LC_ALL=
                                                                           

settings>keyboardは、こんな感じのまま。

f:id:none53:20210317110748p:plain
settings keyboard

Linux dpakgとapt-getの違い - OKWAVE

WSLのDebian環境を日本語化する:Tech TIPS - @IT

Docker debian系のlocaleを日本語化する - Qiita

もう一度、enへ戻す。 ‘‘‘ $sudo dpkg-reconfigure locale $reboot

$ locale
LANG=en_US.UTF-8 LANGUAGE= LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=

日本語キーボードでも、正しく入力できている。

‘‘‘
$ localectl list-locales             
C.UTF-8
en_US.UTF-8
ja_JP.UTF-8
‘‘‘

‘‘‘
└─$ cat /etc/default/keyboard
XKBMODEL="pc105"
XKBLAYOUT="jp"
XKBOPTIONS="terminate:ctrl_alt_bksp"
BACKSPACE="guess"
XKBVARIANT=""

Debianで利用するキーボードの種類を変更する - memo.xight.org

【Kali Linux2019.4】キーボードを日本語入力可能にする手順|悟之首領 さとるのどん|note

$ sudo apt install -y task-japanese task-japanese-desktop desktopは、いらないかもしれない。

いろんなものが、インストールされる。

$ sudo apt install -y task-japanese task-japanese-desktop
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  anthy 
  anthy-common 
  fbterm 
  firefox-esr-l10n-ja 

  fonts-ipafont
  fonts-ipafont-gothic 
  fonts-ipafont-mincho 
  fonts-liberation2
  fonts-opensymbol 
  fonts-unifont 
  fonts-vlgothic 

  gstreamer1.0-plugins-bad
  im-config 
  kasumi 
(lib略)
  libreoffice-l10n-ja 

  lv 
  m17n-db
  manpages-ja 
  manpages-ja-dev 

  mozc-data 
  mozc-server 
  mozc-utils-gui 
  
  nkf
  psf-unifont 
  python3-uno 

  tegaki-zinnia-japanese 
  timgm6mb-soundfont 

  uim
  uim-anthy 
  uim-data 
  uim-fep 
  uim-gtk2.0 
  uim-gtk2.0-immodule 
  uim-gtk3
  uim-gtk3-immodule 
  uim-mozc 
  uim-plugins 
  uim-qt5 
  uim-qt5-immodule 
  uim-xim
  
  unifont 
  uno-libs-private 
  ure 
  wamerican 
  xfonts-unifont 
  zstd
(略)
0 upgraded, 130 newly installed, 0 to remove and 0 not upgraded.
Need to get 152 MB of archives.
After this operation, 480 MB of additional disk space will be used.

(略)

Setting up firefox-esr-l10n-ja (78.8.0esr-1) ...
Setting up manpages-ja-dev (0.5.0.0.20210215+dfsg-1) ...
Setting up lv (4.51-8) ...
Setting up tegaki-zinnia-japanese (0.3-1.1) ...
Setting up anthy-common (1:0.4-2) ...
Setting up fonts-vlgothic (20200720-1) ...
Setting up fonts-liberation2 (2.1.2-2) ...
Setting up wamerican (2019.10.06-1) ...
Setting up task-japanese-desktop (3.64+kali1) ...
Setting up xfonts-unifont (1:13.0.06-1) ...
Setting up im-config (0.46-1) ...
Setting up fonts-ipafont-mincho (00303-21) ...
Setting up fonts-ipafont-gothic (00303-21) ...
Setting up mozc-data (2.26.4220.100+dfsg-4) ...
Setting up fbterm (1.7-5) ...
Setting up timgm6mb-soundfont (1.3-4) ...
Setting up nkf (1:2.1.5-1+b3) ...
Setting up zstd (1.4.8+dfsg-2.1) ...
Setting up psf-unifont (1:13.0.06-1) ...
Setting up fonts-opensymbol (2:102.11+LibO7.0.4-3) ...
Setting up kasumi (2.5-9+b1) ...
Setting up fonts-unifont (1:13.0.06-1) ...
Setting up manpages-ja (0.5.0.0.20210215+dfsg-1) ...
Setting up task-japanese (3.64+kali1) ...
Setting up mozc-server (2.26.4220.100+dfsg-4) ...
Setting up anthy (1:0.4-2) ...
Setting up mozc-utils-gui (2.26.4220.100+dfsg-4) ...
Setting up fonts-ipafont (00303-21) ...
Setting up unifont (1:13.0.06-1) ...
Setting up uim-mozc:amd64 (2.26.4220.100+dfsg-4) ...
Setting up uno-libs-private (1:7.0.4-3) ...
Setting up uim-plugins:amd64 (1:1.8.8-9) ...
Setting up gstreamer1.0-plugins-bad:amd64 (1.18.3-1+b1) ...
Setting up uim (1:1.8.8-9) ...
Setting up uim-qt5-immodule:amd64 (1:1.8.8-9) ...
Setting up uim-xim (1:1.8.8-9) ...
Setting up uim-qt5 (1:1.8.8-9) ...
Setting up uim-gtk2.0-immodule:amd64 (1:1.8.8-9) ...
Setting up uim-gtk3-immodule:amd64 (1:1.8.8-9) ...
Setting up uim-fep (1:1.8.8-9) ...
Setting up uim-anthy (1:1.8.8-9) ...
Setting up uim-gtk2.0 (1:1.8.8-9) ...
Setting up ure (1:7.0.4-3) ...
Setting up uim-gtk3 (1:1.8.8-9) ...
Setting up libreoffice-l10n-ja (1:7.0.4-3) ...
Setting up libreoffice-help-common (1:7.0.4-3) ...
Setting up libreoffice-help-ja (1:7.0.4-3) ...
Setting up python3-uno (1:7.0.4-3) ...
(略)
                                                                           
$ sudo apt update                                                                                                                   
$ sudo apt upgrade
$ reboot

anthyを選んだら、 TextEditorに日本語が入力できた。

f:id:none53:20210317120536p:plain
note japanese