韦东山嵌入式Linux学习笔记03--如何搭建软件环境
1. 从网上下一个虚拟机,比如vmvare station
2.下一个ubuntu镜像回来安装, 我下了14.04来安装.参考链接: https://blog.csdn.net/qq1326702940/article/details/82322079
3.如果ubuntu界面不能正常缩放,可以使用命令安装vm tools
第一行命令:sudo apt-get upgrate
第二行命令:sudo apt-get install open-vm-tools-desktop -y
第三行命令:sudo reboot
4.更新Ubuntu的软件更新源
sudo cp /etc/apt/source.list /etc/apt/source.list.bk
sudo gedit /etc/apt/source.list
清空里面的内容,然后加入下面内容:
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiverse
上面是16.04的, 如果是14.04,需要将xenial全部替换成trusty
保存后执行 sudo apt-get update
5.编译环境
首先需要配置交叉工具链才能够编译代码,请参照链接: https://jingyan.baidu.com/article/647f01151899607f2148a8f2.htm
source /etc/profile 使生效
表示已经生效.
如果仍然提示找不到命令,就像下图一样
运行 arm-linux-gcc -v的时候也提示 bash: /usr/local/arm/2.3.6/bin/arm-linux-gcc: No such file or directory
这时候应当注意,因为未安装32位库,执行sudo apt-get install lib32ncurses5 lib32z1
执行完再查看命令,如果能查看版本号,说明环境ok了.