Build error: OSError while trying to execute sudo ... No such file or directory: 'sudo'

I am first time contributor following the documentation to build my app before creating a merge request. When executing fdroid build --on-server com.example I receive the following error: Could not build app com.harr1424.listmaker: OSError while trying to execute sudo DEBIAN_FRONTEND=noninteractive bash -x -c ... [Errno 2] No such file or directory: 'sudo'

My metadata file is as follows:

Categories:
  - Reading
  - Science & Education
  - Time
  - Writing
License: MIT
SourceCode: https://github.com/harr1424/ListMaker
IssueTracker: https://github.com/harr1424/ListMaker/issues

Summary: A simple and easy to use list applicaton
Description: "Manage multiple areas of your life with ease. ListMaker allows you to\
    \ \ncreate a main list of categories which can each contain child  lists\nof TODO\
    \ items. Perfect for grocery, shopping, travel, and any other lists\nyou can imagine. "

RepoType: git
Repo: https://github.com/harr1424/ListMaker

Builds:
  - versionName: '2.1'
    versionCode: 2
    commit: v2.1
    subdir: app
    sudo:
      - apt-get update || apt-get update
      - apt-get install -y openjdk-11-jdk-headless
      - update-alternatives --auto java
    gradle:
      - yes

AutoUpdateMode: None
UpdateCheckMode: None
CurrentVersion: '2.1'
CurrentVersionCode: 2

My metadata file’s sudo section follows the documentation, can anyone explain what might be causing this error?

Builds fine, update https://github.com/harr1424/ListMaker/blob/v2.1/app/build.gradle#L21-L22 and retag

Guess: You don’t have sudo installed, or sudo options are not as assumed by documentation.

--on-server is not a current option so maybe it’s an old fdroidserver

that being said, on-server needs a VM via vagrant or libvirt, which one do you have?

It appears more like you run this directly in a VM or on bare metal? If so then remove --on-server

The documentation was correct, and @Licaon_Kter provided a solution. The version name in source code did not match what was provided in metadata.

Oh, I thought you’ve just replaced that when posting here :slight_smile:

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.