본문 바로가기

임베디드, 컴퓨터구조론

arm-none-eabi-gdb 설치 (Ubuntu 20.04)

요즘 『임베디드 OS 개발 프로젝트』보고있는데, arm-none-eabi-gdb 설치 시 package를 찾을 수 없다고 나온다.

나는 아래처럼 해서 문제를 해결했다.

1. 아래 사이트에서 운영체제에 맞게 압축 파일을 다운 받는다.
https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads

 

GNU Toolchain | GNU Arm Embedded Toolchain Downloads – Arm Developer

Download the GNU Embedded Toolchain for ARM, an open-source suite of tools for C, C++, and Assembly programming for 32-bit ARM Cortex-A, ARM Cortex-M and Cortex-R families

developer.arm.com

 

2. 기존에 깔려있던 gcc-arm-none-eabi package들을 삭제한다

sudo apt remove gcc-arm-none-eabi

2-1. 나는 아래와 같은 메시지가 떠서, 메시지가 안내하는 대로 했다.

$ sudo apt remove gcc-arm-none-eabi 
[sudo] password for norm: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 gdb-multiarch : Depends: gdb (= 10.1-2ubuntu2) but 9.2-0ubuntu1~20.04 is to be installed
                 Depends: libc6 (>= 2.33) but 2.31-0ubuntu9.2 is to be installed
                 Depends: libdebuginfod1 (>= 0.180) but it is not installable
                 Depends: libipt2 (>= 2.0) but it is not going to be installed
                 Depends: libpython3.9 (>= 3.9.1) but it is not going to be installed
                 Depends: libsource-highlight4v5 (>= 3.1.9) but it is not going to be installed
                 Depends: libxxhash0 (>= 0.6.5) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libfprint-2-tod1 libllvm10 linux-headers-5.8.0-48-generic linux-hwe-5.8-headers-5.8.0-48
  linux-image-5.8.0-48-generic linux-modules-5.8.0-48-generic linux-modules-extra-5.8.0-48-generic
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  gdb-multiarch
0 upgraded, 0 newly installed, 1 to remove and 4 not upgraded.
1 not fully installed or removed.
After this operation, 16.5 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 279449 files and directories currently installed.)
Removing gdb-multiarch (10.1-2ubuntu2) ...

 

3. 아까 다운받은 패키지의 압축을 푼다. 나는 참고 사이트에서 한 대로 /usr/share 폴더 밑에 두었다.

sudo tar xjf gcc-arm-none-eabi-10-2020-q4-major.tar.bz2 -C /usr/share/

4. symbolic link를 만든다.

sudo ln -s /usr/share/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc /usr/bin/arm-none-eabi-gcc 
sudo ln -s /usr/share/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-g++ /usr/bin/arm-none-eabi-g++
sudo ln -s /usr/share/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gdb /usr/bin/arm-none-eabi-gdb
sudo ln -s /usr/share/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-size /usr/bin/arm-none-eabi-size

5. 해당 파일들을 실행하고, 추가적인 Dependency package를 확인한다.

 

참고

https://askubuntu.com/questions/1243252/how-to-install-arm-none-eabi-gdb-on-ubuntu-20-04-lts-focal-fossa