The present invention provides a pyrimidine derivative and a use thereof. The pyrimidine derivative is the compound shown in formula I or a pharmaceutically acceptable salt, hydrate, solvate, metabolite or prodrug thereof, wherein, R1, R2, R3, R4 and R5 are, for example, as defined in the specification. The compound can act as an ALK inhibitor, and is for preparing an anti-tumor medicament for suppressing an anaplastic lymphoma kinase.