(15): Yocto中的包管理器
最后更新于:2022-04-01 16:21:03
使用包管理器
在local.conf中使能即可:
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/2016-04-08_570776a251268.jpg)
然后编译后就会有rpm包了:
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/2016-04-08_570776a26d94b.jpg)
配置文件服务器
可以使用ngix和apache,但是我们也可以只用使用python:
~~~
python -m SimpleHTTPServer
~~~
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/2016-04-08_570776a284f38.jpg)
打开浏览器可以看到:
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/2016-04-08_570776a298a32.jpg)
在机器上面查看包的status
smart status
![](image/56a4d543aed37.jpg)
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/2016-04-08_570776a2afb9f.jpg)
在机器上面配置channel
对于rpm使用的smart工具,添加channel:
~~~
smart channel --add all type=rpm-md baseurl=http://192.168.2.100:8000/all
smart channel --add cortexa9hf_vfp_neon type=rpm-md baseurl=http://192.168.2.100:8000/cortexa9hf_vfp_neon
smart channel --add cortexa9hf_vfp_neon_mx6qdl type=rpm-md baseurl=http://192.168.2.100:8000/cortexa9hf_vfp_neon_mx6qdl
smart channel --add imx6qsabresd type=rpm-md baseurl=http://192.168.2.100:8000/imx6qsabresd
~~~
添加参数之后,就可以update了:
smart update
正确的是下面命令的情形:
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/2016-04-08_570776a2c53aa.jpg)
如果配置参数不对,那么就会出错,如果出错,那么检查IP与格式是否正确,例如下面的http少了两个//:
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/2016-04-08_570776a2e49d4.jpg)
如果弄错了,那么可以先移除掉:
~~~
smart channel --remove all cortexa9hf_vfp_neon_mx6qdl imx6qsabresd cortexa9hf_vfp_neon
~~~
然后重新添加。
再看包的数量,可以看到变多了:
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/2016-04-08_570776a30f20f.jpg)
使用包管理器安装软件
使用smart install Package即可安装:
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/2016-04-08_570776a324435.jpg)
如果在PC中使用bitbake新编译了程序,那么需要使用下面命令重建index,否则客服端找不到新的软件包:
~~~
bitbake package-index
~~~
参考:
[http://www.jumpnowtek.com/yocto/Using-your-build-workstation-as-a-remote-package-repository.html](http://www.jumpnowtek.com/yocto/Using-your-build-workstation-as-a-remote-package-repository.html)
[package-manager-white-paper.pdf](#)