# echo "package-foo hold" | dpkg --set-selections
For aptitude (but the hold only applies to aptitude - apt-get will still go ahead and upgrade)
# aptitude hold package-foo
To prevent a specific version being installed with aptitude (i.e. this won't stop 0.0.1-buggy2 being installed or from apt-get installing 0.0.1-buggy1)
# aptitude forbid-version package-foo=0.0.1-buggy1
Where "package-foo" is the name of the package you want to put on hold.