Transverse oscillations of coronal magnetic loops are routinely observed during the space missions. Since the first observation these oscillations were interpreted in terms of kink oscillations of magnetic tubes. Sometimes collective oscillations of two or more coronal loops are observed. This makes the development of theory of collective oscillations of a few parallel magnetic tubes desirable. Another reason for the development of this theory is that there are evidences that at least some coronal loops are not monolithic but consist of many thin magnetic threads. In this paper the linear theory of kink oscillations of two parallel magnetic tubes with the density varying along the tubes is developed. The asymptotic method is used to derive the system of equations governing the collective kink oscillations of two tubes. This system is used to study the effect of density variation on the eigenfrequencies of collective oscillations. The implication of the obtained results on coronal seismology is discussed.