opkg (Open PacKaGe management) is the package manager used by OpenWrt. It is a lightweight IPK-format package manager derived from the originalDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/openwrt/openwrt/llms.txt
Use this file to discover all available pages before exploring further.
ipkg, designed for resource-constrained embedded Linux systems.
Configuration Files
| File | Purpose |
|---|---|
/etc/opkg.conf | Main configuration (architecture, signature checking, options) |
/etc/opkg/distfeeds.conf | Official OpenWrt package repositories |
/etc/opkg/customfeeds.conf | User-defined additional repositories |
/etc/opkg/keys/ | Trusted signing keys for signature verification |
Example /etc/opkg/distfeeds.conf
Full Command Reference
Update and Info
Install and Remove
Upgrade
Flags and Options
| Flag | Description |
|---|---|
--nodeps | Skip dependency resolution |
--force-reinstall | Reinstall even if already installed at same version |
--force-overwrite | Overwrite files from other packages |
--force-depends | Install even if dependencies are not met |
--dest <dest> | Install to an alternate destination (e.g., a USB drive) |
--tmp-dir <dir> | Use alternate temp directory |
Cached Package Lists
Afteropkg update, package lists are cached in:
tmpfs) and are lost on reboot, which is why opkg update must be run again after each reboot before installing packages.
Overlay Filesystem
OpenWrt’s root filesystem uses an OverlayFS layered over a read-only SquashFS base. Packages installed withopkg go to the writable overlay layer at /overlay/upper/.
The amount of space available for
opkg packages is limited by the writable overlay partition size, which is typically the remaining flash after the SquashFS image. Check with df -h /overlay.Adding a Custom Repository
Add a line to/etc/opkg/customfeeds.conf:
/etc/opkg.conf:
Installing to External Storage
To install packages to a USB drive or SD card instead of the internal overlay:LD_LIBRARY_PATH and PATH adjustments, or use of the extroot mechanism.