Configuring Package Repositories in OpenWrt
Editing Package Feeds Configuration
OpenWrt uses opkg for package management. The package repository locations are defined in /etc/opkg/distfeeds.conf. To modify the feeds, open this file with a text editor:
vi /etc/opkg/distfeeds.conf
Updating Repository URLs
Comment out or replace the default repository entries. Below are configurations for different hardware architectures.
x86/64 Architecture
src/gz openwrt_core https://downloads.openwrt.org/releases/23.05.4/targets/x86/64/packages
src/gz openwrt_base https://downloads.openwrt.org/releases/23.05.4/packages/x86_64/base
src/gz openwrt_luci https://downloads.openwrt.org/releases/23.05.4/packages/x86_64/luci
src/gz openwrt_packages https://downloads.openwrt.org/releases/23.05.4/packages/x86_64/packages
src/gz openwrt_routing https://downloads.openwrt.org/releases/23.05.4/packages/x86_64/routing
src/gz openwrt_telephony https://downloads.openwrt.org/releases/23.05.4/packages/x86_64/telephony
MIPS Architecture (RAMIPS MT7621)
src/gz openwrt_core https://downloads.openwrt.org/releases/23.05.2/targets/ramips/mt7621/packages
src/gz openwrt_base https://downloads.openwrt.org/releases/23.05.2/packages/mipsel_24kc/base
src/gz openwrt_luci https://downloads.openwrt.org/releases/23.05.2/packages/mipsel_24kc/luci
src/gz openwrt_packages https://downloads.openwrt.org/releases/23.05.2/packages/mipsel_24kc/packages
src/gz openwrt_routing https://downloads.openwrt.org/releases/23.05.2/packages/mipsel_24kc/routing
src/gz openwrt_telephony https://downloads.openwrt.org/releases/23.05.2/packages/mipsel_24kc/telephony
Save the file and exit the editor.
Refreshing Package Lists
After modifying the repository configuration, fetch the latest package information:
opkg update
Resolving Signature Verification Errors
If signature verification failures occur, disable the check in /etc/opkg.conf:
vi /etc/opkg.conf
Locate and comment out the signature check option:
#option check_signature
Run the update command again:
opkg update
Installing Packages
The folowing example demonstrates installing SNMP components:
opkg install snmpd
opkg install snmp-utils
Configuring SNMP
Edit the SNMP daemon configuration file and add the following directives:
sysLocation DataCenter_A
sysContact netadmin@example.com
rocommunity public 10.10.10.106
Building Software from Source (Optional)
To compile software on the router, install the necessary build tools:
opkg install gcc make
For example, to compile the shell script compiler (shc):
tar zxvf shc-release.tar.gz
wget https://github.com/neurobin/shc/archive/release.tar.gz
cd shc-release/
./configure
make
make install
cd src
cp shc /usr/bin/
The compiled binary will be available at /usr/bin/shc.