Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> 關於Linux

在 HP-UX 上安裝 bash 的完整步驟

HP-UX 全名為 Hewlett Packard UniX,是惠普 9000 系列伺服器的 Unix 作業系統,可運行於 HP 的 PA-RISC 與 Intel Itanium 處理器平台。它預設的 shell 功能相對樸素,因此不少人會想裝上 bash。以下記錄完整流程。

1. 下載 bash 安裝包

可從 HP-UX 軟體庫查詢:https://hpux.connect.org.uk/hppd/cgi-bin/search?package=on&description=on&term=bash

需要的相依元件:gettext、libiconv、termcap

gettext-0.19.5.1-hppa-11.31.depot.gz
libiconv-1.14-hppa-11.31.depot.gz
termcap-1.3.1-hppa-11.31.depot.gz
bash-4.3.033-hppa-11.31.depot.gz

2. 全部解壓到 /tmp

cd /tmp
gunzip gettext-0.19.5.1-hppa-11.31.depot.gz
gunzip libiconv-1.14-hppa-11.31.depot.gz
gunzip termcap-1.3.1-hppa-11.31.depot.gz
gunzip bash-4.3.033-hppa-11.31.depot.gz

3. 依序安裝

建議先裝相依元件,最後再裝 bash:

swinstall -s /tmp/gettext-0.19.5.1-hppa-11.31.depot
swinstall -s /tmp/libiconv-1.14-hppa-11.31.depot
swinstall -s /tmp/termcap-1.3.1-hppa-11.31.depot
swinstall -s /tmp/bash-4.3.033-hppa-11.31.depot

圖形/互動式安裝介面的操作可參考:https://www.thegeekstuff.com/2010/06/install-remove-depot-packages/

4. 啟動 bash

/usr/local/bin/bash

5. 把 /usr/local/bin 加入 PATH

# vi /etc/PATH
/usr/local/bin
# export PATH=$(cat /etc/PATH)

常見錯誤:權限不足

若看到類似訊息:

You do not have permission for this operation. The depot owner, system administrator, or alternate root owner may need to use the "swreg" or "swacl" command to give you permission. Or, to manage applications designed and packaged for nonprivileged mode, see the "run_as_superuser" option in the "sd" man page.

解法是重啟 swagent 服務,並用 swreg 把 depot 註冊進來:

/sbin/init.d/swagentd stop
/sbin/init.d/swagentd start

swreg -l depot /tmp/gettext-0.19.5.1-hppa-11.31.depot
swreg -l depot /tmp/libiconv-1.14-hppa-11.31.depot
swreg -l depot /tmp/termcap-1.3.1-hppa-11.31.depot
swreg -l depot /tmp/bash-4.3.033-hppa-11.31.depot

接著再進入安裝介面完成安裝即可(操作可參考前述 thegeekstuff 的教學)。

補充一點:若要在登入時自動進入 bash,可編輯 /etc/passwd 把該使用者的登入 shell 改為 /usr/local/bin/bash,並確認該檔案存在且具執行權限。

Copyright © Linux教程網 All Rights Reserved