How can I install Mongodb database tools on Github actions?

My objective is to install MongoDB Command Line Database Tools on Github Actions.

I’m using Ubuntu-latest, currently running version 22.

My script looks like this, in the yml file:

- name: Setup mongodb-tools
  run: |
    wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-arm64-100.6.1.deb
    sudo apt install ./mongodb-database-tools-*-100.6.1.deb

But it fails with:

2023-01-10 11:21:19 (66.6 MB/s) - ‘mongodb-database-tools-ubuntu2204-arm64-100.6.1.deb’ saved [45465340/45465340]


WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mongodb-database-tools:arm64 : Depends: libc6:arm64 but it is not installable
                                Depends: libgssapi-krb5-2:arm64 but it is not installable
                                Depends: libkrb5-3:arm64 but it is not installable
                                Depends: libk5crypto3:arm64 but it is not installable
                                Depends: libcomerr2:arm64 but it is not installable
                                Depends: libkrb5support0:arm64 but it is not installable
                                Depends: libkeyutils1:arm64 but it is not installable
E: Unable to correct problems, you have held broken packages.
Error: Process completed with exit code 100.

Please consult :sweat_smile:

Update

The problem was that I was installing with the wrong architecture, this script installs mongodb-tools correctly:

- name: Setup mongodb-tools
  run: |
    wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-x86_64-100.6.1.deb
    sudo apt install ./mongodb-database-tools-*-100.6.1.deb
    mongorestore --version

However it’s pretty slow, takes around 18seconds, so still looking for a better alternative.

1 Like

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