DEV Community

Yawata Yahaha
Yawata Yahaha

Posted on • Originally published at en.deeprouter.org

Custom OpenWRT Software Sources

😀 This article is mainly for personal documentation, as I need to manually replace software sources after each OpenWRT reinstallation to speed up software list updates and installations. I've organized this information for others to use. As of October 15, 2024, all content is accessible and usable.

📝 Custom OpenWRT Software Sources

Official Mirror Sites

  • OpenWRT Official Download Site:

    URL: https://downloads.openwrt.org/

    This is the main site for OpenWRT, providing all official firmware and packages. It is the primary source for obtaining the latest stable versions, development snapshots, and historical versions.

  • OpenWRT Official GitHub Repository:

    URL: https://github.com/openwrt/openwrt

    Primarily used for code storage and development, but also provides some resources and documentation links.

Domestic Mirror Sites

Personal Mirror Site

How to Choose and Use Mirror Sites

Configuring official software sources on an OpenWRT router usually requires no additional operations, as OpenWRT is configured with official sources by default. Simply run the opkg update command to ensure the package list is up-to-date. It's also not recommended to frequently update the system's default software unless there are noticeable performance issues.

To use these mirror sources, you need to modify the OPKG software sources on the OpenWRT router. Check the /etc/opkg/customfeeds.conf file to ensure it's configured correctly for your OpenWRT version and device architecture.

Configuration Example

src/gz openwrt_core https://mirror.bjtu.edu.cn/openwrt/releases/<version>/targets/<target>/packages
src/gz openwrt_base https://mirror.bjtu.edu.cn/openwrt/releases/<version>/packages/<architecture>/base
src/gz openwrt_luci https://mirror.bjtu.edu.cn/openwrt/releases/<version>/packages/<architecture>/luci
src/gz openwrt_packages https://mirror.bjtu.edu.cn/openwrt/releases/<version>/packages/<architecture>/packages
src/gz openwrt_routing https://mirror.bjtu.edu.cn/openwrt/releases/<version>/packages/<architecture>/routing
src/gz openwrt_telephony https://mirror.bjtu.edu.cn/openwrt/releases/<version>/packages/<architecture>/telephony
Enter fullscreen mode Exit fullscreen mode

Replace https://mirror.bjtu.edu.cn/openwrt/ in the above content with the OpenWRT software source address you want to use. Note that <version> needs to be replaced with your OpenWRT version number, and <architecture> with your system architecture, such as X86_64.

Common Architectures

You can check the system architecture with the following commands:

# View current CPU architecture
uname -m

# View system acceptable CPU architectures
opkg print-architecture
Enter fullscreen mode Exit fullscreen mode
Instruction Set Architecture / Sub-architecture OpenWrt Package Structure
arm64/genericlayerscape/64b aarch64_armv8-a
arc770/generic arc_arc700
archs38/generic arc_archs
ARM brcm2708/bcm2708 arm_arm1176jzf-s_vfp
ARM at91/legacymcs814x/genericmxs/generic arm_arm926ej-s
ARM ipq806x/generic arm_cortex-a15_neon-vfpv4
ARM at91/sama5d3 arm_cortex-a5
ARM brcm2708/bcm2710 arm_cortex-a53_neon-vfpv4
ARM mediatek/generic arm_cortex-a7
ARM brcm2708/bcm2709 arm_cortex-a7_neon-vfpv4
ARM sunxi/generic arm_cortex-a8_vfpv3
ARM bcm53xx/genericlayerscape/32b arm_cortex-a9
ARM imx6/genericzynq/generic arm_cortex-a9_neon
ARM mvebu/genericomap/generic arm_cortex-a9_vfpv3
ARM gemini/raidsonicgemini/wiligear arm_fa526
ARM oxnas/generic arm_mpcore
ARM cns3xxx/generic arm_mpcore_vfp
ARM kirkwood/generic arm_xscale
ARM ixp4xx/genericixp4xx/harddisk armeb_xscale
MIPS64 malta/be64 mips64_mips64
MIPS64 octeon/generic mips64_octeon
MIPS64 malta/le64 mips64el_mips64
MIPS ar71xx/genericar71xx/nandar71xx/mikrotiklantiq/xrx200lantiq/xwaylantiq/xway_legacymalta/be mips_24kc
MIPS adm5120/router_beath25/genericbrcm63xx/genericbrcm63xx/smp mips_mips32
MIPS malta/leramips/rt305xramips/mt7620ramips/mt7621ramips/mt7628ramips/mt7688 mipsel_24kc
MIPS brcm47xx/mips74kramips/rt3883 mipsel_74kc
MIPS adm5120/router_leadm5120/rb1xxadm8668/genericar7/genericar7/ac49xau1000/au1500au1000/au1550brcm47xx/genericbrcm47xx/legacyrb532/genericxburst/qi_lb60 mipsel_mips32
MIPS ramips/rt288x mipsel_mips32r2
PPC ppc44x/generic powerpc_440
PPC apm821xx/nandapm821xx/sata powerpc_464fp
PPC mpc85xx/generic, mpc85xx/p1020 powerpc_8540
x86 x86/geode i386_geode
x86 x86/legacy i386_i486
x86 x86/generic i386_pentium4
x86_64 x86/64 x86_64

Command Line Replacement Method

Or modify it via command line with the format s,[original source address],[replacement source address],g:

sed -e 's,https://downloads.openwrt.org,https://mirror.bjtu.edu.cn/openwrt,g' \
-e 's,https://downloads.openwrt.org,https://mirror.bjtu.edu.cn/openwrt,g' \
-i.bak /etc/opkg/customfeeds.conf
Enter fullscreen mode Exit fullscreen mode

After replacing, run opkg update to update.

Notes

The official OpenWRT software sources may not fully match third-party customized firmware, such as those from esir or Leon, which might have incomplete libraries or compatibility issues. Additionally, the k-mod-*.ipk packages provided by official sources might not install directly.

If you're a beginner or just want to set up OpenWRT for long-term use, it is recommended to use ImmortalWRT, which might offer better support for software sources and also allows for custom configuration of domestic software sources with immoralwrt-opkg-replace-edu-mirror.

In the latest snapshot versions, OpenWRT has replaced opkg with apk package manager. Be mindful of the version when changing software sources. It is not recommended for beginners or novices to use snapshot (SNAPSHOT) or RC versions, nor is it advised to use non-open-source third-party firmware.

📎 Reference

Top comments (0)