
首先配置opkg源。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # 备份初始conf
mv /etc/opkg.conf /etc/opkg.conf.bak
# 新建配置
vim /etc/opkg.conf
# 添加如下内容:
dest root /
dest ram /tmp
lists_dir ext / var /opkg-lists
option overlay_root /overlay
# notice
dest usb /mnt/sdb1/opkg
arch all 100
arch ramips_24kec 200
arch ramips 300
arch mips 400
arch unkown 500
src/gz barrier_breaker_base http:
src/gz barrier_breaker_luci http:
src/gz barrier_breaker_management http:
src/gz barrier_breaker_oldpackages http:
oldpackages
src/gz barrier_breaker_packages http:
src/gz barrier_breaker_routing http:
src/gz barrier_breaker_telephony http:
# wq保存
# 执行升级
opkg update
|
相关推荐:《Python入门教程》
安装Python
需要注意的是,小米路由器的可用空间不多,但Python的安装会占用挺大的空间,所以我们指定opkg将程序安装在U盘或硬盘上。
这时我们回到刚才的配置文件里,找到notice,这里的dest usb /mnt/sdb1/opkg就是指定变量usb为外置存储路径/mnt/sdb1/opkg。外置存储的路径可以用df -h查看。
以后我们使用opkg -d usb install xxx即可将程序安装至/mnt/sdb1/opkg。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | # 先需要安装libc,需要下载下来安装
## 建立文件夹
mkdir -p /mnt/sdb1/opkg/src
cd /mnt/sdb1/opkg/src
wget http:
## 安装libc,最好安装到根下
opkg install libc_0.9.33.2-1_ramips_24kec.ipk
# 接着安装Python
opkg -d usb install libreadline
opkg -d usb install python
opkg -d usb install python-json
opkg -d usb install python-curl
opkg -d usb install python-openssl
# 路径
export PATH= $PATH :/mnt/sdb1/opkg/usr/bin
echo 'export PATH=$PATH:/mnt/sdb1/opkg/usr/bin' >> /etc/profile
# 别名
echo "alias opintall='opkg -d usb install'" >> /etc/profile
|