We generalize density-functional perturbation theory for lattice dynamics to Vanderbilt's ultrasoft pseudopotential scheme. This formulation accounts for the nonorthogonality of the orbitals, the augmentation of the electron density, and the dependence of the generalized orthogonality constraint on the atomic positions. Both insulating and metallic systems are considered. Application of the theory to the vibrations of small molecules (CO, CO2, CH4, and H2O) and to the phonon dispersion of the noble metals (Cu, Ag, Au) shows overall agreement with experiment. [SO163-1829(97)51742-5].