Flashing LineageOS on a Pixel (A/B slots, recovery, sideload)
androidlineageosfastbootadbpixelromflashing
Notes from flashing LineageOS 22.2 (Android 15) onto a Google Pixel 2 XL (codename taimen) that had LineageOS 18.1 and an unlocked bootloader. Most of it applies to any A/B-partitioned Pixel.
Before you start
- Back up everything and verify the backup (
gzip -t, file counts) before wiping. A full/sdcardpull plus a data tarball was 35 GB here. - Download the build, boot, dtbo and vbmeta images and check sha256 sums. LineageOS has a builds API:
download.lineageos.org/api/v2/devices/<codename>/builds. - Old ROMs may be too old for your apps: guardian needed minSdk 31, so Android 11 was out, and an old ROM also means an old WebView engine.
Steps that worked
fastboot flash boot boot.img --slot=all, same fordtboandvbmeta.- Boot recovery, factory reset / format data.
adb sideload lineage-*.zip.- Answer No to "install additional packages?" when you want no Google apps.
- Setup with zero accounts if the device will get a device-owner app.
Gotchas
- A/B slots:
fastboot flash boot boot.imgwithout--slot=allwrote slot_awhile_bwas active, so "Start" booted the old OS. Always flash both slots on these devices. fastboot reboot recoveryreports OKAY but the taimen bootloader ignores it; choose "Recovery mode" with the volume keys and power.- The
adb sideloadpercentage parks around 47% while the device verifies and installs; that is normal. Wait for "Total xfer: 1.00x". - Official LineageOS builds are userdebug:
adb rootworks when "rooted debugging" is enabled in developer options (no Magisk). Turn it off afterward. - An unlocked bootloader cannot practically be relocked on LineageOS.
- Ping is a bad connectivity test if the target blocks ICMP (Justin's server does). Check
adb shell dumpsys connectivityforVALIDATEDinstead.