This guide will walk you through installing the newest software on your rooted Nexus 5X without losing any of your data. This page is filled with great guides for the Nexus 5X including rooting, flashing roms and returning to stock. I have taken most of the commands from that guide.
Setting up
Install the Platform SDK. You will only need the Android SDK Platform-tools to complete this guide so I recommend scrolling to the bottom of that page and locating Get just the command line tools.
Download latest factory image from here. Extract the files from the tar.gz and also the files from the zip file.
Download the latest TWRP recovery from here.
Download the latest SuperSu installer from here. It is a good idea to place this zip on your phone before beginning any of the steps below.
Updating the software
Open a command prompt and navigate to the platform-tools directory in the location you installed the Platform SDK.
Replace xx-xx in the examples below with the actual filenames.
fastboot flash bootloader C:\bullhead\images\bootloader-bullhead-bullhead-xx.xx.img
fastboot reboot-bootloader
fastboot flash radio C:\bullhead\images\radio-bullhead-bullhead-xx.xx.img
fastboot reboot-bootloader
fastboot flash boot C:\bullhead\images\boot.img
fastboot erase cache
fastboot flash cache C:\bullhead\images\cache.img
fastboot flash system C:\bullhead\images\system.img
fastboot flash vendor C:\bullhead\images\vendor.img
Install recovery
fastboot flash recovery twrp-3.0.2-0-bullhead.img
Launch recovery
Navigate to Start Recovery using the volume buttons and press the power button.
Reroot
If you didn't move the SuperSu zip file to your phone before you began these steps you can use adb to get the file on your phone.
adb push UPDATE-SuperSU-v2.01.zip /sdcard/
While in the TWRP click install zip and navigate to the location you placed the zip. Press install.
Start your updated system
Press restart and wait for all of your apps to optimized. Congratulations you have now updated your phone to the latest software.