Eliminate iTunes Duplicates Safely
This problem happens when the iTunes library becomes corrupt. Recreate the iTunes library so that all tracks are properly saved by iTunes to its library xml file.
WARNING: Following this procedure deletes the playlist, ratings, and other metadata in your library. It is therefore important that you backup your library as instructed.
Steps:
Backup your music library. It's usually located in ~/Music/iTunes (The rest of the instructions will assume this where it's located)
Delete ~/Music/iTunes/iTunes Library
Delete ~/Music/iTunes/iTunes Music Library.xml
Delete ~/Music/iTunes/iTunes Library.xml if it exists as well
Launch iTunes while holding down the option key on the keyboard. iTunes will ask you to choose or create a library
Click on "Create Library..." and choose ~/Music/iTunes or whichever folder you want your iTunes library to be at
Import all of your songs back in by dragging in the folder "~/Music/iTunes/iTunes Music" into the iTunes window
This procedure is necessary when the iTunes library file and the library xml file are out of synch. Reimporting the tracks by following the above instructions will correct the problem.
WARNING: Following this procedure deletes the playlist, ratings, and other metadata in your library. It is therefore important that you backup your library as instructed.
Credit: Tangerine!