The carrier version of the good old HTC One M7 will never see Android 5.1. However, if you have the Google Play Edition or followed my instructions, how to convert a carrier version into a play edition HTC One, you are in luck. Here is how you can upgrade your phone to Android 5.1. in less than half an hour.
I’m assuming that your HTC One M7 is currently running Android 5.0.1 and on the default standard recovery. If that’s not the case, take a look at an earlier post, which should give you all the information needed to create these pre-conditions.
Download OTA Update
Download the over-the-air update (OTA_M7_UL_L51_STOCK_UI_MR_Google_WWE_6.04.1700.6-5.11.1700.3_LMY47O.H6_release_430567)
Now, connect the phone to your Mac, open the terminal app, and enter:
adb reboot bootloader fastboot oem writecid GOOGL001 fastboot erase cache fastboot reboot
Boot into Recovery
adb reboot recovery
Once you see the image of the Android on its back with a red exclamation point, press and hold the Power button and press the Volume Up button, to get to the recovery menu. From there select apply update from ADB using the Volume Down button, then select it with Power.
On your Mac, still in terminal, enter:
adb sideload ~/Downloads/m7_501_51.zip
Coping and installing the update 295MB compressed will take a little while, but once done, you will be asked to reboot the phone:
Almost done! On reboot, Android will update all application packages, but eventually reveal your familiar home-screen.