LoginSignup
6
10

More than 5 years have passed since last update.

QNAP にパッケージマネージャを入れる

Last updated at Posted at 2015-01-17

(注意) この記事は古い情報です

ipkg はもうなくなったようなのでこちらの記事を参照してください。

やりたいこと

QNAP に ssh ログインすると、デフォルトのシェルが sh だったり、
lessfile コマンドもインストールされてなかったりするので、
じゃあ何か追加したいけど、 yumapt みたいなパッケージマネージャも入ってない。

QNAP 用パッケージマネージャとして Optware IPKG というやつが提供されてるので、これを利用する。

この IPKG で提供されてるパッケージ数はそんなに多くないけど、とりあえず利用したいものはあるていどそろってるぽい。

Optware IPKG インストール

Web管理画面 App Center から Optware IPKG を選択してインストールするだけ。

optware-ipkg.png

  • Optware IPKG をインストールすると /opt/share/VOLUME/.qpkg/Optware/ へのシンボリックリンクになる
  • Optware IPKG をインストールすると 通常の conf 等は /opt/etc/ の下に入る
# ipkg
ipkg: ipkg must have one sub-command argument
ipkg version 0.99.163
usage: ipkg [options...] sub-command [arguments...]
where sub-command is one of:

Package Manipulation:
  update      Update list of available packages
  upgrade     Upgrade all installed packages to latest version
  install <pkg>   Download and install <pkg> (and dependencies)
  install <file.ipk>  Install package <file.ipk>
  configure [<pkg>] Configure unpacked packages
  remove <pkg|regexp> Remove package <pkg|packages following regexp>
  flag <flag> <pkg> ... Flag package(s) <pkg>
   <flag>=hold|noprune|user|ok|installed|unpacked (one per invocation)

Informational Commands:
  list        List available packages and descriptions
  list_installed    List all and only the installed packages and description
  files <pkg>   List all files belonging to <pkg>
  search <file|regexp>    Search for a package providing <file>
  info [pkg|regexp]   Display all info for <pkg>
  status [pkg|regexp]   Display all status for <pkg>
  download <pkg>    Download <pkg> to current directory.
  compare_versions <v1> <op> <v2>
                            compare versions using <= < > >= = << >>
  print_architecture      prints the architecture.
  print_installation_architecture
  whatdepends [-A] [pkgname|pat]+
  whatdependsrec [-A] [pkgname|pat]+
  whatprovides [-A] [pkgname|pat]+
  whatconflicts [-A] [pkgname|pat]+
  whatreplaces [-A] [pkgname|pat]+
                          prints the installation architecture.

Options:
  -A                      Query all packages with whatdepends, whatprovides, whatreplaces, whatconflicts
  -V <level>               Set verbosity level to <level>. If no value is
  --verbosity <level>      provided increase verbosity by one. Verbosity levels:
                           0 errors only
                           1 normal messages (default)
                           2 informative messages
                           3 debug output
  -f <conf_file>    Use <conf_file> as the ipkg configuration file
  -conf <conf_file> Default configuration file location
        is /opt/etc/ipkg.conf
  -d <dest_name>    Use <dest_name> as the the root directory for
  -dest <dest_name> package installation, removal, upgrading.
        <dest_name> should be a defined dest name from
        the configuration file, (but can also be a
        directory name in a pinch).
  -o <offline_root> Use <offline_root> as the root directory for
  -offline <offline_root> offline installation of packages.
  -verbose_wget   more wget messages
  Force Options (use when ipkg is too smart for its own good):
  -force-depends    Make dependency checks warnings instead of errors
          Install/remove package in spite of failed dependences
  -force-defaults   Use default options for questions asked by ipkg.
        (no prompts). Note that this will not prevent
        package installation scripts from prompting.
  -force-reinstall  Allow ipkg to reinstall a package.
  -force-overwrite  Allow ipkg to overwrite files from another package during an install.
  -force-downgrade  Allow ipkg to downgrade packages.
  -force_space            Install even if there does not seem to be enough space.
  -noaction               No action -- test only
  -nodeps                 Do not follow dependences
  -force-removal-of-dependent-packages
  -recursive    Allow ipkg to remove package and all that depend on it.
  -test                   No action -- test only
  -t            Specify tmp-dir.
  --tmp-dir           Specify tmp-dir.

  regexp could be something like 'pkgname*' '*file*' or similar
  eg: ipkg info 'libstd*'  or ipkg search '*libop*' or ipkg remove 'libncur*'

パッケージのインストール

  • zsh
  • less
  • file

これらをそれぞれ # ipkg install (パッケージ名) としていったあと
インストール済みパッケージリストを表示したらこうなってた。

# ipkg list_installed
bash - 3.2.54-1 - A bourne style shell
file - 5.12-1 - Ubiquitous file identification utility.
gdbm - 1.8.3-4 - GNU dbm is a set of database routines that use extensible hashing. It works similar to the standard UNIX dbm routines.
ipkg-web - 7-7 - A web frontend for ipkg
less - 444-1 - Less file browser
ncurses - 5.7-3 - NCurses libraries
ncursesw - 5.7-2 - NCurses libraries with wide char support
readline - 6.1-2 - The GNU Readline library provides a set of functions for use by applications that allow users to edit command lines as they are
sudo - 1.8.4.5-1 - System utility to execute commands as the superuser
termcap - 1.3.1-2 - Terminal emulation library
zlib - 1.2.5-1 - zlib is a library implementing the 'deflate' compression system.
zsh - 4.3.17-1 - Zsh is a shell designed for interactive use.
Successfully terminated.

参考

6
10
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
6
10