# which bash
/usr/bin/bash
# usermod -s /usr/bin/bash root
/.profile 環境設定# cp /etc/skel/local.profile /.profile
編輯 /.profile 加入:
PATH=/usr/bin:/usr/local/bin:/usr/ucb:/etc:/usr/sbin:/usr/sfw/bin:/usr/ccs/bin:/opt/csw/bin:.
export PATH
export PS1='\u:\w#'
pkgadd -d /cdrom/Solaris_10/Product SUNWwgetr
pkgadd -d /cdrom/Solaris_10/Product SUNWwgetu
pkgadd -d /cdrom/Solaris_10/Product SUNWwgetS
pkgadd -d /cdrom/Solaris_10/Product SUNWgcmn
wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/gcc-3.4.6-sol10-x86-local.gz
wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libiconv-1.11-sol10-x86-local.gz
wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libgcc-3.4.6-sol10-x86-local.gz
wget ftp://ftp.sunfreeware.com/pub/freeware/intel/10/libintl-3.4.0-sol10-x86-local.gz
說明:第一個為 GCC 主程式,其餘三個為運行時必要庫 (iconv, libgcc, gettext)。
gunzip gcc-3.4.6-sol10-x86-local.gz
gunzip libiconv-1.11-sol10-x86-local.gz
gunzip libgcc-3.4.6-sol10-x86-local.gz
gunzip libintl-3.4.0-sol10-x86-local.gz
pkgadd -d gcc-3.4.6-sol10-x86-local
pkgadd -d libiconv-1.11-sol10-x86-local
pkgadd -d libgcc-3.4.6-sol10-x86-local
pkgadd -d libintl-3.4.0-sol10-x86-local
編輯 /.profile 追加:
export LD_LIBRARY_PATH=/usr/local/lib:.
export CC=gcc
重新登入或 source /.profile 生效。
# gcc -version
gcc (GCC) 3.4.6
Copyright (C) 2006 Free Software Foundation, Inc.
...
注意:Solaris 10 x86 內建 Sun Studio 編譯器,安裝 GCC 3.4.6 會覆蓋系統預設 cc 連結,若需保留 Sun Studio 建議使用模組管理或完整路徑呼叫。