OpenMicroServer

Installing binary packages on the MicroServer with pkgsrc

The following manual describes the steps to install the package manager pkgsrc (http://pkgsrc.se) on the OpenMicroServer. The OpenMicroServer does not ship with a package manager by default.
Pkgsrc provides you with an automated process to download and install precompiled program binaries.

Caution when using binary packages

Package Lists

Using binaries in the HDD / CF-card environment

Outline

Usage environment setup

Before the following steps, please insert the CF card or connect the external HDD / thumb drive to the USB port.

Use the serial console to login with root priviledges.

You can find additional information in the Appendix.

1. Installing the HDD image

Refer to chapter 3.3 to 3.6 of the Open MicroServer User's Guide on how to prepare the HDD / CF-Card / thumb drive.

2. Create the directories necessary for installation

# mkdir -p /usr/pkg/tmp
# mkdir -p /usr/pkg/var/run
# mkdir -p /usr/pkg/var/log

3. Adding command binaries

With the following method, you can add binaries that match the Microserver model and firmware version to the system.

The binary files can be found at ftp://ftp.plathome.co.jp/pub/OMS400/pkg/LATEST/binary. Also see the bottom of the binaries list for URLs.

If you are unsure about the correct network settings for data downloads, refer to Network Settings below.

Using an Internet connection

In the URL, replace LATEST with the correct firmware version number. The version number of your system can be found with the command uname -o. If, for example, uname -o returns SSD/Linux 0.4-20080320, use 0.4-20080320.

If necessary, specify HTTP Proxy
# export ftp_proxy=http://proxy.example.jp:8080
and execute
# ftp ftp://ftp.plathome.co.jp/pub/OMS400/pkg/LATEST/bootstrap.tgz
# tar xvzf bootstrap.tgz -C /
When you can't connect to the Internet

Since an ftp server is active on the OpenMicroServer by default, you can upload files, from a Windows terminal for example. You can log into the server with the username "user1" and the password "user1".

On the console, expand the files with

# tar xvzf /home/user1/bootstrap.tgz -C /

4. Setting necessary environment variables and processes

/etc/profile

Edit /etc/profile as follows.

Note: Below, replace the value for OS_RELEASE with the version given by uname -o. For example, if the output of uname -o is SSD/Linux 0.4-20080320, use 0.4-20080320

OS_RELEASE=0.4-20071208
alias pkg_add="PKG_PATH=ftp://ftp.plathome.co.jp/pub/OMS400/pkg/${OS_RELEASE}/binary /usr/pkg/sbin/pkg_add"

PKG_TMPDIR=/usr/pkg/tmp
export PKG_TMPDIR

#When using a HTTP Proxy
#http_proxy=http://proxy.example.jp:8080
#ftp_proxy=http://proxy.example.jp:8080
#no_proxy=.example.jp
#export http_proxy ftp_proxy no_proxy

PATH=/usr/pkg/bin:$PATH

if [ "$UID" -eq "0" ] ; then
        PATH=/usr/pkg/sbin:$PATH
fi

export PATH

Reboot to activate all settings.

# reboot

This finishes the preparation.

Pkgsrc Howto

Verifying the information of installed packages

Displaying a list
# pkg_info
Viewing the details of a specific package

Enter the package name with or without version number. We will use openssh as an example.

# pkg_info openssh

Install

Basic method

Enter the package name with or without version number as displayed in the list.

# pkg_add openssh
Display detailed information at installation time
# pkg_add -v openssh
Display the installed files
# pkg_add -L openssh
Check from which package installed files are.
# pkg_add -F /usr/pkg/sbin/sshd
Caution

Uninstall

Basic method

Specify the package name with or without version number as in the package list.

# pkg_delete openssh

Update package to a new version

Basic method

Uninstall and reinstall

# pkg_delete openssh
# pkg_add openssh

Additional information for creating an environment

Network settings

When using the Web setup tool

Please refer to the Web Setup Guide when using the Web Setup Tool.

When using DHCP

When using DHCP, all necessary information is handed out by the DHCP server, so all necessary network setup can be done by using the command below.

The following example is for using port Ether-0:

# dhclient eth0

In case of a fixed IP address

If you use fixed IP addresses, you need to set IP adress, gateway and DNS manually.

The following example sets the port Ether-0 to IP address 192.168.0.100/24, and configures the gateway as well as the DNS server as 192.168.0.1.

# ifconfig eth0 192.168.0.100 netmask 255.255.255.0 broadcast 192.168.0.255
# route add default gw 192.168.0.1
# echo "nameserver 192.168.0.1" > /etc/resolv.conf