Overview of the ipkg package management system

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search

This article is based on original work from nix and edited by frontalot from www.linkstationwiki.org


ipkg (officially iPKG) is a lightweight, simplistic package management system. A package management system does just that -- it manages precompiled software which has been bundled into modular, interdependent packages.

ipkg was originally designed for embedded systems such as the iPAQ but works equally well for small Linux systems such as the LinkStation. ipkg allows for dynamic installation/removal of software packages and dependency checking, much like Debian's dpkg system. The ipkg system is being used quite successfully by several embedded Linux hacking groups such as OpenWRT and NSLU2-Linux. Documentation at the official ipkg home page is sparse and in some instances inaccurate. We will try to cover as much information as possible here.


  • The ipkg client and libraries are relatively small
  • The installed meta-data is minimal yet fully functional
  • Actively maintained
  • Well developed, active user base


  • Limited features, e.g., extra scripts are required to set up users or groups
  • Documentation is limited and often outdated or inaccurate
  • Significant changes in development can cause incompatibilities between versions
  • Root access is generally required to build a package and to install a package
  • Limited control over owner, group, and access permissions of package contents

The Client

Client Program Name
On some platforms the ipkg client program is named ipkg-cl. The ipkg system on the LS is controlled through a single client program, the appropriately named ipkg. It is used to install, remove, and manage packages. ipkg is capable of obtaining packages from a remote server called a feed, similar to Debian's apt-get functionality. It can also install packages from a provided .ipk package file.
ipkg documentation
Some ipkg commands and options are not properly documented here. This is due to the fact that ipkg in general comes without any documentation. To understand the exact working of some of the commands the study of the source code is required. Please add documentation for commands and options if you are becoming aware of their working.

The following is a list of available commands for the ipkg client:

usage: ipkg [options...] sub-command [arguments...]

Package manipulation sub-commands

Update list of available packages
Upgrade all installed packages to latest version
install pkg
Download and install pkg (and dependencies)
install file.ipk
Install package file.ipk
configure [pkg]
Configure unpacked packages
remove pkg
Remove package pkg
flag flags pkg ...
Flag package(s) pkg (flag=hold|noprune|user|ok|installed|unpacked (one per invocation))

Informational sub-commands

List available packages and descriptions
files pkg
List all files belonging to pkg
search file
Search for a package providing file
info [pkg [field]]
Display all/some info fields for pkg or all
status [pkg [field]]
Display all/some status fields for pkg or all
download pkg
Download pkg to current directory
compare_versions v1 op v2
compare versions using <= < > >= = << >>)
Prints the architecture
whatdepends [-A] [pkgname|pat
List all packages that depend on pkgname
whatdependsrec [-A] [pkgname|pat
Variation of whatdepends?
whatprovides [-A] [pkgname|pat
List all packages that provide pkgname
whatconflicts [-A] [pkgname|pat
List all packages that conflict with pkgname
whatreplaces [-A] [pkgname|pat
List all packages that replace pkgname


Query all packages with whatdepends, whatprovides, whatreplaces, whatconflicts
-V level
Set verbosity level to level. If no value is provided increase verbosity by one
Verbosity levels:
errors only
normal messages (default)
informative messages
debug output
-f conf_file
Use conf_file as the ipkg configuration file
--conf conf_file
Default configuration file location is /etc/ipkg.conf
-d dest_name
Use dest_name as the the root directory for package installation, removal, upgrading
dest_name should be a defined dest name from the configuration file
-o offline_root
Use offline_root as the root directory for offline installation of packages
Use offline_root as the root directory for offline installation of packages
More wget messages

Force Options

These options are used to override a decision ipkg would otherwise make on its own.

Make failed dependency-checks warnings instead of errors and install/remove package in spite of failed dependencies
Use default options for questions asked by ipkg. This will not prevent package installation scripts from prompting
Allow ipkg to reinstall a package
Allow ipkg to overwrite files from another package during an install
Install even if there does not seem to be enough space
No action -- test only
Do not follow dependencies
Allow ipkg to remove package and all that depend on it
No action -- test only
-t tmp-dir
Specify temporary directory
Specify temporary directory

Please see Ipkg on the Linkstation (for end-users) for more information on how to use ipkg on the LinkStation.

The Configuration Files

The configuration files control the server(s) from which ipkg update and ipkg get will pull package information and packages. /etc/ipkg.conf Defines destination locations, feeds and global and proxy settings. Each line in the file is either a comment, an empty line (ignored), or consists of a configuration parameter. The following parameters are supported:

# comment
src feed-name feed-url
Name and location of a feed.
dest dest-name dest-location
Installation destination name and directory.
option name value
Configuration options. Option names are:
Proxy to use for HTTP connections
Proxy to use for FTP connections
Proxy user name
Proxy password
Root for offline installation, e.g. into some flash memory.
There isn't any official documentation for the contents of feed-name.conf files
Defines feed-specific settings for the feed feed-name.

The Packages

The software packages are contained in special .ipk files. An .ipk file is a specially constructed ar archive (previous versions of .ipk files were gzipped tar archives, like .deb files - this is a discouraged but still supported format) containing three parts:

Contains the actual files belonging to this package, organized as they should appear after installation
Contains a file describing the package meta-data and any installation/removal scripts for the package
This file is for comparability with Debian's package system and currently is ignored by ipkg

See Construct ipkg packages (for developers) for an in-depth discussion of the package format.