Pry the rubber boot up and away from the flashing using a flat head screwdriver’s blade. Pull on the boot to slide it up and off the vent pipe.
Remove any shingles sitting over the vent pipe’s flashing, using a pry bar to remove the nails holding the shingles in place. Pry up any nails in the perimeter of the flashing using the pry bar. Slide the flashing up and off the vent pipe the same way you did the rubber boot.
Slide the new flashing into place over the vent pipe. Drive rubber-washer screws through the mounting holes on the perimeter of the flashing and into the roof.
Slide the old rubber boot, or a replacement if the old one was cracking, over the vent pipe until it sits snugly over the flashing. Replace the shingles you removed and drive new roofing nails through the mounting holes in the shingles.