At the shop today, I was handed a classic mid-80s Trek road bike that needed an overhaul.
It was a very nice old bike, with all original components. But it had seen better days.
The original wheels with their Matrix rims would have to be cut up and rebuilt, a project for another time; we swapped in another set of used wheels that would work just fine.
Then, I looked at the headset. The cups were both loose enough that I could remove them with my fingers. Not good.
I pulled everything apart, cleaned all the pieces and determined that, if properly re-installed with fresh grease it would be just fine.
So I went to work on fixing the loose cups.
1. Remove the cups from the head tube and clean out everything inside the head tube. Examine the inside of the head tube carefully to make sure nothing is cracked, sticking out or otherwise impeding the turning of the fork's steer tube.
Note how smooth the top of the inside looks. There's really nothing there for the cup to gain any purchase on. When the bike was new, this wasn't a problem, as the parts had close tolerances and fit together tightly; but many miles of riding have loosened things a bit, and sometimes the cups will get wobbly.
Ignoring this situation until it's really annoying will cause damage to the frame and fork. Don't wait!
You COULD fix this with a strong two-part epoxy, and I'll admit that I've done it that way once or twice in my early days of wrenching. But epoxy has two strikes against it: it's messy and hard to clean up, both during and after application; and it has nasty chemicals in it that are not good for you or the for the earth. So skip the epoxy and just use tools.
2. Take a chisel and a hammer. Working your way around the inside of the head tube of the frame, carefully aim the corner of the chisel's edge into the metal of the inside wall, and tap with the hammer. Be careful not to hammer too hard or you can risk damaging the headtube's edge. Take your time; a couple of lighter taps each time should do it. What you want to do is deliberately gouge out tiny metal "teeth" into the head tube, thereby making the inside diameter of the head tube a tiny bit smaller so the tolerance between it and the headset cup will be tight again. You don't need to go crazy with this; every 1/4" or so of tiny gouges all the way around should be sufficient.
When you're finished, you should be able to re-install the headset cup. Shop mechanics will be able to do this with a headset press (if both cups are loose, do the same thing on the other end of the head tube, and then install both cups together with the headset press.)
If you're at home, but you can still put your frame in a bike stand, there's another way to do this: Get a section of 2 x 4 (at least a foot long). Wrap it in a shop towel, position the cup on top of the head tube and position the wrapped 2 x 4 on top of the cup, making sure all edges of the cup are in contact with the wood. Take a hammer and carefully pound on the wood until the cup settles into the frame. Check your work periodically to make sure the cup isn't being ovalized, or going in so crookedly you'll need to punch it out and start again.
If all goes well, you should be able to install the cup with no "daylight" showing between the cup and the frame. (On older frames, the edge will already have been faced at the factory. I hope. If not, you have to decide whether it's worth it to pay a shop to do this -- most home mechanics don't have cutting tools. The ugly truth -- I am usually content to live with less than a millimeter of "daylight" if the cup is fully seated all the way around. Most casual home mechanics don't keep cutting tools at home, as they're very expensive and almost never needed for most simpler repairs.)
If you've done everything right, it should look something like this. You'll note that I installed one cup at a time, because the nonprofit where I'm working this summer doesn't have a headset press.
I made do with a 2 x 4 and a hammer, and it worked fine. Obviously, if the parts are very lightweight/higher quality, they will not stand up to this rough-and-ready sort of mechanistry, and you'll have to use a proper headset press, or pay a shop mechanic to do it for you.)
I repeated this process for the bottom cup. Then I added clean bearings and fresh grease, installed the fork and voila! Good as new.
(NOTE: Gouging out the inside of the head tube will only work on steel frames with external headset cups. I suppose it could work on select older aluminum frames, but I've never tried it and wouldn't advise it. And of course, never on carbon!)