LoginSignup
15
16

More than 1 year has passed since last update.

ARM 系 QNAP に git/php7/golang などをパッケージでコマンドインストールする [Entware で Opkg 編]

Last updated at Posted at 2019-01-02

QNAP®NASgit や PHP7 や Golang をインストールしたい

と、思うも「App Center」にないので困った。Python3 はあるのに。筆者の QNAP マシンがショボい(TS-110P+, ARMv5, メモリ 512MB)ため QNAP 用のコンテナ環境「Container Station」も入れられない仕様で、どうしよう。(棒読み)

Docker は諦めるにしても、gcc make も入ってないし。git くらいは簡単にインストールできる apt yum brew のような CLI 版のパッケージマネージャーはないものか

  • 検証機器:OS: QTS 4.3.3, TS119P+, 1ベイ, Marvell ARMv5(ARMADA 300/Feroceon 88F6282, 2010年11月発売モデル)

TL; DR(概要)

opkg コマンドで、gitipk パッケージをインストールしてどうか。

2018年版 Entware(Entware-std)QPKG アプリをインストールすると使えるようになります。

ffmpeg は v4.3.1、php-cli は v7.4.12、go(golang) は v1.15.5 が入っちゃいますよ。(2021/01/27 現在)

  • 準備

    1. 「アプリジポジトリ」にリポジトリ XML ファイルを追加する。
    2. 更新後、「Entware-std」を「App Center」からインストールする。
    3. QNAP 本体に SSH 経由で接続する。
  • opkg コマンドの利用方法(git を入れたい場合)

    1. $ opkg update で最新のパッケージ情報を取得する。
    2. $ opkg upgrade でインストール済みパッケージを更新する。
    3. $ opkg list gitgit パッケージがあるか検索する。
    4. $ opkg info gitgit パッケージの情報を表示する。(出どころ、バージョンや依存など)
    5. $ opkg install gitgit をインストールする。
    6. $ opkg install git-http も入れて http による clone をできるようにする
      (これを入れないと git: 'remote-https' is not a git command. See 'git --help'.)エラーが出る。
    7. $ opkg list-installed でインストール済みパッケージを確認する。
    8. $ opkg remove gitgit をアン・インストールする。
    9. $ opkg status でパッケージの状態を確認する。
    10. アプデしてもバージョンが変わらない場合は再接続してみる。(パス変更の問題)

  _  ∩
( ゚∀゚)彡 Opkg!Opkg!
 ⊂彡

TS; DR(詳細)

インフォ

  • Entware-3x-stdEntware-ngEntware-std に統合されたことが 2018/03/07 にアナウンスされました。ちなみに ngno-good ではなく next-generation の略です。

  • Entware-3x の QPKG アプリをすでにインストール済みの場合

    • ARMv7 版 QNAP の場合
      • opkg update opkg upgrade2回実行すると、Entware にアップグレードできます。
      • 「AppCenter」からアンインストール後、本記の手順ででも可。(推奨)
    • ARMv5 版 QNAP の場合
      • 「AppCenter」からアンインストール後、本記の手順で行います。
  • opkg コマンドでインストールされたパッケージ(バイナリ)の設置先

    • /opt/bin
  • opkg コマンドでインストールできる ipk パッケージ一覧

  • Differences between Entware standard installation and Entware-ng/Entware-3x

    Current armv7 architecture users running Entware-ng, or any user currently running Entware-3x, can switch to Entware by running opkg update; opkg upgrade twice. Qnap owners using Entware-ng (armv5, x64) can upgrade to the new Entware using unofficial instructions published in this topic. This will not change package name in AppCenter.

    Entware standard installation is similar to Entware-ng. It does not install Entware version of busybox and adds /opt/bin and /opt/sbin to the end of PATH variable. There is also alternative installer in Entware that is similar to Entware-3x installer.
    It installs Entware version of busybox. For this installation Entware users are independent from firmware users. Entware has root user with 12345 password. Other users can be added permanently to Entware in this case to run services that require such users.

    • Entware の BusyBox 環境内の root ユーザーのデフォルト・パスワードは "12345" らしい。

    opkg コマンドのインストール手順

    1. コミュニティ版リポジトリを追加する。
      「App Center」の「アプリジポジトリ」設定に、EU 圏の QNAP Club が提供している XML ファイルを追加します。これによりコミュニティ版の QPKG アプリがインストールできるようになります。(互換性のあるものに限る)

      • https://www.qnapclub.eu/en/repo.xml EntwereViaQnapClub.png
    2. :repeat: で更新後、「Entware-std」を検索してインストールする

    3. QNAP に SSH 接続する

      $ ssh admin@192.168.xx.xx
      [~] # whoami
      admin
      
      [~] # ## CPU やカーネルのバージョンを確認する(ARMv5が確認できた)
      [~] # uname -a
      Linux NASxxxxxx 3.4.6 #1 Mon Oct 29 10:28:40 CST 2018 armv5tel GNU/Linux
      
      [~] # ## QNAP のファームウェア/QTSのバージョン確認コマンド
      [~] # getcfg system version
      4.3.3
      
    4. opkg コマンドの確認とアップデート

      この opkg がパッケージマネージャーのコマンドになります。

      [~] # opkg --version
      opkg version 0.1.8
      
      [~] # ## 大事なことなので2回実行します(以降は1回でOK)
      [~] # opkg update; opkg upgrade
      [~] # opkg update; opkg upgrade
      
    5. 例として git コマンドのパッケージ確認とインストールをしてみる

      [~] # ## 既存の Git がないか確認
      [~] # git --version
       -sh: git: command not found
      
      [~] # ## Entware のリポジトリに Git があるか検索
      [~] # opkg list git
      git - 2.19.2-2 - Git is a free & open source, distributed version control system
      designed to handle everything from small to very large projects
      with speed and efficiency.
      
      [~] # ## Git のインストール
      [~] # opkg install git
      Installing git (2.19.2-2) to root...
      Downloading http://bin.entware.net/armv5sf-k3.2/git_2.19.2-2_armv5-3.2.ipk
      Installing libopenssl (1.0.2p-1a) to root...
      Downloading http://bin.entware.net/armv5sf-k3.2/libopenssl_1.0.2p-1a_armv5-3.2.ipk
      Installing zlib (1.2.11-2) to root...
      Downloading http://bin.entware.net/armv5sf-k3.2/zlib_1.2.11-2_armv5-3.2.ipk
      Configuring zlib.
      Configuring libopenssl.
      Configuring git.
      
      [~] # ## インストールされた Git のバージョン確認
      [~] # git --version
      git version 2.19.2
      
      [~] # ## インストールされた Git の場所を確認
      [~] # which git
      /opt/bin/git
      

    参考文献

15
16
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
15
16