This guide will teach you the proper way to add the mega.nz apt repository (or repo) to your sources.list of your Debian Based (Ubuntu and Raspberry Pi OS are based off of Debian) Linux Distribution so you can easily install and upgrade the “Megacmd” and “Megasync” apps on your Raspberry Pi. This tutorial is compatible with Rasperry Pi OS and Ubuntu for the Raspberry Pi, but can easily be modified for any Debian based Distribution on any hardware. Lets begin!

STEP 1: Find the repository that corresponds to your distro

Go to the Mega.nz repository at https://mega.nz/linux/repo/ in your web browser, and select the folder that pertains to your working distribution. For the Raspberry Pi OS or Ubuntu on the Raspberry Pi, you will need to use an ARM repository. That is going to be the Raspbian_10.0 or Raspbian_11.0 folder depending on which version of Raspberry Pi OS you are using.

Syntax: Go to https://mega.nz.linux/repo/YOUR_DISTRO_OF_CHOICE_HERE/

Example 1: Raspberry Pi OS 10 repository for mega apps is located at:

https://mega.nz/linux/repo/Raspbian_10.0/


Example 2: Raspberry Pi OS 11 repository for mega apps is located at:

https://mega.nz/linux/repo/Raspbian_11/


Example 3: Ubuntu 20.04 (Raspberry Pi) repository for mega apps is located at:

https://mega.nz/linux/repo/Raspbian_11/


Example 4: Ubuntu 22.04 (Raspberry Pi) repository for mega apps is located at:

https://mega.nz/linux/repo/Raspbian_11/

STEP 2: Download the gpg release key file from the Debian Repository and dearmor it, then put it in your /etc/apt/keyrings folder. Copy and Paste the corresponding example in your terminal.

Syntax:

curl -fsSL https://mega.nz/linux/repo/YOUR_DISTRO_OF_CHOICE_HERE/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/mega.nz.gpg

Example 1: Raspberry Pi OS 10

curl -fsSL https://mega.nz/linux/repo/Raspbian_10.0/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/mega.nz.gpg

Example 2: Raspberry Pi OS 11

curl -fsSL https://mega.nz/linux/repo/Raspbian_11/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/mega.nz.gpg

Example 3: Ubuntu 20.04 (Raspberry Pi) & Ubuntu 22.04 (Raspberry Pi)

curl -fsSL https://mega.nz/linux/repo/Raspbian_11/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/mega.nz.gpg
ls -la /etc/apt/keyrings/
drwxr-xr-x 2 root root 4096 Feb 10 02:45 .
drwxr-xr-x 8 root root 4096 Jan  5 02:15 ..
-rw-r--r-- 1 root root 2264 Feb 10 02:45 mega.nz.gpg

STEP 3a: Figure out your systems architecture.

Before adding mega.nz to your repository list, you first need to verfiy that you are using the 32-bit Ubuntu or Raspberry Pi OS distribution. If you are not, then you need to add the 32 bit architecture to your OS because MEGA doesn’t make apps with 64 bit ARM architecture.

Verify your architecture with the following command:

dpkg --print-architecture

If the above command returns “arm64“, then proceed to the next step (STEP 3b). If the above command returns “armhf“, then you should skip the next step (STEP 3b) and go to STEP 4.

STEP 3b: Add support for a 32-bit arm foreign architecture (armhf) with the following command:

sudo dpkg --add-architecture armhf

Verify you are now using armhf as a foreign architecture, with the following command:

dpkg --print-foreign-architectures

You should see “armhf” returned from this command. Now you may move on to STEP 4.

STEP 4: Add the corresponding repository URI and GPG Key to the mega.nz.list file. Copy and paste one of the corresponding commands in your terminal.

Syntax:

echo "deb [arch=amd64,arm64 signed-by=/etc/apt/keyrings/mega.nz.gpg] https://mega.nz/linux/repo/YOUR_DISTRO_OF_CHOICE_HERE/ ./" | sudo tee /etc/apt/sources.list.d/mega.nz.list > /dev/null

Example 1: Raspberry Pi OS 10

echo "deb [arch=armhf signed-by=/etc/apt/keyrings/mega.nz.gpg] https://mega.nz/linux/repo/Raspbian_10.0/ ./" | sudo tee /etc/apt/sources.list.d/mega.nz.list > /dev/null

Example 2: Raspberry Pi OS 11

echo "deb [arch=armhf signed-by=/etc/apt/keyrings/mega.nz.gpg] https://mega.nz/linux/repo/Raspbian_11/ ./" | sudo tee /etc/apt/sources.list.d/mega.nz.list > /dev/null

Example 3: Ubuntu 20.04 (Raspberry Pi) & Ubuntu 22.04 (Raspberry Pi)

echo "deb [arch=armhf signed-by=/etc/apt/keyrings/mega.nz.gpg] https://mega.nz/linux/repo/Raspbian_11/ ./" | sudo tee /etc/apt/sources.list.d/mega.nz.list > /dev/null

STEP 5: Now, update your apt list and upgrade repositories

sudo apt update && sudo apt upgrade

STEP 6: Install your desired MEGA Applications

Example 1: Install MEGAsync

sudo apt install megasync


Example 2: Install MEGAcmd

sudo apt install megacmd


Example 3: Install Nautilus Support for MEGAsync

sudo apt install nautilus-megasync

Example 4: Install Nemo Support for MEGAsync

sudo apt install nemo-megasync

Example 5: Install Dolphin Support for MEGAsync

sudo apt install dolphin-megasync

Example 6: Install Thunar Support for MEGAsync

sudo apt install thunar-megasync

Now, whenever you run the command sudo apt update && sudo apt upgrade your “megacmd” and other MEGA app installations will automatically update, when updates are available.

STEP 6: Run your newly installed mega command line application run the following command:

mega-cmd

FINISHED & DONATE: You have now properly installed MEGA Apps on your Debian Distribution. Please Donate below if this helped you!




[crypto-donation-box type=”tabular” show-coin=”all”]