The nonlinear excitation of a dust ion acoustic (DIA) wave packet in a viscous dusty plasma consisting of Boltzmann distributed electrons, trapped ions, and variable charged dust is investigated. The dependence of the damping rate of the waves on the plasma parameters is discussed via the linear stability analysis. The standard reductive perturbation method is employed to derive the modified Korteweg-de Vries-Burgers equation due to an interplay among the nonlinearity, dispersion, and dissipation effects, and, the non-dissipative case gives the modified Korteweg-de Vries equation. Bifurcation analysis is discussed for the non-dissipative and dissipative systems assuming a Boltzmann distribution for electrons and a vortex-like distribution for ions. The effects of plasma parameters, among which the dusty plasma viscosity ν, trapping ion parameter β, and dust charge variation γ1 on solitary waves (SWs) and shock wave solutions, are discussed. It is observed that parameters ν and β significantly influence the characteristics of nonlinear dust ion acoustic solitary structures. It is seen that without viscosity (ν = 0), the system has the DIA solitary wave solutions, whereas, the viscous system supports DIA shock waves. By increasing the kinematic viscosity, the opportunity for formation of higher energy shock solitary waves increases and the solitary waves become monotonic shock waves.