Megatools: how to install latest version

Hi,
I was using megatools on zorin os 16.3 and everything was working fine. Yesterday I upgraded to 17.1 and megatools was upgraded to 1.10.3. Unfortunately, this version has a known bug fixed by version 1.11.x.

megadl --version
megatools 1.10.3 - command line tools for Mega.nz

How can I install the latest version? It is available with ubuntu from 23.10.
Thank you

P.S. as is often the case, installing it manually does not work.
Ubuntu 24.04 package

wget http://de.archive.ubuntu.com/ubuntu/pool/universe/m/megatools/megatools_1.11.1-1build3_amd64.deb
sudo apt-get install ./megatools_1.11.1-1build3_amd64.deb 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'megatools' instead of './megatools_1.11.1-1build3_amd64.deb'
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:
 megatools : Depends: libcurl4t64 (>= 7.16.2) but it is not installable
             Depends: libglib2.0-0t64 (>= 2.75.3) but it is not installable
             Depends: libssl3t64 (>= 3.0.0) but it is not installable
E: Unable to correct problems, you have held broken packages.

Ubuntu 23.10 package

sudo apt-get install ./megatools_1.11.1-1_amd64.deb 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'megatools' instead of './megatools_1.11.1-1_amd64.deb'
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:
 megatools : Depends: libglib2.0-0 (>= 2.75.3) but 2.72.4-0ubuntu2.3 is to be installed
E: Unable to correct problems, you have held broken packages.

Hi,
I tried to compile the code myself.

apt install  build-essential libcurl4 curl asciidoc libssl-dev libtool automake autoconf meson ninja-build libcurl4-doc
wget https://megatools.megous.com/builds/megatools-1.11.0.tar.gz{,.asc}
gpg --verify megatools-1.11.0.tar.gz.asc
tar xf megatools-1.11.0.tar.gz
cd megatools-1.11.0
meson setup --prefix $HOME/.local .build
ninja -C .build
ninja -C .build install

However, I found another known bug.

ninja -C .build
ninja: Entering directory `.build'
[2/56] Compiling C object megatools.p/lib_http.c.o
FAILED: megatools.p/lib_http.c.o 
cc -Imegatools.p -I. -I.. -I../lib -I../tools -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/x86_64-linux-gnu -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -g -Wno-unused -Wno-pointer-sign -pthread -MD -MQ megatools.p/lib_http.c.o -MF megatools.p/lib_http.c.o.d -o megatools.p/lib_http.c.o -c ../lib/http.c
In file included from /usr/include/x86_64-linux-gnu/curl/curl.h:3091,
                 from ../lib/http.c:23:
../lib/http.c: In function ‘http_new’:
../lib/http.c:148:35: error: ‘CURLOPT_PROTOCOLS_STR’ undeclared (first use in this function); did you mean ‘CURLOPT_PROTOCOLS’?
  148 |         curl_easy_setopt(h->curl, CURLOPT_PROTOCOLS_STR, "http,https");

To resolve the error, curl >= 7.85.0 is required. So I compiled it from source and managed to get a working version. Finally, following this guide, I managed to get a .deb package with the latest megatools which you can find here.

At this point I opened a bug on ubuntu launchpad.

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