Preheat the oven to 400°F.
Remove the first layer of papery skin from the garlic. Slice off 14 inch from the pointy top. Place each head on a sheet of aluminum foil, cut side up. Drizzle with the oil and season with salt. Wrap each head in the foil and roast until the cloves are golden brown and soft, about 1 hour. Remove from the heat and let cool. (You can also do this on the grill, cooking over indirect heat.)
Remove the roasted cloves from their skins. The most efficient way to do this is to squeeze the whole head from the bottom. Using a fork, vigorously mix the garlic and oil together. Add a pinch of salt. (If your recipe calls just for a clove or two of roasted garlic, you can remove it from the skin using a small escargot-style fork.)
This will keep, tightly covered, in the refrigerator for up to 2 days.