openwrt如何安装python

972次阅读
没有评论

openwrt如何安装python

首先配置opkg源。

# 备份初始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://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/base
src/gz barrier_breaker_luci http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/luci
src/gz barrier_breaker_management http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/management
src/gz barrier_breaker_oldpackages http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/ 
oldpackages
src/gz barrier_breaker_packages http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/packages
src/gz barrier_breaker_routing http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/routing
src/gz barrier_breaker_telephony http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/telephony
# wq保存
# 执行升级
opkg update

安装Python

需要注意的是,小米路由器的可用空间不多,但Python的安装会占用挺大的空间,所以我们指定opkg将程序安装在U盘或硬盘上。

这时我们回到刚才的配置文件里,找到notice,这里的dest usb /mnt/sdb1/opkg就是指定变量usb为外置存储路径/mnt/sdb1/opkg。外置存储的路径可以用df -h查看。

以后我们使用opkg -d usb install xxx即可将程序安装至/mnt/sdb1/opkg。

# 先需要安装libc,需要下载下来安装
## 建立文件夹
mkdir -p /mnt/sdb1/opkg/src
cd /mnt/sdb1/opkg/src
wget http://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/base/libc_0.9.33.2-1_ramips_24kec.ipk
## 安装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
神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试

相关文章:

版权声明:wuyou2021-06-27发表,共计1927字。
新手QQ群:570568346,欢迎进群讨论 Python51学习