Lift the shingles surrounding the vent with a shingle ripper or hacksaw. Have replacement shingles on hand in case one tears as you remove it or is damaged in some other way.
Treat any sealant or roof cement on the existing flange with a commercial caulk remover to dissolve it. Lift the old sealant with a putty knife or paint scraper once it has softened. Cut the nails anchoring the vent flange using pliers or a pair of shears, then remove the flange for replacement.
Place the new flange over the vent pipe and secure it to the roof with galvanized screws or nails. Position them near the edges of the flange so that the shingles will cover them after installation.
Replace the shingles over the flange and nail or screw them into place. Cut the shingles with a pair of tin snips, if necessary, in order to fit them around the base of the vent pipe.
Cut off the tip on a tube of roof cement and puncture the seal with a stiff wire or nail. Load the tube into a caulking gun with the tip pointing way from the trigger. Apply a generous bead of roof cement around the seam where the flange meets the vent pipe.
Keep steady pressure on the trigger while you drag the tip of the tube along the entire seam. Quickly wipe away any excess roof cement using a dry rag. Messes can be cleaned rather easily as long as the sealant is still fresh.
Allow the sealant to cure for a full 24-hour period. Roof cement is resilient to weather conditions, and you do not need to tend to it as it dries.