UNIXやLinux: 2014年5月アーカイブ

CentOS 用の Auto installation プログラムはなかったので、
の内容どおりに手動インストールを行ってみた。

Step 1: Installation Prerequisite Steps

HPLIP のリリースノートを確認しろと。
HP OfficeJet 100 Mobile L411 は、Ver 3.11.3 の時にマージされたようだ。故にOK!

Step 2: Install Dependency Packages

A. Install the development environment.

まず、開発ツールがインストールされてるか確認しろって。
Gnome のメニューから「アプリケーション」→「ソフトウェアの追加/削除」を選択。
「ブラウズ」タブで「開発」を選び、「開発ツール」にチェックが付いていることを確認。バッチリよ。

B. Install the HPLIP dependencies.

HPLIP のインストールに依存性のあるソフトウェアのインストール。

# yum -y -d 10 -e 1 install cups cups-devel gcc-c++ ghostscript libjpeg-devel glibc-headers libtool libusb-devel make python python-devel PyXML openssl-devel net-snmp-devel policycoreutils-gui PyQt PyQt-devel dbus-python notify-python sane-backends sane-backends-devel sane-frontends xsane python-imaging python-imaging-devel
<略>
Dependency Installed:
  beecrypt.x86_64 0:4.1.2-10.1.1                             beecrypt-devel.x86_64 0:4.1.2-10.1.1               
  e2fsprogs-devel.x86_64 0:1.39-36.el5_9                     elfutils-devel.x86_64 0:0.137-3.el5                
  elfutils-devel-static.x86_64 0:0.137-3.el5                 elfutils-libelf-devel.x86_64 0:0.137-3.el5         
  elfutils-libelf-devel-static.x86_64 0:0.137-3.el5          gnutls-devel.x86_64 0:1.4.1-14.el5_10              
  gphoto2.i386 0:2.2.0-3.el5                                 gphoto2-devel.x86_64 0:2.2.0-3.el5                 
  hpijs.x86_64 1:1.6.7-6.el5_6.1                             hplip.x86_64 0:1.6.7-6.el5_6.1                     
  keyutils-libs-devel.x86_64 0:1.2-1.el5                     krb5-devel.x86_64 0:1.6.1-71.el5_10.1              
  lcms.x86_64 0:1.18-0.1.beta1.el5_3.2                       libexif.i386 0:0.6.21-1.el5_8                      
  libexif-devel.x86_64 0:0.6.21-1.el5_8                      libgcrypt-devel.x86_64 0:1.4.4-7.el5_10            
  libgpg-error-devel.x86_64 0:1.4-2                          libieee1284.i386 0:0.2.9-4.el5                     
  libieee1284.x86_64 0:0.2.9-4.el5                           libieee1284-devel.x86_64 0:0.2.9-4.el5             
  libmng.x86_64 0:1.0.9-5.1                                  libsane-hpaio.x86_64 0:1.6.7-6.el5_6.1             
  libselinux-devel.x86_64 0:1.33.4-5.7.el5                   libsepol-devel.x86_64 0:1.15.2-3.el5               
  lm_sensors.x86_64 0:2.10.7-9.el5                           lm_sensors-devel.x86_64 0:2.10.7-9.el5             
  net-snmp.x86_64 1:5.3.2.2-22.el5_10.1                      net-snmp-libs.i386 1:5.3.2.2-22.el5_10.1           
  nspr-devel.x86_64 0:4.10.2-2.el5_10                        nss-devel.x86_64 0:3.15.3-4.el5_10                 
  qt.x86_64 1:3.3.6-26.el5                                   rpm-devel.x86_64 0:4.4.2.3-34.el5                  
  sane-backends-libs.i386 0:1.0.18-5.el5                     sane-backends-libs.x86_64 0:1.0.18-5.el5           
  sip.x86_64 0:4.4.5-3                                       sip-devel.x86_64 0:4.4.5-3                         
  sqlite-devel.x86_64 0:3.3.6-7                              tix.x86_64 1:8.4.0-11.fc6                          
  tkinter.x86_64 0:2.4.3-56.el5                              zlib-devel.x86_64 0:1.2.3-7.el5                    

Complete!

66個もインストールされた。

C. Pre Installation Step(s)

すでに HPLIP がインストールされていれば、予め削除しておく。

# rpm -ev --nodeps libsane-hpaio
# rpm -ev hplip-gui
error: package hplip-gui is not installed

hplip-gui は入ってないんだな。

