How to upgrade from OS X El Capitan 10.11.6 to macOS Sierra 10.12.6 I have OS X El Capitan Version 10.11.6 installed and want to upgrade to macOS Sierra 10.12.6

I have downloaded macOS Sierra version 10.13

I have .dmg file of macOS Sierra 10.12.6 but when I am going install it gives me the following error:



I found a lot of .dmg of version 10.12 but I didn't get anywhere then I got version 10.12.1.

Now I am confused that do I compulsory need to fine 10.12 and install it and than after update 10.12.4 and than after 10.12.6?
You have downloaded some updater files for macOS Sierra which require at least an already installed macOS Sierra 10.12.

They are useless if OS X 10.11 El Capitan is installed.

Go to the App Store, download the macOS Sierra installer and install it. If it isn't available the following trick may help:


  Mission accomplished: after installing this command-line tool ('https://github.com/mas-cli/mas'), the command
  mas install 1127487414
  purchased*, downloaded, and installed version 10.12.6 of correctly.
  
  * By which I mean, the program not only downloaded Sierra, it did so using the Apple-supplied App Store frameworks in /System/Library/PrivateFrameworks, resulting in an application bundle containing a properly-signed MAS receipt linked to my Apple ID.


or try bmike's answer.