For older projects, I've found that this error may actually mean what it says - the Nuget package no longer exists on Nuget.
In some cases, the package reference you need may already exist in the solution - i.e. the package restore is not necessary to restore the reference needed.
In that case, open the packages.config file in the root of the project, and comment out the line(s) with the problematic packages.
If the NuGet package doesn't exist AND the corresponding reference doesn't exist in the checked-in solution, then you may have to go on a hunt outside of Nuget to find if the package still exists (i.e. Google).
If it no longer exists anywhere, replace with a suitable alternative.