opkg utility

Serge Vakulenko edited this page Jan 17, 2016 · 22 revisions

opkg: Package Manager



A configuration is performed via a set of files /etc/opkg/*.conf. Typical configuration may look like this:

src base http://packages.litebsd.org/mipsel/base
option cache_dir "/var/cache/opkg"
option lists_dir "/var/lib/opkg/lists"
option info_dir "/var/lib/opkg/info"
option status_file "/var/lib/opkg/status"
option lock_file "/var/run/opkg.lock"
option tmp_dir "/tmp"

The following statements are available:

  • option name value -- Set value for an option
  • src name url -- Add a source of packages
  • src/gz name url -- Add a source with gzipped data
  • dist name url -- Add a source with Debian structure
  • dist/gz name url -- Add a source with Debian structure, gzipped
  • dest name path -- Register destination with given path
  • arch name priority -- Register architecture with given priority

Configuration options

Available options to configure:

Option Default Description
cache_dir "/var/cache/opkg" Store downloaded files here
lists_dir "/var/lib/opkg/lists" Store package lists or remote repositories here
lock_file "/var/run/opkg.lock" Lock file for shared access
info_dir "/var/lib/opkg/info" Store control files of installed packages here
status_file "/var/lib/opkg/status" Keep a list of installed packages here
force_maintainer False Overwrite preexisting config files
ignore_maintainer False Keep preexisting config files
ignore_uid False Ignore owner id when extracting package files
force_depends False Install/remove despite failed dependencies
force_overwrite False Overwrite files from other package(s)
force_downgrade False Allow opkg to downgrade packages
force_reinstall False Reinstall package(s)
force_space False Disable free space checks
force_postinstall False Configure unpacked packages
autoremove False Remove packages that were installed automatically to satisfy dependencies and no longer needed
check_signature False Check signature of repositories
check_pkg_signature False Check signature of packages
signature_type "gpg" Signature type, one of "gpg", "gpg-asc" or "openssl"
ftp_proxy --- Proxy for FTP access
http_proxy --- Proxy for HTTP access
https_proxy --- Proxy for HTTPS access
no_proxy --- Set environment variable no_proxy
noaction False No action, test only
download_only False No action, download only
nodeps False Do not follow dependencies
no_install_recommends False Do not install any recommended packages
offline_root --- Use this directory as the root for offline installation
overlay_root --- Check this directory for free space, instead of root
query-all False Query all packages not just those installed
tmp_dir "/tmp" Use this directory for temporary files
volatile_cache False Clear cache directory on exit
verbosity 2 Verbosity level: 0-errors, 1-notice, 2-info, 3-debug, 4-debug2
overwrite_no_owner False Allowing un-owned files to be overwritten during package install
combine False Combine upgrade and install operations
cache_local_files False Copy local files into the cache when downloading

Installation Destinations

The format of destination lines is simply the keyword dest, followed by a name for this destination (this can be anything), followed by a filesystem location. Any destination that has been thus configured can then be specified on the opkg command line like this:

opkg install somepackage -d destination_name

By default, the only destination is "root", with path "/".

Adjust Architectures

By default, opkg only allows packages with the architecture all (= architecture independent) and the architecture of the installed target (mipsel for example). In order to source packages from a foreign, but compatible target, the list of allowed architectures can be overrided in opkg.conf with the use of arch options. For example:

arch all 100
arch mips32r2el 200
arch mips64r2el 300

The number specifies a priority index which is used by opkg to determine which package to prefer in case it is available in multiple architectures.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.