What is the mediascanner-service and how to avoid getting it installed?

Solution 1:

mediascanner2.0 is a package used in Unity 8 to discover media and then play it. For example, the Core Music App on Unity 8 uses mediascanner to scan the music directory(or any directory for that matter) and then play back music. Since Ubuntu is moving towards Unity 8, it is included by default in the Ubuntu iso.

mediascanner is scanning your whole hard drive to discover media, so the first time around, it will slow your computer. Eventually, it should cache its results, and then it will stop being so resource intensive.

You have two options to help fix your issues:

  1. (Prefered solution)You can explicitly tell mediascanner to not attempt to scan a directory by creating a new fie and titling it .nomedia. Then, when mediascanner reaches this directory, it will not even bother to index it. In theory, you can do this for as many directories on you computer, and mediascanner should stop indexing them.
  2. You can uninstall it, which in the short term(Until Unity 8 becomes default) will stop this from occurring, but you run the risk to running into dependency issues. Note: If you are doing Ubuntu SDK development, mediascanner is a dependency.

Hope this helped :)

Source