There is no Mega CMD package available for 64 bit Raspberry Pi OS as it has ARM64 architechture. We are going to build Mega CMD from source.
Builiding and installing Mega CMD
Two required packages libpcre++ and libpcre++-dev are not available in Raspberry Pi packages reposity, we will download them from external source and install:
wget http://ftp.us.debian.org/debian/pool/main/libp/libpcre++/libpcre++0v5_0.9.5-6.1+b11_arm64.deb -P /tmp/
wget http://ftp.us.debian.org/debian/pool/main/libp/libpcre++/libpcre++-dev_0.9.5-6.1+b11_arm64.deb -P /tmp/
sudo apt install -y /tmp/libpcre++0v5_0.9.5-6.1+b11_arm64.deb
sudo apt install -y /tmp/libpcre++-dev_0.9.5-6.1+b11_arm64.deb
Now, we need to install below packages on the Pi:
sudo apt install -y git build-essential libicu-dev 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 libsodium-dev libc-ares-dev libfreeimage-dev libavcodec-dev libavutil-dev libavformat-dev libswscale-dev libmediainfo-dev libzen-dev
Run ldconfig command to create temporary cache file:
sudo ldconfig
Clone Mega CMD git repo:
git clone https://github.com/meganz/MEGAcmd.git
Navigate to cloned directory and update submodules:
cd MEGAcmd
git submodule update --init --recursive
Build and install Mega CMD:
sh autogen.sh
./configure
make -j 4
sudo make install
If you don’t get any error, then you have successfully installed Mega CMD on your Raspberry Pi.
Running Mega CMD Server as a systemd Service
Create a systemd service file for Mega CMD Server.
sudo vim /etc/systemd/system/megacmd.service
I am using vim editor. You can use nano if vim is not installed on your Pi.
Create systemd file:
[Unit]
Description=MegaCMD Server
After=network-online.target
[Service]
Type=simple
Restart=always
ExecStart=/usr/local/bin/mega-cmd-server
[Install]
WantedBy=multi-user.target
Save the file, enable and activate the service:
sudo systemctl enable --now megacmd.service