Installation problems on Ubuntu

Can someone please provide up-to-date installation instructions for ArduPlane?

Followed these instructions for Ubuntu:

Getting/cloning the github directory works and so does the installation of required packages with

Tools/environment_install/install-prereqs-ubuntu.sh -y

However, the docker command results in

remote: Support for password authentication was removed on August 13, 2021.
remote: Please see About remote repositories - GitHub Docs for information on currently recommended modes of authentication.
fatal: Authentifizierung fehlgeschlagen für ‘https://github.com/your-github-userid/ardupilot/

and so does

~$ docker build . -t ardupilot

ERROR: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get “http://%2Fvar%2Frun%2Fdocker.sock/_ping”: dial unix /var/run/docker.sock: connect: permission denied

Thanks
Christian

Hi, I am on Debian bookworm and do the building in a VM running Debian bullseye.

Here is my howto note

green > preparation building environment

red > building the firmware

You could try this script for setting up the environment

I had no luck building under bookworm and posted a comment here, but there seems to be no interest …

regards KH

The thread you linked culminates in a pull request that supports Bookworm fully.

The prereqs script should eliminate the need to install packages manually. Its name is slightly misleading, as it works for several common distros and not just Ubuntu.

But you have seen my post there, that it hangs on a clean Debian bookworm in VM!?

Therefore I am still building on bullseye …

br KH

Don’t use that script or manually install a bunch of packages. Just use Tools/environment_install/install-prereqs-ubuntu.sh immediately after cloning the repository on a fresh OS install. Works perfectly and even updates submodules.

~$ git clone --recurse-submodules https://github.com/ArduPilot/ardupilot.git

~$ ./install-prereqs-ubuntu.sh

~$ cd ardupilot

~/ardupilot$ /.waf configure --board revo-mini

… and that thing stops here.

New File.txt (36.1 KB)

And that is on a clean VM Debian 12.

OK, installing that ‘arm-none-eabi’ package is peanuts, but for instance, I am not sure, if you even have ‘git’ on a clean Debian installation? Ubuntu or LM might have those packages installed per default, but Debian keeps things simple from the start.

br KH

Yes, I (and others) tested multiple times on a pristine Bookworm install, and the repo’s unit tests run without issue.

If you answer yes to all of the bash options during install, you should then log out and log back in or source ~/.profile to activate the environment.

I might not be so clever like those without issues … :wink:

Where are my mistakes here??

  • git has to be installed by the user, it definitely is not installed by default in DEBIAN 12. Made a fresh VM with debian-12.5.0-amd64-netinst.iso

~$ git clone --recurse-submodules https://github.com/ArduPilot/ardupilot.git

~$ ./install-prereqs-ubuntu.sh

and I entered a Y/y whenever! requested

This script ends with a

./install-prereqs-ubuntu.sh: line 449: //Tools/completion/completion.bash: No such file or directory

Then a Logout — login and the terminal shows that

bash: //Tools/completion/completion.bash: No such file or directory
kalle@debian:~$ cd ardupilot
kalle@debian:~/ardupilot$ /.waf configure --board revo-mini
bash: /.waf: No such file or directory
kalle@debian:~/ardupilot$

New File.txt (121.9 KB)

regards KH

Ok, so you need git as a prerequisite. Fine.

sudo apt install git
git clone --recurse-submodules https://github.com/ArduPilot/ardupilot.git
cd ardupilot
./Tools/environment_install/install-prereqs-ubuntu.sh
source ~/.profile

Don’t download the script separately. It uses relative paths and should be run in place.

Next run …

~$ sudo apt install git

$ git clone --recurse-submodules GitHub - ArduPilot/ardupilot: ArduPlane, ArduCopter, ArduRover, ArduSub source

~$ cd ardupilot

~/ardupilot$ ./Tools/environment_install/install-prereqs-ubuntu.sh

~/ardupilot$ source ~/.profile

LOGOUT — LOGIN

~$ cd ardupilot

~/ardupilot$ ./waf configure --board revo-mini
Setting top to : /home/kalle/ardupilot
Setting out to : /home/kalle/ardupilot/build
Autoconfiguration : enabled
Checking for program ‘python’ : /usr/bin/python3
Checking for python version >= 3.6.9 : 3.11.2
Setting board to : revo-mini
Using toolchain : arm-none-eabi
Could not find the program [‘arm-none-eabi-ar’]
(complete log in /home/kalle/ardupilot/build/config.log)
kalle@debian:~/ardupilot$

Finish for today. Tomorrow is another one … :wink:

br KH

New File.txt (126.8 KB)

config.log (2.3 KB)

it is just that your are in a VM and probably not use some interactive user so the .profile isn’t loaded. That is our toolchain isn’t into your PATH. install gcc-arm-none-eabi from apt repo create a diff against our tests and can be totally broken …

I just tested on a fresh Bookworm container, and everything worked perfectly, including configuring and building for the Revo board you’re using.

It appears you elected not to make ArduPilot the default venv for Python (recommended), and it looks like you also decided not to install the STM32 toolchain, if I’m reading your install log correctly. At a minimum, you need the STM32 toolchain.

If you want the smoothest experience, you really ought to say “y” to all prompts (many default to “n” if you just press enter).

You can opt out of the default venv, but then (on the most recent Debian-based distros) you must execute this command prior to building:
source ~/venv-ardupilot/bin/activate

If you don’t see a prompt beginning with venv-ardupilot, things won’t go well:
(venv-ardupilot) yuri@apbookworm:~/ardupilot$

To exit the venv (and build environment), you can use deactivate at any time.

Hey guys, thank you so much indeed for your input!

Wanted to add, I am an Ubuntu user since 12 years and I consider myself knowledgeable on Debian/Ubuntu. This is NOT any sort of container or VM, it’s my daily use Ubuntu 20.04.6 LTS PC where this
happened.

  • Github is installed
  • I successfully cloned Ardupilot
  • The required dependencies installed without any problems

It would appear (as the error message I got says) you’d need a Docker key instead of username/password to proceed from there.

I have the newest Git version, 1:2.25.1-1ubuntu3.11.

git clone --recurse-submodules https://github.com/ArduPilot/ardupilot.git`

works and pulls the files.

From thereon things get messy, missing permissions or files not present.

I also have all the additional requirements from

ools/environment_install/install-prereqs-ubuntu.sh -y

says “Requirement already satisfied:”

/github.com/ArduPilot/ardupilot/blob/master/BUILD.md

Built instructions don’t work for me

The same series of commands I posted here earlier should work for you.

Sorry Yuri for the trouble. Maybe the fault was on my side :wink:

New day and a fresh try. It works here!

[1006/1008] apj_gen build/revo-mini/bin/arduplane.bin
[1007/1008] bin cleanup build/revo-mini/bin/arduplane.bin
[1008/1008] Generating bin/arduplane_with_bl.hex
Waf: Leaving directory `/home/kalle/ardupilot/build/revo-mini’

BUILD SUMMARY
Build directory: /home/kalle/ardupilot/build/revo-mini
Target Text (B) Data (B) BSS (B) Total Flash Used (B) Free Flash (B) External Flash Used (B)

bin/arduplane 881364 2460 128692 883824 99208 Not Applicable

Build commands will be stored in build/revo-mini/compile_commands.json
‘plane’ finished successfully (2m29.547s)
(venv-ardupilot) kalle@debian:~/ardupilot$

Building in a DEBIAN 12 bookworm VM!!

Best regards KH