nexus 5 android 5.1 installing I am trying to upgrade my Nexus 6 with version 5.0.1 (Build number LRX22C) via OTA to Android 5.1.

The OTA update is downloaded successfully and after pressing "Restart &amp; Install" I see a dead droid with the message "Error!".

The phone was rooted and I unrooted it via SuperSU. Did not help. Wiping cache partition also did not change anything.
Since Android 5, OTA installs verify each partition as a whole so any changes will result in verification failing even if the file is not changed by the update. You said that you unrooted via SuperSU but it is likely that there is something that has changed in the system partition. Usually the error message will indicate the file that has caused it to fail.

Therefore, your options are to restore the system partition to the 'stock' state (removing any files you've added, reverting any changes to files and re-instating any deleted files) and flash the OTA or flash a factory image using the steps in this answer (using the 5.1 file names in place of the 4.3 ones in that answer)