.ipk packages — the same format used by Entware and historically by the NSLU2 project. opkg resolves dependencies recursively and can install packages from remote repositories over the network.
OpenWrt also supports apk (Alpine Package Keeper) as an alternative to opkg on newer builds. Check your firmware’s configuration to see which is active.
Repository Configuration
opkg fetches package lists and packages from feeds defined in/etc/opkg/distfeeds.conf. This file is auto-generated for your specific target and release:
/etc/opkg/customfeeds.conf to avoid overwriting the auto-generated distfeeds on upgrade.
Common Commands
Update Package Lists
Always run this before installing packages. It downloads the current package index from all configured feeds.Install a Package
Remove a Package
--autoremove to also remove dependencies that are no longer needed:
List Available Packages
List Installed Packages
Show Package Information
Displays version, description, dependencies, and installation status:List Files Installed by a Package
Built-in vs. Runtime Packages
Packages can be included in OpenWrt in two ways:| Method | How | Trade-off |
|---|---|---|
| Built into firmware | Selected via make menuconfig at build time, compiled into the firmware image | Always available, survives factory reset, uses flash space |
| Installed at runtime | Installed via opkg install after the device is running | Flexible, but requires network access and writable storage |
Storage Considerations
opkg installs packages into the writable overlay filesystem (see Filesystem Layout). On flash-constrained devices:- Prefer small, targeted packages over large meta-packages
- Use
opkg list-installedto audit what is installed - Consider using a USB drive or external storage as an extroot to expand available space
- Packages installed at runtime are not automatically preserved across
sysupgradeunless explicitly listed in/etc/sysupgrade.conf