Ubuntu16.04 安装 arm-linux-gcc方法步骤

准备:arm-linux-gcc资源文件

链接:https://pan.baidu.com/s/1YqHXtyTZ-twCeeYk2suOvw 密码:x299

步骤一:下载toolschain至Ubuntu桌面并解压;

步骤二:用户文件夹下新建文件(此处新建arm文件夹)

sudo mkdir /usr/local/arm

步骤三:复制原始toolschain文件至arm下:

sudo cp -r /home/Desptop/toolschain/4.5.1 /usr/local/arm

步骤四:添加环境变量:

sudo gedit /etc/profile

添加内容为:

export PATH=$PATH:/usr/local/arm/4.5.1/bin

步骤五:更新环境变量:

source /etc/profile

步骤六:检验安装:

arm-linux-gcc -v

可能存在的问题:安装成功,提示无法找到该文件

bash: /usr/local/arm/4.5.1/bin/arm-linux-gcc: No such file or directory

解决办法:添加32位库文件

sudo apt-get install ia32-libs

问题提示:

Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  lib32ncurses5 lib32z1

解决办法:

sudo apt-get install lib32ncurses5 lib32z1

再次检测,输出成功,提示如下:

Thread model: posix
gcc version 4.5.1 (ctng-1.8.1-FA) 

 

你可能感兴趣的:(linux)