惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research
N
Netflix TechBlog - Medium
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园_首页
宝玉的分享
宝玉的分享
Google DeepMind News
Google DeepMind News
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
量子位
Blog — PlanetScale
Blog — PlanetScale
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
阮一峰的网络日志
阮一峰的网络日志
D
Docker
罗磊的独立博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
IT之家
IT之家
MyScale Blog
MyScale Blog
Microsoft Azure Blog
Microsoft Azure Blog

Allen Hua 的网络博客

由于 Linux 桌面没有一个好用的天气程序就写了一个跨平台的CheckitoutWeather 给 caesium-image-compressor 图片压缩程序构建了 Linux AppImage v2.8.5 最新版 debian13(debian trixie)安装了nvidia闭源驱动后从x11切换到wayland的方法 山间摩旅追风,偶遇一场绚烂晚霞 最近使用debian系统的一些心得 机械革命无界14Pro笔记本debian forky成功驱动内置扬声器和麦克风 记录 typecho 1.2.0 升级到 1.3.0 过程 开发了一款openwrt插件:文本剪贴板 解决机械革命笔记本内屏高刷240Hz闪屏问题 使用 Java 写了一个局域网端口扫描器 - Allen Hua 的网络博客 openwrt使用外置根extroot机制扩展根分区大小 - Allen Hua 的网络博客 将机场ss节点批量转换成ss字符串链接批量添加到passwall - Allen Hua 的网络博客 给机械革命钛钽plus换屏:NY2换成NZ2 - Allen Hua 的网络博客 记录一次pve宿主机和上面的debian虚机无故down机事件 - Allen Hua 的网络博客 给图床部署cdn腾讯云的edgeone并排查Cache-Control max-age 3600的问题 - Allen Hua 的网络博客 从高山草甸到徽派古村:武功山反穿与皖浙赣自驾行记 - Allen Hua 的网络博客 增程器就是充电宝?别被忽悠了 - Allen Hua 的网络博客 浦口龙虎巷扫街,记录人间真实 博客图片压缩方案更新|AVIF|WebP|MozJPEG|标准JPEG Windows 电脑使用 Obs Studio 录制各个网站视频/桌面画面教程 为typecho博客添加latex支持 新能源汽车之纯电车使用交流慢充和直流快充的充电损耗对比 2025年3月更新全国5A景区名录 2025最新查看小米/红米手机电池健康度和循环次数方法 完美解决 seafile FILE_SERVER_ROOT 配置导致的内网外网不能同时访问和上传下载的问题 纯css实现typecho博客文章文字spoiler剧透效果 我对Typecho Facile主题的一些修改,图片懒加载优化,样式定制 2024年8月我的宜昌 - 重庆 - 川西小环线自驾旅行分享 2022年打卡南京市区人防工程纳凉点 2024年带着A7C2+腾龙28-200 再次来到红山森林动物园
lede/openwrt 环境的 自带源 和 国内源 相关配置
Allen Hua · 2020-06-21 · via Allen Hua 的网络博客
阅读量:21801

warning: 这篇文章距离上次修改已过1869天,其中的内容可能已经有所变动。

给我的软路由 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.