Through the study of relationship between generatrix linearity and axes linearity of deep bore, we proposed the new principle and method to measure axes linearity of gunbarrel by measure of generatrix linearity. The conclusion of how to determine error between generatrix linearity and axes linearity and how to compensate the error are valuable in measurement of axes linearity of deep bore.