# rpm -ev hplip
error: Failed dependencies:
        libhpip.so.0()(64bit) is needed by (installed) hpijs-1.6.7-6.el5_6.1.x86_64
        hplip = 1.6.7-6.el5_6.1 is needed by (installed) hpijs-1.6.7-6.el5_6.1.x86_64

ん???hpijs に依存関係があるのか。先に hpijs を削除すっか。

# rpm -ev hpijs
error: Failed dependencies:
        hpijs = 1:1.6.7-6.el5_6.1 is needed by (installed) hplip-1.6.7-6.el5_6.1.x86_64

そうか、hpijs は先に hplip 消さないと駄目なんやね!・・・って、おい!!(^^;

こういう時は、

# rpm -ev hplip hpijs

こうか!

D. Link the libcrypto library. By default they are not linked as needed for HPLIP.

HPLIP は libcrypto.so を参照するので、バージョン付きの名前のファイルを libcrypto.so という名前にシンボリックリンクする。

# ls -la /lib/libcrypto.so*
-rwxr-xr-x 1 root root 1298276 Jan 29 16:37 /lib/libcrypto.so.0.9.8e
lrwxrwxrwx 1 root root      19 May 23 20:13 /lib/libcrypto.so.6 -> libcrypto.so.0.9.8e
# ln -s /lib/libcrypto.so.0.9.8e /lib/libcrypto.so

Step 3: Disable SELinux

インストール時は SELinux を無効に。
俺は最初から無効にしてるので(セキュリティ厨に叱られる~(笑))問題無し。

# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted

Step 4: Download HPLIP

A. Click here to Download the Regular Tarball

hplip-3.14.4.tar.gz をダウンロード。(wget で直接取っちゃう)

# wget http://prdownloads.sourceforge.net/hplip/hplip-3.14.4.tar.gz
--2014-05-24 18:28:42--  http://prdownloads.sourceforge.net/hplip/hplip-3.14.4.tar.gz
Resolving prdownloads.sourceforge.net... 216.34.181.59
Connecting to prdownloads.sourceforge.net|216.34.181.59|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://downloads.sourceforge.net/project/hplip/hplip/3.14.4/hplip-3.14.4.tar.gz [following]
--2014-05-24 18:28:43--  http://downloads.sourceforge.net/project/hplip/hplip/3.14.4/hplip-3.14.4.tar.gz
Resolving downloads.sourceforge.net... 216.34.181.59
Reusing existing connection to prdownloads.sourceforge.net:80.
HTTP request sent, awaiting response... 302 Found
Location: http://jaist.dl.sourceforge.net/project/hplip/hplip/3.14.4/hplip-3.14.4.tar.gz [following]
--2014-05-24 18:28:43--  http://jaist.dl.sourceforge.net/project/hplip/hplip/3.14.4/hplip-3.14.4.tar.gz
Resolving jaist.dl.sourceforge.net... 150.65.7.130, 2001:df0:2ed:feed::feed
Connecting to jaist.dl.sourceforge.net|150.65.7.130|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 21414140 (20M) [application/x-gzip]
Saving to: `hplip-3.14.4.tar.gz'

100%[======================================================================>] 21,414,140  3.75M/s   in 5.5s    

2014-05-24 18:28:48 (3.68 MB/s) - `hplip-3.14.4.tar.gz' saved [21414140/21414140]

# ls -la hplip-3.14.4.tar.gz
-rw-r--r-- 1 root root 21414140 Apr  9 02:04 hplip-3.14.4.tar.gz

B. Go to the directory where you downloaded the HPLIP tarball.

はいはい。

C. Uncompress the tarball.

# tar xvfz hplip-3.14.4.tar.gz
<略>
hplip-3.14.4/prnt/ps/hp-color_laserjet_m855-ps.ppd.gz
hplip-3.14.4/prnt/ps/hp-laserjet_400_m401-ps.ppd.gz
hplip-3.14.4/prnt/__init__.py

D. Change your working directory to the hplip-3.14.4 directory.

# cd hplip-3.14.4

Step 5: Configure HPLIP for installation

CentOS のバージョン(5.X or 6.X)と、CPU の処理ビット数(32bit or 64bit)別にコンフィグ内容が違うので注意。
うちは、64bit の CentOS 5.X ユーザなので、それ用のコンフィグを実行。

# ./configure --prefix=/usr --with-hpppddir=/usr/share/cups/model/HP --libdir=/usr/lib64 --enable-qt3 --disable-qt4 --disable-hpcups-install --disable-cups-drv-install --disable-cups-ppd-install --enable-hpijs-install --enable-foomatic-drv-install --enable-foomatic-ppd-install --enable-foomatic-rip-hplip-install --disable-fax-build --disable-dbus-build --enable-network-build --enable-scan-build --disable-policykit --enable-libusb01_build --enable-udev_sysfs_rules --enable-doc-build
<略>
config.status: creating hplip.list
config.status: creating data/policykit/com.hp.hplip.service
config.status: executing depfiles commands
config.status: executing libtool commands

うむ。特にエラーは出ていないようだ。

Step 6: Run Make

「root で実行すんなよ!」って注意書きあるけど、ユーザが俺しかいない CentOS 環境なので、全部 root のままでやっちゃう。
こういうの、何がなんでも「危ないから駄目」とか言う人いるけど、ケース・バイ・ケースですよ(笑)

# make
<略>
libtool: link: g++ -DAPDK_DJ660 -DAPDK_DJ6xx -DAPDK_DJ6xxPhoto -DAPDK_DJ8xx -DAPDK_DJ9xx -DAPDK_DJ9xxVIP -DAPDK_DJ630 -DAPDK_APOLLO2XXX -DAPDK_APOLLO21XX -DAPDK_APOLLO2560 -DAPDK_DJ600 -DAPDK_DJ350 -DAPDK_DJ8x5 -DAPDK_PSP100 -DAPDK_AUTODUPLEX -DAPDK_HIGH_RES_MODES -DAPDK_LJMONO -DAPDK_DJ540 -DAPDK_DJ850 -DAPDK_DJ890 -DAPDK_DJ3320 -DAPDK_LJCOLOR -DAPDK_DJGENERICVIP -DAPDK_LJJETREADY -DAPDK_LJFASTRASTER -DAPDK_BUFFER_SEND -DAPDK_LDL_COMPRESS -DAPDK_EXTENDED_MEDIASIZE -DAPDK_MLC_PRINTER -DAPDK_DJ3600 -DAPDK_LJZJS_MONO -DAPDK_LJZJS_COLOR -DAPDK_LJM1005 -DAPDK_QUICKCONNECT -DAPDK_LITTLE_ENDIAN -DAPDK_AUTO_INCLUDE -DAPDK_LINUX -DNDEBUG -g -O2 -DCONFDIR=\"/etc/hp\" -o hppgsz hppgsz-PrinterProperties.o  ./.libs/libapdk.a -ljpeg -ldl -lcrypto

特にエラーは出ずに終了。

Step 7: Run Make Install

問題なさそうなのでインストールを行う。

# make install
<略>
make[2]: Leaving directory `/home/shinoda/hplip-3.14.4'
make[1]: Leaving directory `/home/shinoda/hplip-3.14.4'

エラー出ず終了。

Step 8: Post Installation Step(s)

A. For normal users other than root add user name to "lp" and "sys" group:

プリンタを使うユーザを、lp, sys グループに参加させる。

# grep lp /etc/group
lp:x:7:daemon,lp
# grep ^sys /etc/group
sys:x:3:root,bin,adm
# /usr/sbin/usermod -a -G lp,sys hogehoge
# grep lp /etc/group
lp:x:7:daemon,lp,hogehoge
# grep ^sys /etc/group
sys:x:3:root,bin,adm,hogehoge

そして、PC の再起動か、ユーザの再ログオンを。

Gnome のアプリーケーションメニューに「アクセサリ」→「HP Device Manager」というのが追加されている。

20140525_printer1.jpg

B. If you are going to be setting up a printer with USB and the printer is already plugged in, you will need to do one of the following:

最初からプリンタを認識していたので、USB ケーブルを抜き差ししたりは不要だった。

Step 9: Configuring your printer using hp-setup

と、Step 8 までは問題なく作業が進んだが、最後の最後に信じられないことが!!

「hp-setup が実行出来ねえ!!!」

いい加減にしろ、ヒューレット・パッカード!!

hp-setup を実行すると、

warning: python-dbus not installed.
warning: Fax setup disabled - Python 2.3+ required.

というエラー(ワーニングだけど)が出て、最終的に、

warning: Fax setup disabled - Python 2.3+ required.

となってプリンタ設定画面が先に進めなくなるのである。

なんじゃ、こりゃ。

ちなみに、Python は python-2.4.3 が入っているし、dbus-python-0.70-9 も入っている。
そう、どうやら python-dbus ではなく、CentOS のパッケージ名は dbus-python なのに、ヒューレット・パッカードが誤って指定しているようである。

海外の掲示板サイトでもそのことを指摘している人がいたが、回答は「ヒューレット・パッカードが責任を負わないフリーソフトなんだから、自力でなんとかせい」であった。

やっぱ、プリンタはキヤノンかエプソンの二択ですよ、実際。
Linux でヒューレット・パッカード製のプリンタを使うためのソフトウェア HP Linux Imaging and Printing を、自動インストーラで入れようと試みたのだが・・・

yum で入るという記事もチラっと見たので、験しに yum でインストールを試みるも、これは駄目だった(^^;
ま、予想してたけど(^^;

# yum -y install hp-setup
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: ftp.riken.jp
 * extras: ftp.riken.jp
 * updates: ftp.riken.jp
Setting up Install Process
No package hp-setup available.
Nothing to do

で、自動インストーラで入れようと思ったんだけど、対象 Distribution に CentOS は含まれてないんだよね。
ま、Red Hat Enterprise Linux と中身一緒だから・・・と、

Distribution:
Red Hat Enterprise Linux

Version:
5.0

Printer Type:
Officejet/Officejet Pro

Printer Model:
HP Officejet 100 Mobile l411

と指定してインストーラをダウンロード。

で、hplip-3.14.4.run を実行してみる。

# chmod 755 hplip-3.14.4.run
# ./hplip-3.14.4.run
Creating directory hplip-3.14.4
Verifying archive integrity... All good.
Uncompressing HPLIP 3.14.4 Self Extracting Archive.........<略>
warning: hplip-install should not be run as root.

HP Linux Imaging and Printing System (ver. 3.14.4)
HPLIP Installer ver. 5.1

Copyright (c) 2001-13 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Installer log saved in: hplip-install_Sat-24-May-2014_15:35:48.log

\error: You are running the installer as root. It is highly recommended that you run the installer as
error: a regular (non-root) user. Do you still wish to continue?

なんか、root で実行するなと怒られたんだけど・・・
一般ユーザで実行しろってことだけど、プリンタ関係のドライバも入れるんなら、root 権限でなきゃ駄目やろ?sudo で実行しろってことかな?
取り敢えずメッセージは無視して先に進む。

Continue with installation (y=yes, n=no*, q=quit) ? y

note: Defaults for each question are maked with a '*'. Press <enter> to accept the default.
error: Auto installation is not supported for 'centos' distro so all dependencies may not be installed. 
Please install manually as mentioned in 'http://hplipopensource.com/hplip-web/install/manual/index.html' web-site

Press 'y' to continue auto installation. Press 'n' to quit auto instalation(y=yes, n=no*): n
Installation exit

CentOS は Auto installation には対応していないと怒られた(^^;
RHEL も CentOS も一緒じゃん!!

ま、仕方ないのでインストーラを抜ける。

悲しい・・・

ググると、↓ここに手動で CentOS に HPLIP をインストールする方法が書いてあった。

じゃ、手動でやり直すか。
しかし、今日は山口県立美術館の浮世絵展に行きたい。
でも、こっちも気になる。さて、どうすっかな。
Linux 版の Firefox のプラグイン検索機能は使えないので(エラーにはならないが、検索結果はいつも Not Found)、手動でインストールする必要がある。

まあ、
このページの「Flash プラグインを手動でインストールする」に書いてあるとおりにやればインストールできるんだけど。
(ちなみに、何故かうちの環境だと、インストール後に Firefox を起動するとエラーが出て、CentOS の再起動まで要求されたけど(^^;)

で、無事 YouTube なんかも CentOS 上で見れるようになったのだが、何故か音が小さい。
Gnome のボリュームコントロールを最大までスライドさせるとやっと普通に音が聞こえるようになるんだけど、真ん中あたりまで下げると完全に音が聞こえなくなる。
つまり、全体的に音が小さめなんだよなあ・・・(↓動画参照)


VMware の設定画面も見てみたが、サウンドカードの選択くらいしかサウンド関係の設定はないようだが・・・

ちなみに、「てんかすトリオ」はたまたま YouTube のトップページにリンクがあっただけで、ファンとか、そういうんじゃありません!(^^;

VMware Player で「簡易インストール」を使いインストールした CentOS は俗にいう「英語モード」になっている。
なので、手動で日本語化してやる必要あり。

20140524_vm9.jpg

まずは、キーボードが US タイプになっているので、JP タイプに設定を変更する。
修正するのは、/etc/sysconfig/keyboard と /etc/X11/xorg.conf の2ファイル。

# cp /etc/sysconfig/keyboard /etc/sysconfig/keyboard.20140524
# vi /etc/sysconfig/keyboard
# diff /etc/sysconfig/keyboard /etc/sysconfig/keyboard.20140524
2c2
< KEYTABLE="jp106"
---
> KEYTABLE="us"

# cp /etc/X11/xorg.conf /etc/X11/xorg.conf.20140524
# vi /etc/X11/xorg.conf
# diff /etc/X11/xorg.conf /etc/X11/xorg.conf.20140524
14,15c14,15
<       Option      "XkbModel" "jp106"
<       Option      "XkbLayout" "jp"
---
>       Option      "XkbModel" "pc105"
>       Option      "XkbLayout" "us"

ファイルの修正をしたら、仮想マシンのリブートを行う。
(よく考えたら、Gnome の設定画面から変更できた気がする(^^;)

次に、yum で日本語環境に関連するパッケージを一括インストールする。

# yum -y groupinstall "Japanese Support"
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* base: ftp.riken.jp
* extras: ftp.riken.jp
* updates: ftp.riken.jp
Setting up Group Process
<略>
Running Transaction
 Installing     : scim-libs                                               1/19 
 Installing     : scim                                                    2/19 
 Installing     : scim-bridge                                             3/19 
 Installing     : anthy                                                   4/19 
 Installing     : kasumi                                                  5/19 
 Installing     : Virtualization-ja-JP                                    6/19 
 Installing     : scim-bridge-gtk                                         7/19 
 Installing     : man-pages-ja                                            8/19 
 Installing     : fonts-japanese                                          9/19 
 Installing     : Deployment_Guide-ja-JP                                 10/19 
 Installing     : anthy                                                  11/19 
 Installing     : perl-NKF                                               12/19 
 Installing     : nkf                                                    13/19 
 Installing     : Global_File_System-ja-JP                               14/19 
 Installing     : scim-bridge-gtk                                        15/19 
 Installing     : scim-anthy                                             16/19 
 Installing     : Cluster_Administration-ja-JP                           17/19 
 Installing     : lv                                                     18/19 
 Installing     : kcc                                                    19/19 
<略>

Complete!

インストールが終了したら、ユーザ設定に日本語設定を追加。

.bash_profile の最後に、

LANG=ja_JP.UTF-8
export LANG

を追加するのだ。

そして、一旦ログオフしてから、再びログオンすると 画面は日本語化されている・・・はずだったのだが、漢字が出てない(^^;
(ひらがなとカタカナは表示されてる)

20140524_nihongo1.jpg

フォント設定画面を確認すると、フォント一覧に日本語フォントが出てこない。
どうも、日本語フォント(fonts-japanese)はインストールされているのに、Gnome にそれが認識されていないようだ。

そこで、手動でフォントリストに追加を行う。

# fc-cache -fv
/usr/share/fonts: caching, 0 fonts, 7 dirs
/usr/share/fonts/bitmap-fonts: caching, 31 fonts, 0 dirs
<略>
/usr/share/fonts/japanese: caching, 0 fonts, 2 dirs
/usr/share/fonts/japanese/TrueType: caching, 2 fonts, 0 dirs
/usr/share/fonts/japanese/misc: caching, 84 fonts, 0 dirs
/usr/share/fonts/liberation: caching, 12 fonts, 0 dirs
/usr/share/fonts/liberation: failed to write cache
/usr/share/X11/fonts/Type1: caching, 29 fonts, 0 dirs
/usr/share/X11/fonts/Type1: failed to write cache
/usr/share/X11/fonts/OTF: skipping, no such directory
/root/.fonts: skipping, no such directory
/var/cache/fontconfig: cleaning cache directory
/root/.fontconfig: not cleaning unwritable cache directory
fc-cache: failed

なんか、fc-cache: failed とか出てるけど・・・

しかし、再度フォント設定画面を開いてみると、ちゃんと「さざなみ」フォントが表示されている。

20140524_nihongo2.jpg

そこで「さざなみゴシック」を選択し、ログオンし直すと、ちゃんと漢字も表示されるようになっていたのであった。

20140524_nihongo3.jpg

めでたし、めでたし。

このアーカイブについて

このページには、2014年5月以降に書かれたブログ記事のうちUNIXやLinuxカテゴリに属しているものが含まれています。

前のアーカイブはUNIXやLinux: 2014年2月です。

次のアーカイブはUNIXやLinux: 2014年9月です。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。


月別 アーカイブ

電気ウナギ的○○ mobile ver.

携帯版「電気ウナギ的○○」はこちら