アットウィキロゴ

solaris

solaris

CPU

  • SPARC
    SunのCPUである{SPARC」を使ったもの
    UltraSPARCR,SPARC64を使って製造された32ビット及び64ビットシステム
    
  • X86
    IntelおよびIntel互換のCPUを使ったもの
    

Solarisへのフリーソフトのインストール方法

  • OSのCD(DVD)から入れる
  • ソースコンパイル
  • Freeware for Solaris からパッケージを入手
    Freeware for Solaris からパッケージをダウンロードして pkgadd する
    このサイトのパッケージは、/usr/local/ の下に入る
    
  • pkg-get を使う
    ※詳細は以下のページに
    http://sy2920.s151.xrea.com/solaris/pkg-get.html
    

ソースからのインストール

  1. ソースファイルを取得し、解凍する。
  2. 展開したディレクトリのINSTALL, READMEなどを読む。
    $ cd coreutils-7.4
    $ less INSTALL
    $ less README
    
  3. configureをする。これはマシンの環境にあわせてMakefileを作成するためのコマンドである。このときに適用可能なオプションは./configure --helpで確認できることが多い。
    $ ./configure --help
    ※configureの時によく使われるオプションとしてprefixがある。これは、インストール先のディレクトリを陽に指定するオプションである。これがない場合は、/usr/local/以下にインストールされる。
    $ ./configure --prefix=/usr/local/coreutils-7.4 
    
  4. makeコマンドでソースをコンパイルする。
    $ make
    
  5. make test または、make check で、実際にmakeを実行せずに、エラーが出ないかどうかを確認する。
    $ make check
    $ make test
    ※makeに失敗したあとや異なる環境でmakeをやり直すときはmake cleanとすると初期化できることが多い。
    $ make clean
    
  6. make installでソースファイルをインストール先のディレクトリにコピーする。
    ※この作業はroot権限下でおこなう。
    $ sudo mkdir /usr/local/coreutils-7.4
    $ sudo make install
    $ sudo ln -s /usr/local/coreutils-7.4 /usr/local/coreutils
    
  7. インストール先のディレクトリをパスに追加する。bashを使っているならば.bashrcに次のような行を追加する。
    $ export PATH=$PATH:/usr/local/coreutils
    
  8. 参考(元ネタ)
    http://www28.atwiki.jp/fmemo/pages/32.html#id_4ad85a32
    

ppkginfoの使用方法

インストール済みパッケージの一覧表示

 [meka@~]$pkginfo | grep wget
system      SUNWwgetr                        GNU wget - utility to retrieve files from the World Wide Web (root)
system      SUNWwgetu                        wget - GNU wget

インストール済みパッケージの詳細表示

[meka@~]$pkginfo -l  SUNWwgetr
  PKGINST:  SUNWwgetr
     NAME:  GNU wget - utility to retrieve files from the World Wide Web (root)
 CATEGORY:  system
     ARCH:  i386
  VERSION:  11.10.0,REV=2005.01.08.01.09
  BASEDIR:  /
   VENDOR:  Sun Microsystems, Inc.
     DESC:  GNU wget - a utility to retrieve files from the World Wide Web (root components) 1.10.2
   PSTAMP:  sfw10-patch-x20070131071214
 INSTDATE:  May 30 2009 16:16
  HOTLINE:  Please contact your local service provider
   STATUS:  完全にインストールされました。
    FILES:        2 のインストールされたパス名
                  1 の共有パス名
                  1 のディレクトリ
                  1 の実行可能ファイル
                  9 ブロック (概算値) が使われました

2つのpkg-get

CSW版

  • 設定ファイル
    /opt/csw/etc/pkg-get.conf
    
  • version情報
    # /opt/csw/bin/pkg-get -version
    DEBUG-ONLY MODE ON
    /opt/csw/bin/pkg-get[1854]: getopts: e bad option(s)
    pkg-get,   by Philip Brown , [email protected]
     (Internal SCCS code revision 3.11)
    Originally from http://www.bolthole.com/solaris/pkg-get.html
    
    pkg-get is used to install free software packages
    pkg-get
    Need one of 'install', 'upgrade', 'available','compare'
      '-i|install'   installs a package
      '-u|upgrade'   upgrades already installed packages if possible
      '-a|available' lists the available packages in the catalog
      '-c|compare'   shows installed package versions vs available
      '-l|list'      shows installed packages by software name only
    
    Optional modifiers:
      '-d|download'  just download the package, not install
      '-D|describe'  describe available packages, or search for one
      '-U|updatecatalog'   updates download site inventory
      '-S|sync'      Makes update mode sync to version on mirror site
      '-f'           dont ask any questions: force default pkgadd behaviour
                     Normally used with an override admin file
                     See /var/pkg-get/admin-fullauto
    
      '-s ftp://site/dir'  temporarily override site to get from
    

Freeware for Solaris版

  • 設定ファイル
    /etc/pkg-get.conf
    
  • version情報
    # /usr/bin/pkg-get -version
    /usr/bin/pkg-get[1115]: getopts: e bad option(s)
    pkg-get SCCS rev @(#) pkg-get 1.56.1.2@(#)
    from http://www.bolthole.com/solaris/
    
    pkg-get is used to install free software packages
    pkg-get
    Need one of 'install', 'upgrade', 'available','compare'
      '-i|install'   installs a package
      '-u|upgrade'   upgrades already installed packages if possible
      '-a|available' lists the known available packages
      '-c|compare'   shows installed package versions vs available
      '-d|download'  just download the package, not install
      '-D|describe'  describe available packages
      '-f'           dont ask any questions: force default behaviour
                     Normally used with an override admin file
                     See /var/pkg-get/admin-fullauto
    
      '-s ftp://site/dir'  temporarily override site to get from
                          (change /etc/pkg-get.conf for perm)
      '-U|updatecatalog'   updates download site inventory
    

Freeware for Solaris版pkg-get

ダウンロード

#  wget http://www.sunfreeware.com/BOLTpget.pkg
--00:47:12--  http://www.sunfreeware.com/BOLTpget.pkg
           => `BOLTpget.pkg'
Resolving www.sunfreeware.com... 66.193.208.66
Connecting to www.sunfreeware.com|66.193.208.66|:80... connected.
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 45,056 (44K) [application/octet-stream]

100%[===========================================================================================>] 45,056        55.85K/s

00:47:14 (55.74 KB/s) - `BOLTpget.pkg' saved [45056/45056]

インストール

# /usr/sbin/pkgadd -d BOLTpget.pkg

The following packages are available:
  1  BOLTpget     pkg-get
                  (all) 1.9.9

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]:

</opt/pkg/BOLTpget.pkg> 中のパッケージインスタンス <BOLTpget> を処理中です。

pkg-get(all) 1.9.9
Philip Brown, Bolthole Software, http://www.bolthole.com
</usr> をパッケージのベースディレクトリとして使用します。
## パッケージ情報を処理中です。
## システム情報を処理中です。
   5 個のパッケージパス名がすでに正しくインストールされています。
## ディスク領域の要件を確認中です。
## すでにインストール済みのパッケージとの重複を確認中です。
## setuid/setgid を行うプログラムを検査中です。

pkg-get を <BOLTpget> としてインストール中です。

## 1/1 部分をインストールしています。
/usr/bin/pkg-get
/usr/share/man/man1m/pkg-get.1m
/var/pkg-get/admin-fullauto
[ クラス <none> を検査しています ]

<BOLTpget> のインストールに成功しました。

カタログのダウンロード

# /usr/bin/pkg-get -U
ERROR: /etc/pkg-get.conf not present
Creating a default file
Getting catalog...
--00:49:16--  ftp://ftp.sunfreeware.com/pub/freeware/i386/5.10/catalog
           => `/dev/fd/1'
Resolving ftp.sunfreeware.com... 66.193.208.66
Connecting to ftp.sunfreeware.com|66.193.208.66|:21... connected.
anonymous としてログインしています... ログインしました!
==> SYST ... 完了しました。    ==> PWD ... 完了しました。
==> TYPE I ... 完了しました。  ==> CWD /pub/freeware/i386/5.10 ... 完了しました。
==> PASV ... 完了しました。    ==> RETR catalog ... 完了しました。
長さ: 89,834 (88K) (確証はありません)

100%[===========================================================================================>] 89,834        89.06K/s

00:49:20 (88.70 KB/s) - `/dev/fd/1' saved [89834]

Updating catalog file, EXCLUDING gzip
/var/pkg-get/catalog-ftp.sunfreeware.com updated
--00:49:20--  ftp://ftp.sunfreeware.com/pub/freeware/i386/5.10/descriptions
           => `/dev/fd/1'
Resolving ftp.sunfreeware.com... 66.193.208.66
Connecting to ftp.sunfreeware.com|66.193.208.66|:21... connected.
anonymous としてログインしています... ログインしました!
==> SYST ... 完了しました。    ==> PWD ... 完了しました。
==> TYPE I ... 完了しました。  ==> CWD /pub/freeware/i386/5.10 ... 完了しました。
==> PASV ... 完了しました。    ==> RETR descriptions ...
`descriptions' というファイルはありません。

Failed to get description file. That's okay, it's optional.

参考ページ

 http://www.server-world.info/query?os=Solaris_10&p=first_conf&f=5

CSW - Community SoftWare 版pkg_get

ダウンロード

 http://blastwave.network.com/csw/stable/sparc/5.10/pkg_get-3.8.4-SunOS5.8-all-CSW.pkg
 http://download.blastwave.org/csw/stable/i386/5.10/pkg_get-3.8.4-SunOS5.8-all-CSW.pkg
 # wget http://blastwave.network.com/csw/stable/sparc/5.10/pkg_get-3.8.4-SunOS5.8-all-CSW.pkg   sparcの方を落としてきてたよ(・ω・;A)アセアセ 
 --00:57:53--  http://blastwave.network.com/csw/stable/sparc/5.10/pkg_get-3.8.4-SunOS5.8-all-CSW.pkg
            => `pkg_get-3.8.4-SunOS5.8-all-CSW.pkg.1'
 Resolving blastwave.network.com... 204.152.191.106
 Connecting to blastwave.network.com|204.152.191.106|:80... connected.
 HTTP による接続要求を送信しました、応答を待っています... 302 Found
 場所: http://download.blastwave.org/csw/stable/sparc/5.10/pkg_get-3.8.4-SunOS5.8-all-CSW.pkg [続く]
 --00:57:54--  http://download.blastwave.org/csw/stable/sparc/5.10/pkg_get-3.8.4-SunOS5.8-all-CSW.pkg
            => `pkg_get-3.8.4-SunOS5.8-all-CSW.pkg.1'
 Resolving download.blastwave.org... 204.152.191.106
 Reusing existing connection to blastwave.network.com:80.
 HTTP による接続要求を送信しました、応答を待っています... 200 OK
 長さ: 69,120 (68K) [application/octet-stream]

 100%[===========================================================================================>] 69,120        81.52K/s

 00:57:55 (81.35 KB/s) - `pkg_get-3.8.4-SunOS5.8-all-CSW.pkg.1' saved [69120/69120]

インストール

 # pkgadd -d pkg_get-3.8.4-SunOS5.8-all-CSW.pkg

 The following packages are available:
   1  CSWpkgget     pkg_get - CSW version of automated package download tool
                    (all) 3.8.4

 Select package(s) you wish to process (or 'all' to process
 all packages). (default: all) [?,??,q]:

 </opt/pkg/pkg_get-3.8.4-SunOS5.8-all-CSW.pkg> 中のパッケージインスタンス <CSWpkgget> を処理中です。

 pkg_get - CSW version of automated package download tool(all) 3.8.4
 You may use and copy this software without charge, as you see fit.
 The software is copyright (C) Philip Brown, Nov 2000-2007

 Dont forget to update /opt/csw/etc/pkg-get.conf with your nearest archive site.
 (or /etc/opt/csw/pkg-get.conf)

 The default site ibiblio.org may or may not be slow for you!


 選択されたベースディレクトリ </opt/csw> は、インストール 前に存在して
 いる必要があります。

 今このディレクトリを作成しますか [y,n,?,q]
         ERROR: Input is required.

 今このディレクトリを作成しますか [y,n,?,q] y
 </opt/csw> をパッケージのベースディレクトリとして使用します。
 ## パッケージ情報を処理中です。
 ## システム情報を処理中です。
     警告: </opt/csw/bin> のモードをデフォルトモード (755) に設定しようとしています
     警告: </opt/csw/etc> のモードをデフォルトモード (755) に設定しようとしています
     警告: </opt/csw/share> のモードをデフォルトモード (755) に設定しようとしています
     警告: </opt/csw/share/man> のモードをデフォルトモード (755) に設定しようとしています
     警告: </opt/csw/share/man/man1m> のモードをデフォルトモード (755) に設定しようとしています
    3 個のパッケージパス名がすでに正しくインストールされています。
 ## ディスク領域の要件を確認中です。
 ## すでにインストール済みのパッケージとの重複を確認中です。
 ## setuid/setgid を行うプログラムを検査中です。

 このパッケージには、パッケージのインストール処理中にスーパーユーザーの
 アクセス権で実行するスクリプトが含まれています。

 <CSWpkgget> のインストールを継続しますか [y,n,?] y

 pkg_get - CSW version of automated package download tool を <CSWpkgget> としてインストール中です。

 ## 1/1 部分をインストールしています。
 /opt/csw/bin/pkg-get
 /opt/csw/etc/pkg-get.conf.csw
 /opt/csw/share/man/man1m/pkg-get.1m
 [ クラス <none> を検査しています ]
 ## postinstall スクリプトを実行中です。

 Installing /opt/csw/etc/pkg-get.conf.csw to pkg-get.conf

 **** IMPORTANT ****
 A default configuration file for pkg-get has been created in
     /opt/csw/etc/pkg-get.conf
 You should edit it to change the 'site' configuration, to point to
 the most appropriate mirror for you, from the list at
    http://www.blastwave.org/mirrors


 <CSWpkgget> のインストールに成功しました。

ミラー設定を国内「http://dist.justplayer.com/csw/stable」に変更する

 # vi /opt/csw/etc/pkg-get.conf
    8  # default site, in USA:
    9  url=http://ibiblio.org/pub/packages/solaris/csw/unstable
 変更する!
    8  # default site, in USA:
    9  #url=http://ibiblio.org/pub/packages/solaris/csw/unstable
   10  url=http://dist.justplayer.com/csw/stable

カタログの取得

# /opt/csw/bin/pkg-get -U
 WARNING: gpg not found
 Getting catalog...
 --01:03:54--  http://dist.justplayer.com/csw/stable/i386/5.10/catalog
            => `catalog'
 Resolving dist.justplayer.com... 59.106.124.150
 Connecting to dist.justplayer.com|59.106.124.150|:80... connected.
 HTTP による接続要求を送信しました、応答を待っています... 200 OK
 長さ: 315,355 (308K) [text/plain]

 100%[===========================================================================================>] 315,355        1.87M/s

 01:03:54 (1.87 MB/s) - `catalog' saved [315355/315355]

 WARNING: gpg not available.
 Stripping off catalog signature without verifying
 Updating catalog file
 /var/pkg-get/catalog-dist.justplayer.com updated

 --01:03:54--  http://dist.justplayer.com/csw/stable/i386/5.10/descriptions
            => `descriptions'
 Resolving dist.justplayer.com... 59.106.124.150
 Connecting to dist.justplayer.com|59.106.124.150|:80... connected.
 HTTP による接続要求を送信しました、応答を待っています... 200 OK
 長さ: 90,159 (88K) [text/plain]

 100%[===========================================================================================>] 90,159        --.--K/s

 01:03:54 (1.62 MB/s) - `descriptions' saved [90159/90159]

 Updated description file

参考ページ

 http://d.hatena.ne.jp/TrinityT/20100622/1277212589

DHCPから固定IPアドレスへの変更

  • 設定ファイルを書き換える
    ①vi /etc/hostname.e1000g0
    192.168.11.4
    ②vi /etc/hosts (write権限を付けないと変更不可だった)
    127.0.0.1       localhost
    192.168.11.4     mekapc   loghost
    ③vi /etc/netmasks (write権限を付けないと変更不可だった)
    192.168.1.0     255.255.255.0
    ④vi /etc/defaultrouter
    192.168.1.1
    ⑤vi /etc/inet/ipnodes(write権限を付けないと変更不可だった)
    ::1 localhost
    127.0.0.1 localhost
    192.168.11.4    mekapc loghost
    
  • DHCPを使わないように設定する方法(固定IPに切り替える方法)
    # rm /etc/dhcp.e1000g0
    
  • DHCPを使うように設定する方法
    # touch /etc/dhcp.<NIC名>
    

nkfの導入

  • nkfのソースの取得
    http://sourceforge.jp/projects/nkf/downloads/44486/nkf-2.1.1.tar. gz
    
  • インストール
    [meka@~/nkf]$gzip -d nkf-2.1.1.tar.gz
    [meka@~/nkf]$tar xvf nkf-2.1.1.tar
    [meka@~/nkf]$cd nkf-2.1.1
    # vi Makefile
    "Makefile" 68 行、1564 バイト
         1  CC = gcc  ←ccをgccに書き換える
         2  CFLAGS = -g -O2 -Wall -pedantic
         3  # CFLAGS = -O3
         4  SHAR = shar
         5  # SHAR = shar -T
         6  PERL = perl
    # LD_LIBRARY_PATH=:/usr/local/lib
    # PATH=/usr/local/bin:/usr/bin:/usr/sfw/bin:/usr/ccs/bin
    # export LD_LIBRARY_PATH
    # export PATH
    # make
    gcc -g -O2 -Wall -pedantic -c nkf.c
    gcc -g -O2 -Wall -pedantic -c utf8tbl.c
    gcc -g -O2 -Wall -pedantic -o nkf nkf.o utf8tbl.o
    # cp -pi nkf  /usr/local/bin/
    
  • 参考ページ
    http://www.rinneza.com/junya/tech/solaris10_x86/os/nkf208.html
    

SMF(Service Management Facility) によるサービス管理

  • 参考ページ
    http://sy2920.s151.xrea.com/solaris/smf.html
    http://www.itmedia.co.jp/enterprise/articles/0902/03/news004.html
    

指定したIPアドレスからのみSSHアクセスを許可したい場合

# vi /etc/hosts.allow
in.telnetd: 192.16.0.0/255.254.0.0 192.20.0.0/255.252.0.0
in.ftpd: 192.16.0.0/255.254.0.0 192.20.0.0/255.252.0.0
sshd: 192.16.0.0/255.254.0.0 192.20.0.0/255.252.0.0 \_( ゚ロ゚)ここ重要
 
# more /etc/hosts.deny
ALL:ALL
最終更新:2010年10月19日 11:15
ツールボックス

下から選んでください:

新しいページを作成する
ヘルプ / FAQ もご覧ください。