Log.log(work)

いろんな作業メモ

CentOS7にzipが入っていなかった件

環境 VM上のCentOS7 ※ホストOSはWindows

検証用のCentOSにzipコマンドが含まれているスクリプトを動かしたら

zip: コマンドが見つかりません

え?入ってないんかい。

$ yum list installed | grep zip
bzip2-libs.x86_64                     1.0.6-13.el7                     @anaconda
gzip.x86_64                           1.5-8.el7                        @anaconda

ほんとに入ってなかった。

yumでインストールできるかinfoオプションをつけて確認。

$ sudo yum --enablerepo=epel,remi,rpmforge info zip
読み込んだプラグイン:fastestmirror
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * epel: ae.mirror.rasanegar.com
 * extras: ftp.iij.ad.jp
 * updates: centos.usonyx.net
利用可能なパッケージ
名前                : zip
アーキテクチャー    : x86_64
バージョン          : 3.0
リリース            : 11.el7
容量                : 260 k
リポジトリー        : base/7/x86_64
要約                : A file compression and packaging utility compatible with
                    : PKZIP
URL                 : http://www.info-zip.org/Zip.html
ライセンス          : BSD
説明                : The zip program is a compression and file packaging
                    : utility.  Zip is analogous to a combination of the UNIX
                    : tar and compress commands and is compatible with PKZIP (a
                    : compression and file packaging utility for MS-DOS
                    : systems).
                    :
                    : Install the zip package if you need to compress files
                    : using the zip program.

お、あるある。

じゃあインストール。

$ sudo yum install zip
読み込んだプラグイン:fastestmirror
base                                                     | 3.6 kB     00:00
extras                                                   | 3.4 kB     00:00
updates                                                  | 3.4 kB     00:00
updates/7/x86_64/primary_db                                | 2.2 MB   00:00
Loading mirror speeds from cached hostfile
 * base: ftp.iij.ad.jp
 * extras: ftp.iij.ad.jp
 * updates: centos.usonyx.net
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> パッケージ zip.x86_64 0:3.0-11.el7 を インストール
--> 依存性解決を終了しました。

依存性を解決しました

================================================================================
 Package        アーキテクチャー  バージョン              リポジトリー     容量
================================================================================
インストール中:
 zip            x86_64            3.0-11.el7              base            260 k

トランザクションの要約
================================================================================
インストール  1 パッケージ

総ダウンロード容量: 260 k
インストール容量: 796 k
Is this ok [y/d/N]: y
Downloading packages:
zip-3.0-11.el7.x86_64.rpm                                  | 260 kB   00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  インストール中          : zip-3.0-11.el7.x86_64                           1/1
  検証中                  : zip-3.0-11.el7.x86_64                           1/1

インストール:
  zip.x86_64 0:3.0-11.el7

完了しました!

p.s. unzipも入ってなかった。。。