给我的软路由 opkg 相关的配置文件做个备份

首先是 /etc/opkg.conf 主要配置文件

root@softRouter:/etc/opkg# cat /etc/opkg.conf
dest root /
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay

arch all 100
arch x86_64 200
arch x64-3.2 300

关于 cpu architecture 使用怎样的 arch 值 可以学习一下 这篇文章: 修改opkg.conf解决incompatible with the architectures configured问题 https://github.com/dafeiyoung/sguclient/wiki/%E4%BF%AE%E6%94%B9opkg.conf%E8%A7%A3%E5%86%B3incompatible-with-the-architectures-configured%E9%97%AE%E9%A2%98

使用 opkg info | grep Architecture 查看你的openwrt 平台上的 cpu 架构信息 比如 arm mips 或是 x86_64 等等

cd 到 /etc/opkg 目录

cd /etc/opkg

官方源 /etc/opkg/distfeeds.conf 建议保留 这个文件不用更改

root@softRouter:/etc/opkg# cat distfeeds.conf
src/gz openwrt_core https://openwrt.proxy.ustclug.org/snapshots/targets/x86/64/packages
src/gz openwrt_base https://openwrt.proxy.ustclug.org/snapshots/packages/x86_64/base
src/gz openwrt_luci https://openwrt.proxy.ustclug.org/snapshots/packages/x86_64/luci
src/gz openwrt_packages https://openwrt.proxy.ustclug.org/snapshots/packages/x86_64/packages
src/gz openwrt_routing https://openwrt.proxy.ustclug.org/snapshots/packages/x86_64/routing

在我们下载或更新程序包时 使用国内源肯定会快很多 建议修改的是 自定义源 把它改成本地的源 修改文件 /etc/opkg/customfeeds.conf 如下 这里用的是 中科大镜像

ps 在这里遇到了一个问题: duplicate src declaration 错误信息 类似于下面这样

Collected errors:
* opkg_conf_parse_file: Duplicate src declaration (chaos_calmer_base http://downloads.openwrt.org/chaos_calmer/15.05.1/x86/64/packages/base). Skipping.
* opkg_conf_parse_file: Duplicate src declaration (chaos_calmer_luci http://downloads.openwrt.org/chaos_calmer/15.05.1/x86/64/packages/luci). Skipping.
* opkg_conf_parse_file: Duplicate src declaration (chaos_calmer_packages http://downloads.openwrt.org/chaos_calmer/15.05.1/x86/64/packages/packages). Skipping.
* opkg_conf_parse_file: Duplicate src declaration (chaos_calmer_routing http://downloads.openwrt.org/chaos_calmer/15.05.1/x86/64/packages/routing). Skipping.
* opkg_conf_parse_file: Duplicate src declaration (chaos_calmer_telephony http://downloads.openwrt.org/chaos_calmer/15.05.1/x86/64/packages/telephony). Skipping.
* opkg_conf_parse_file: Duplicate src declaration (chaos_calmer_management http://downloads.openwrt.org/chaos_calmer/15.05.1/x86/64/packages/management). Skipping.
src/gz openwrt_core http://mirrors.ustc.edu.cn/lede/releases/18.06.4/targets/x86/64/packages
src/gz openwrt_base http://mirrors.ustc.edu.cn/lede/releases/18.06.4/packages/x86_64/base
src/gz openwrt_luci http://mirrors.ustc.edu.cn/lede/releases/18.06.4/packages/x86_64/luci
src/gz openwrt_packages http://mirrors.ustc.edu.cn/lede/releases/18.06.4/packages/x86_64/packages
src/gz openwrt_routing http://mirrors.ustc.edu.cn/lede/releases/18.06.4/packages/x86_64/routing
src/gz openwrt_telephony http://mirrors.ustc.edu.cn/lede/releases/18.06.4/packages/x86_64/telephony

观察后 把这些程序包对应的 alias 修改一下: openwrt_core 改成 core 其他类似 (目的: 使每个 item 唯一; 一个相同名字的 item 不能指向多个链接)

最终的 /etc/opkg/customfeeds.conf 如下

root@softRouter:/etc/opkg# cat customfeeds.conf
# add your custom package feeds here
#
# src/gz example_feed_name http://www.example.com/path/to/files

src/gz core http://mirrors.ustc.edu.cn/lede/releases/18.06.4/targets/x86/64/packages
src/gz base http://mirrors.ustc.edu.cn/lede/releases/18.06.4/packages/x86_64/base
src/gz luci http://mirrors.ustc.edu.cn/lede/releases/18.06.4/packages/x86_64/luci
src/gz packages http://mirrors.ustc.edu.cn/lede/releases/18.06.4/packages/x86_64/packages
src/gz routing http://mirrors.ustc.edu.cn/lede/releases/18.06.4/packages/x86_64/routing
src/gz telephony http://mirrors.ustc.edu.cn/lede/releases/18.06.4/packages/x86_64/telephony

最终修改好 /etc/opkg.conf/etc/opkg/distfeeds.conf/etc/opkg/customfeeds.conf 修改好这三个文件 再执行

opkg update

执行成功后就可以愉快的玩耍了 :)

end.