How do I update Android on my device? This Community Wiki question is designed to be the "canonical question" for questions asking how to upgrade one's device to a new Android version.


I want to get a newer version of the OS for my Android device. How can I do that?

See also: Where can I find stock or custom ROMs for my Android device?
This is a Community Wiki post. If you see a way to improve it, please go right ahead and edit it.


There are multiple factors that go into the answer in your particular case.


Is there an official update from the carrier/manufacturer? Then use the official method.
Is there no official update, but has someone created a ROM that you could install on your rooted device? Then you need to look for how to update unofficially.
If you have a little programming knowledge, and you know about Linux device drivers, you could try to make a custom ROM for the device. Start with an existing ROM project such as Cyanogenmod and port it to your hardware. This will take a lot of effort, there's a risk of bricking your phone, and it might not even be possible for your device (because of lack of drivers). If you still think it's worth a try, ask the developers of the ROM you're starting with where to start. (Note that questions about writing custom ROMs are off-topic on this site.)
If there is neither an official update nor a custom ROM, and you don't have the knowledge or free time to port one yourself, then your only other option is to buy a new device.


Official

First, check to see that there is an official update for your device.


When will my device get the Android 8.0 update (Oreo)?
When will my device get the Android 7.0 update (Nougat)?
When will my device get the Android 6.0 update (Marshmallow)?
When will my device get the Android 5.1 update (Lollipop)?
When will my device get the Android 5.0 update (Lollipop)?
When will my device get the Android 4.4 update (KitKat)?
When will my device get the Android 4.3 update (Jelly Bean)?
When will my device get the Android 4.2 update (Jelly Bean)?
When will my device get the Android 4.1 update (Jelly Bean)?
When will my device get the Android 4.0 update (Ice Cream Sandwich)?
When will my tablet get the Android 3.x update (Honeycomb)?
When will my phone get the Android 2.3 update (Gingerbread)?
When will my phone get the Android 2.2 update (FroYo)?


For most devices, you simply go to Settings | About phone | System updates. If the update is ready for your particular device, it will tell you so. If you're lucky, you won't even need to go that far, as there will be a notification telling you that an update is ready.

Note that it takes time for carriers and manufacturers to add their customizations to the OS. Just because a new version has been announced doesn't mean it's immediately available for your device. Even when a particular OS update is announced for your device, it is almost always a phased rollout, meaning that it could be days or weeks from the official release for it to be available for you. (Very often the update file is made available for savvy users to update manually.)

Some device manufacturers/carriers have slightly, or grossly, different ways of distributing updates. Samsung, for instance, is notorious for requiring users to use their Kies software.


How do I upgrade firmware on my Samsung Galaxy S without using windows?
What can you do with Samsung Kies for Android phones?


Unofficial

If there is no official update for your device, you either need to wait for one (if one will be made) or install a custom ROM. There is a vibrant mod community that works very hard to make new OS updates available for old devices and devices where the manufacturer/carrier is very slow to do their customizations.

Rooting and flashing ROMs to your device is too large a topic to be covered in this post.  Please refer to these other questions for that:


How do I root my Android device?
Where can I find stock or custom ROMs for my Android device?