There is no official upgrade available for Galaxy mega 5.8, but you can Upgrade Samsung Galaxy Mega 5.8 to Marshmallow by using Custom ROM,
If you want to install custom rom ( Android Lollipop or Marshmallow ) follow some basic steps.
Step 1. first you need to root your android device. for rooting you can try
- KingRoot (Without PC)
- KingoRoot ( PC Required )
- iRoot ( PC Required )
- Odin (only For Samsung) ( PC Required )
You can also watch root related videos
Download Root File For Odin
Step 2. Install Custom Recovery in your android mobile, for installing custom recovery you can try
You can also watch Custom Recovery related video
Step 3. Install Custom ROM And Gapps in your mobile using Custom Recovery
Download Custom ROM
You can also watch Installing Custom ROM related video
For More Step By Step details Watch Related Videos.