尧图网站建设 尧图网络
  • 首页
  • 关于我们
  • 服务项目
  • 案例展示
  • 建站流程
  • 资讯中心
  • 联系我们
首页/资讯中心/详情

[Reprint] - Install Arm GNU Toolchain on Ubuntu 22.04

[Reprint] - Install Arm GNU Toolchain on Ubuntu 22.04
📅 发布时间:2026/6/20 6:59:00

[Reprint] - Install Arm GNU Toolchain on Ubuntu 22.04

Install Arm GNU Toolchain on Ubuntu 22.04

  •  January 16, 2022 (November 14, 2023)

The Arm GNU toolchain (previously known as GNU Arm Embedded toolchain) is a collection of packages such as GCC (GNU Compiler Collection), Binutils, GDB, and other. It is used for embedded systems software development. This toolchain targets the 32-bit ARM Cortex-A, ARM Cortex-M, and ARN Cortex-R processor families.

This tutorial shows how to install Arm GNU toolchain on Ubuntu 22.04.

Install toolchain

There is no straightforward way to determine the latest version of toolchain via command line. So download web page and extract the latest version of toolchain as follows:

ARM_TOOLCHAIN_VERSION=$(curl -s https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads | grep -Po '<h4>Version \K.+(?=</h4>)')
 

Next, download archive file from official website:

curl -Lo gcc-arm-none-eabi.tar.xz "https://developer.arm.com/-/media/Files/downloads/gnu/${ARM_TOOLCHAIN_VERSION}/binrel/arm-gnu-toolchain-${ARM_TOOLCHAIN_VERSION}-x86_64-arm-none-eabi.tar.xz"
 

Create a new directory to store toolchain files:

sudo mkdir /opt/gcc-arm-none-eabi
 

Extract toolchain files to specified directory:

sudo tar xf gcc-arm-none-eabi.tar.xz --strip-components=1 -C /opt/gcc-arm-none-eabi
 

Add /opt/gcc-arm-none-eabi/bin directory to the PATH environment variable.

echo 'export PATH=$PATH:/opt/gcc-arm-none-eabi/bin' | sudo tee -a /etc/profile.d/gcc-arm-none-eabi.sh
 

To make changes to take effect, logout and login to your system or run the following command to apply the changes immediately:

source /etc/profile
 

We can check version of compilers:

arm-none-eabi-gcc --version
 
arm-none-eabi-g++ --version
 

Remove unnecessary archive file:

rm -rf gcc-arm-none-eabi.tar.xz
 

Testing toolchain

Create a main.c file:

nano main.c
 

Add the following code:

#include <stdio.h> int main() { printf("Hello world\n"); return 0; }

Compile a code:

arm-none-eabi-gcc --specs=rdimon.specs main.c -o test
 

The file command can be used to verify that executable file is for ARM architecture.

file test
 

Output:

test: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, with debug_info, not stripped

Uninstall toolchain

If you want to completely remove GNU Arm Embedded toolchain, delete the installation directory:

sudo rm -rf /opt/gcc-arm-none-eabi
 

Remove gcc-arm-none-eabi.sh file that is used to set environment variable:

sudo rm -rf /etc/profile.d/gcc-arm-none-eabi.sh
 

GNU Debugger (GDB) dependencies

Read this section if you want to use GNU Debugger (GDB). It requires installing additional dependencies.

  • If you are receiving an error about missing libncursesw.so.5 library:
arm-none-eabi-gdb: error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory

Then install libncursesw5 package:

sudo apt install -y libncursesw5
 
  • On Linux, Arm GNU toolchain provides GDB with Python support. It requires installation of Python 3.8. If you are receiving an error regarding Python, such as:
Could not find platform independent libraries <prefix> Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] Python path configuration: PYTHONHOME = (not set) PYTHONPATH = (not set) ... Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding Python runtime state: core initialized ModuleNotFoundError: No module named 'encodings'

Then install Python 3.8 using the separate post. See section "Install older versions".

When installation finished, check GDB version:

arm-none-eabi-gdb --version
 

If everything installed successfully, you will get output similar to the following:

GNU gdb (Arm GNU Toolchain 12.2.MPACBTI-Bet1 (Build arm-12-mpacbti.16)) 13.0.50.20220406-git Copyright (C) 2022 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

相关新闻

  • 1_二分查找
  • redis使用lua脚本迁移数据到集群版redis失败怎么解决
  • 详细介绍:医疗编程AI技能树与培训技能树报告(国内外一流大学医疗AI相关专业分析2025版,下)

最新新闻

  • LLM嵌入技术在表格数据预测中的应用与实践
  • 渗透测试实战:CDN绕过与子域名爆破核心技术解析
  • 5个实用技巧:用FitGirl游戏启动器轻松管理你的压缩版游戏库
  • 沃尔玛成钓鱼攻击首选目标:高仿真品牌钓鱼的攻防解析与防范指南
  • 软件测试基础:黑盒、白盒、灰盒测试
  • 2026年工业工厂吸尘器Top3:Shiwosi史沃斯凭什么第一? - 工业清洁测评社

日新闻

  • 信任的进化:技术实现详解——如何用JavaScript构建博弈论模拟器
  • Terrakube自定义工作流:如何集成OPA、Infracost等工具扩展IaC能力
  • grunt-concurrent快速入门:5分钟学会并行运行Grunt任务

周新闻

  • 3步解锁iOS设备:applera1n激活锁绕过完全指南
  • 39 2026 人工智能证书终极盘点,普通人选 AI 证书可以从这些方向入手
  • Redis 暴露公网有多危险?从端口检查到补救步骤

月新闻

  • 【总结】入门篇:50句话让你记住架构核心概念
  • WeChatMsg技术方案解析:实现Mac微信数据自主管理的完整解决方案
  • WeChatMsg:革新性微信数据备份方案,打造你的专属数字记忆库

关于尧图

  • 公司简介
  • 团队介绍
  • 企业文化
  • 荣誉资质

服务项目

  • 定制开发
  • 电商建站
  • UI 设计
  • 运维服务

快速链接

  • 案例展示
  • 建站流程
  • 常见问题
  • 资讯中心

联系方式

  • 📍北京市朝阳区互联网产业园 A 座 10 层
  • 📞400-888-8888
  • ✉️contact@rkmt.cn
  • 🕐周一至周日 9:00-21:00

© 2024 北京尧图网络科技有限公司 版权所有 | 京 ICP 备 XXXXXXXX 号