How to install cross-compiler on Ubuntu 18.04?

TLDR

you need to call arm-linux-gnueabi-gcc not arm-linux-gcc.


It looks like you've just got the wrong file name. For reference apt-file is a useful tool.

sudo apt-get install apt-file
sudo apt-file update
apt-file search -x 'gcc$' | grep 'gcc-arm-linux-gnueabi'

This searches any file ending gcc in any package with gcc-arm-linux-gnueabi in the name. The result is:

gcc-arm-linux-gnueabi: /usr/bin/arm-linux-gnueabi-gcc

So if you have installed gcc-arm-linux-gnueabi you should have a file /usr/bin/arm-linux-gnueabi-gcc.


As steeldriver suggests, you already have installed the cross-compiler; the problem is that you’re using the wrong command to invoke it, you need to use the arm-linux-gnueabi- prefix in general. So run

arm-linux-gnueabi-gcc

or

arm-linux-gnueabi-g++

and it should work fine.

To figure this out yourself, you can use dpkg -L to list the contents of the packages you’ve installed:

dpkg -L gcc-arm-linux-gnueabi