LoginSignup
24
20

More than 3 years have passed since last update.

nkfコマンドをインストールする

Last updated at Posted at 2018-09-12

MacにHomebrewでインストールする

  • 環境
    • macOS BigSurバージョン11.1
    • Homebrew 3.0.0
# まずはアップデートして
$ brew update
Updated 2 taps (homebrew/core and homebrew/cask).
#...省略...

# お医者さんに健康を見てもらって
$ brew doctor
Your system is ready to brew.

# インストールするものを検索して
$ brew search nkf
==> Formulae
nkf

# インストールする
$ brew install nkf
==> Downloading https://homebrew.bintray.com/bottles/nkf-2.1.5.big_sur.bottle.tar.gz
######################################################################## 100.0%
==> Pouring nkf-2.1.5.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/nkf/2.1.5: 7 files, 385.4KB

# インストールできた
$ nkf --version
Network Kanji Filter Version 2.1.5 (2018-12-15) 
Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa).
Copyright (C) 1996-2018, The nkf Project.

Windows10にzipでインストールする

  • 環境
    • OS : Windows10 64bit
    • Git Bash : 2.18.0
  1. Vectorのサイト から nkfwin.zipをダウンロードする
  2. nkfwin.zipを展開する
  3. 任意の場所に配置する
  4. .bash_profileにPATHを通す
# 3. 任意の場所に配置する
## nkf専用ディレクトリを作る
$ mkdir /c/app/nkf
## 必要なものだけコピーする
$ cp ~/Downloads/nkfwin/vc2005/win32\(98\,Me\,NT\,2000\,XP\,Vista\,7\)Windows-31J/nkf32.exe /c/app/nkf/
$ find /c/app/nkf/
/c/app/nkf/
/c/app/nkf/nkf32.exe

# 4. .bash_profileにPATHを通す
$ vi ~/.bash_profile
## --以下を追記する----------------------------------------------------------------
NKF="/c/app/nkf/"
PATH=$PATH:$NKF
## ------------------------------------------------------------------
## 設定を反映する
$ source ~/.bash_profile

# インストールできた
$ nkf32 -v
Network Kanji Filter Version 2.1.1 (2010-08-08)
Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa).
Copyright (C) 1996-2010, The nkf Project.

CentOS7にyumでインストールする

  • 環境
    • CentOS Linux release 7.7.1908 (Core)
    • yum 3.4.3
  1. EPELリポジトリがインストールされているかを確認する
    • インストールされていない場合は、sudo yum install epel-releaseでインストールする。
  2. yumでインストールする
# 1. EPELリポジトリがインストールされているかを確認する
$ sudo yum list installed epel*
Loaded plugins: fastestmirror, ovl
Repository google-chrome is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: ty1.mirror.newmediaexpress.com
 * epel: nrt.edge.kernel.org
 * extras: ty1.mirror.newmediaexpress.com
 * updates: ty1.mirror.newmediaexpress.com
Installed Packages
epel-release.noarch                7-12                        @epel
## インストールされていた
$ 


# 2. yumでインストールする(「-y」オプションは、「問い合わせすべてにYesと答える」ということ)
$ sudo yum install -y nkf --enablerepo=epel
Loaded plugins: fastestmirror, ovl
Repository google-chrome is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: ty1.mirror.newmediaexpress.com
 * epel: nrt.edge.kernel.org
 * extras: ty1.mirror.newmediaexpress.com
 * updates: ty1.mirror.newmediaexpress.com
Resolving Dependencies
--> Running transaction check
---> Package nkf.x86_64 1:2.1.3-5.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================================================================================================================================
 Package                                               Arch                                                     Version                                                          Repository                                              Size
==============================================================================================================================================================================================================================================
Installing:
 nkf                                                   x86_64                                                   1:2.1.3-5.el7                                                    epel                                                   135 k

Transaction Summary
==============================================================================================================================================================================================================================================
Install  1 Package

Total download size: 135 k
Installed size: 293 k
Downloading packages:
nkf-2.1.3-5.el7.x86_64.rpm                                                                                                                                                                                             | 135 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:nkf-2.1.3-5.el7.x86_64                                                                                                                                                                                                   1/1 
  Verifying  : 1:nkf-2.1.3-5.el7.x86_64                                                                                                                                                                                                   1/1 

Installed:
  nkf.x86_64 1:2.1.3-5.el7                                                                                                                                                                                                                    

Complete!

# インストールされた
$ nkf --version
Network Kanji Filter Version 2.1.3 (2013-11-22) 
Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa).
Copyright (C) 1996-2013, The nkf Project.
24
20
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
24
20