We theoretically study the induced odd-frequency pairing states in ballistic normal-metal/superconductor (N/S) junctions where a superconductor has even-frequency symmetry in the bulk and a normal-metal layer has an arbitrary length. Using the quasiclassical Green's function formalism, we demonstrate that, quite generally, the pair amplitude in the junction has an admixture of an odd-frequency component due to the breakdown of translational invariance near the N/S interface where the pair potential acquires spatial dependence. If a superconductor has an even-parity pair potential (spin-singlet $s$-wave or spin-singlet ${d}_{xy}$-wave state), the odd-frequency pairing component with odd parity is induced near the N/S interface, while in the case of an odd-parity pair potential (spin-triplet ${p}_{x}$ wave) the odd-frequency component with even parity is generated. We show that in conventional $s$-wave junctions, the amplitude of the odd-frequency pairing state is strongest in the case of a full-transparency N/S interface and is enhanced at energies corresponding to the peaks in the local density of states (LDOS). In ${p}_{x}$- and ${d}_{xy}$-wave junctions, the amplitude of the odd-frequency component on the S side of the N/S interface is enhanced at zero energy where the midgap Andreev resonant state (MARS) appears due to the sign change of the pair potential. The odd-frequency component extends into the N region and exceeds the even-frequency component at energies corresponding to the LDOS peak positions, including the MARS. At the edge of the N region the odd-frequency component is nonzero while the even-frequency one vanishes. We show that the concept of the odd-frequency pairing state plays a pivotal role to interpret a number of phenomena in nonuniform superconducting systems, like McMillan-Rowell and midgap Andreev resonance states.