NOVELTY - Preparation of palbociclib (I) includes dissolving 2,4-dichloro-5-cyano-pyrimidine in solvent, adding methyl-type Grignard reagent, reacting, and acid hydrolyzing to obtain 5-acetyl-2,4-dichloro-pyrimidine (II); reacting with carbonyl protecting reagent in the presence of acid catalyst to obtain dichloropyrimidine-containing derivatives (III) or (III-a); adding with cyclopentylamine solvent in the presence of base, performing amination reaction, and removing protecting group to obtain 5-acetyl-4-amino-2-chloro-pyrimidine (IV); and adding in solvent.    USE - Method for preparing palbociclib (claimed).    ADVANTAGE - The method is environment-friendly and has readily available raw material, low cost and high safety.    DETAILED DESCRIPTION - Preparation of palbociclib of formula (I) comprises dissolving 2,4-dichloro-5-cyano-pyrimidine in solvent, adding methyl-type Grignard reagent, reacting at 20-100 degrees C, and acid hydrolyzing to obtain 5-acetyl-2,4-dichloro-pyrimidine of formula (II); reacting with carbonyl protecting reagent in the presence of acid catalyst to obtain dichloropyrimidine-containing derivatives of formulae (III) or (III-a); adding with cyclopentylamine solvent in the presence of base, performing amination reaction at 10-150 degrees C, and removing protecting group to obtain 5-acetyl-4-amino-2-chloro-pyrimidine of formula (IV); adding in solvent and performing acetylation reaction with 0.95-1.5 times acetylation reagent at 5-100 degrees C to obtain 5-acetyl-4-acetylamino-acetamido-2-chloro-compound of formula (V); adding to solvent in the presence of catalyst, performing cyclization reaction at 20-120 degrees C, and performing intramolecular dehydration condensation to obtain 6-acetyl-8-cyclopentyl-5-methyl-2-chloro-8H-pyrido(2,3-d)pyrimidin-7-one of formula (VI); catalytically reacting with carbonyl protective reagent to obtain 2-chloro-8-cyclopentyl-5-methylpyrido(2,3-d)pyrimidin-7(8H)-one containing derivatives of formulae (VII-a) or (VII-b); adding with 2-amino-5-(4-N-tert-butoxycarbonyl-1-N-piperazinyl)pyridine in toluene or tetrahydrofuran solvent in the presence of catalyst and performing substitution reaction at 0-40 degrees C to obtain pyrimidine-containing derivatives of formulae (VIII-a) or (VIII-b) or adding compound (VI) with 2-amino-5-(4-N-tert-butoxycarbonyl-1-N-piperazinyl)pyridine in toluene or tetrahydrofuran solvent in the presence of catalyst and performing substitution reaction at 0-40 degrees C to obtain pyrimidine-containing derivative of formula (VIII-2); and adding compound (VIII) in solvent and reacting with aqueous acid at 10-100 degrees C. The carbonyl protecting agent in second step and compound (VII-a) is 1-6C diol, 1-6C monohydric alcohol, or 1-6C binary thiol. The acid catalyst is inorganic acid, 1-6C organic acid, methanesulfonic acid, p-toluenesulfonic acid, or amino acid. The molar ratio of compound (III) or (III-a) and cyclopentylamine solvent is 0.95-5:1. The acetylation reagent is diketene, methyl acetoacetate, ethyl acetoacetate, isopropyl acetate, or diketene bisacetonide. The catalyst in fifth step is pyridine, piperidine, quinoline, N-methylpyridine, N-methylpiperidine, 1,8-diazabicyclo(5.4.0)undec-7-ene (DBU), tetrabutylammonium fluoride, sodium hydroxide, potassium hydroxide, sodium carbonate, potassium carbonate, sodium methoxide, sodium ethoxide, potassium ethoxide, triethylamine, diisopropylethylamine, tributylamine, or N,N-diethyl aniline, preferably piperidine and pyridine mixture. The carbonyl protecting agent of compound (VII-b) is trimethylchlorosilane. The catalyst in seventh step is lithium amine derivative, alkali metal hydroxide, alkali metal carbonate, alkali metal hydride, 2-4C alkali metal alkoxide, DBU, aluminum isopropoxide, isopropylmagnesium chloride, or t-butyl chloride. The compounds (VIII-a), (VIII-b) and (VIII-2) are all compound (VIII). The aqueous acid is hydrochloric acid, sulfuric acid, formic acid, acetic acid, butyric acid, propionic acid, tartaric acid, maleic acid, succinic acid, trifluoroacetic acid, methanesulfonic acid, isethionic acid, or p-toluenesulfonic acid.    X=O or S; and    R1, R2=1-6C alkyl, may be same or different.    n=1-5; and    R1, R2=2-6C carbon-carbon bond cyclic substituent.    X=O or S; and    R3, R4=1-6C alkyl;or    R3+R4=3-6C carbon-carbon bond cyclic substituent with -CH2-.    X=O or S; and    R5, R6=1-6C alkyl;or    R5+R6=2-6C carbon bond cyclic substituent with -CH2-.