LoginSignup
4

More than 3 years have passed since last update.

Amazon Linux2にyumでMeCabが入らなかった

Posted at

はじめに

https://github.com/neologd/mecab-ipadic-neologd
の手順に従って、 Amazon Linux2にMeCabをインストールしようとしたところ、以下のエラーが発生しました。

実行したコマンド
$ sudo rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm
$ sudo yum install mecab mecab-devel mecab-ipadic git make curl xz patch
エラーメッセージ
http://packages.groonga.org/centos/2/x86_64/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found

解決策

エラーメッセージ中のURLにAmazon Linuxのバージョン「2」が入っているっぽいのでCentOSの最新バージョンである「7」に変えてみます。

具体的には、/etc/yum.repos.d/groonga.repoの以下の部分を

/etc/yum.repos.d/groonga.repo
baseurl=http://packages.groonga.org/centos/$releasever/$basearch/

以下のように変えました。

/etc/yum.repos.d/groonga.repo(更新後)
baseurl=http://packages.groonga.org/centos/7/$basearch/

その後以下をもう一度実行するとエラーは出ず

$ sudo yum install mecab mecab-devel mecab-ipadic git make curl xz patch

MeCabも実行できました。

$ mecab
アデリーペンギンかわいい
アデリーペンギン        名詞,一般,*,*,*,*,*
かわいい        形容詞,自立,*,*,形容詞・イ段,基本形,かわいい,カワイイ,カワイイ
EOS

おわりに

これが正しい方法なのかはわかりません。
ソースからビルドするのが無難だと思います。

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
4