Install MegaCMD on DietPi OS for Orange Pi 5

Install MegaCMD on DietPi OS for Orange Pi 5


2 min read

This guide provides a step-by-step process for downloading, compiling and installing MegaCMD (the cloud storage solution) on DietPi OS for the Orange Pi 5. The same instructions would likely work for a Raspberry Pi, but this has not been tested.


OrangePi: 5 (aarch64)
DietPi: 9.4.2
MegaCMD: code 1070000
FFmpeg: 5.1.4-0+deb12u1


  1. Install package dependencies required for MegaCMD.
sudo apt install -y libcrypto++8 libpcrecpp0v5 libc-ares-dev zlib1g-dev libuv1 libssl-dev libsodium-dev readline-common sqlite3 curl autoconf libtool g++ libcrypto++-dev libz-dev libsqlite3-dev libssl-dev libcurl4-gnutls-dev libreadline-dev libpcre3-dev libsodium-dev libc-ares-dev libfreeimage-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libmediainfo-dev libzen-dev libicu-dev git
  1. install the necessary build tools.
sudo apt install -y automake make cmake build-essential libuv1-dev libssl-dev libhwloc-dev
  1. Clone the MegaCMD repository from GitHub to fetch all submodules.
git clone
cd MEGAcmd && git submodule update --init --recursive
  1. Run the MegaCMD configuration script.
  1. Build and Install MegaCMD.
sudo make install
sudo ldconfig
  1. Login to MegaCMD.
mega-login "password"
  1. Enable MegaCMD to restart automatically using CRON.

@reboot mega-sync

Updating MegaCMD

If you need to update MegaCMD, delete the $HOME/.megaCmd folder and re-run the steps above. You will have to login again, but your data will be preserved.


๐Ÿž Can't build with FFMpeg 6.0

You may encounter the following error related to FFmpeg:

FFMpeg removed AV_CODEC_CAP_TRUNCATED and CODEC_CAP_TRUNCATED definitions and now I can't build MegaSync with this error:

mega/src/gfx/freeimage.cpp: In member function 'bool mega::GfxProviderFreeImage::readbitmapFfmpeg(mega::FileSystemAccess*, const mega::LocalPath&, int)':
mega/src/gfx/freeimage.cpp:215:23: error: 'CODEC_CAP_TRUNCATED' was not declared in this scope; did you mean 'CAP_TRUNCATED'?
      |                       ^~~~~~~~~~~~~~~~~~~
mega/src/gfx/freeimage.cpp:334:33: note: in expansion of macro 'CAP_TRUNCATED'
  334 |     if (decoder->capabilities & CAP_TRUNCATED)
      |                                 ^~~~~~~~~~~~~
mega/src/gfx/freeimage.cpp:406:19: warning: 'void av_init_packet(AVPacket*)' is deprecated [-Wdeprecated-declarations]
  406 |     av_init_packet(&packet);
      |     ~~~~~~~~~~~~~~^~~~~~~~~
In file included from /usr/include/ffmpeg/libavformat/avformat.h:316:
/usr/include/ffmpeg/libavcodec/packet.h:512:6: note: declared here
  512 | void av_init_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
make[1]: *** [Makefile:13285: freeimage.o] Error 1


Update the code in ./sdk/src/gfx/freeimage.cpp to make it compatible with FFmpeg >= 5. You can find the necessary changes in the following pull request: Fix build with FFMPEG 5 #2614.

For more information, see this GitHub issue: Can't build with FFMpeg 6.0 #2635.