小编给大家分享一下openwrt安装python的方法,希望大家阅读完这篇文章后大所收获,下面让我们一起去探讨吧!

首先配置opkg源。

#备份初始confmv/etc/opkg.conf/etc/opkg.conf.bak#新建配置vim/etc/opkg.conf#添加如下内容:destroot/destram/tmplists_dirext/var/opkg-listsoptionoverlay_root/overlay#noticedestusb/mnt/sdb1/opkgarchall100archramips_24kec200archramips300archmips400archunkown500src/gzbarrier_breaker_basehttp://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/basesrc/gzbarrier_breaker_lucihttp://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/lucisrc/gzbarrier_breaker_managementhttp://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/managementsrc/gzbarrier_breaker_oldpackageshttp://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/oldpackagessrc/gzbarrier_breaker_packageshttp://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/packagessrc/gzbarrier_breaker_routinghttp://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/routingsrc/gzbarrier_breaker_telephonyhttp://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/telephony#wq保存#执行升级opkgupdate

安装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/srccd/mnt/sdb1/opkg/srcwgethttp://downloads.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/packages/base/libc_0.9.33.2-1_ramips_24kec.ipk##安装libc,最好安装到根下opkginstalllibc_0.9.33.2-1_ramips_24kec.ipk#接着安装Pythonopkg-dusbinstalllibreadlineopkg-dusbinstallpythonopkg-dusbinstallpython-jsonopkg-dusbinstallpython-curlopkg-dusbinstallpython-openssl#路径exportPATH=$PATH:/mnt/sdb1/opkg/usr/binecho'exportPATH=$PATH:/mnt/sdb1/opkg/usr/bin'>>/etc/profile#别名echo"aliasopintall='opkg-dusbinstall'">>/etc/profile

看完了这篇文章,相信你对openwrt安装python的方法有了一定的了解,想了解更多相关知识,欢迎关注亿速云行业资讯频道,感谢各位的阅读!