Wholesale prices, boosted by a 0.4 percent increase in December, rose 4 percent for all of 1988, the fastest pace since the nation began emerging from double-digit inflation near the beginning of the decade, the government said Friday.

The gain in the Labor Department's Producer Price Index for finished goods, one stop short of the retail level, was nearly double last year's 2.2 percent increase. It was the biggest gain since 1981, when costs jumped 7.1 percent.The index was propelled upward by a drought-induced 5.7 percent increase in food prices. They had showed no change in 1987.

Meanwhile, energy prices, which had soared 11.2 percent in 1987, fell 3.4 percent in 1988. But with the agreement reached by the OPEC nations in November, analysts expect oil prices to head higher this year.

All other finished goods in 1988 rose 4.3 percent.

In December, food prices fell a slight seasonally adjusted 0.1 percent, energy costs edged up only 0.2 percent, but everything else jumped 0.6 percent, the biggest increase since September.

That was the third consecutive month of good news for grocery shoppers. Prices were unchanged in November after a 0.1 percent decline in October. However, that period of stability was preceded by seven consecutive months of increases.

With the end of unseasonably moderate temperatures in many parts of the country in December, fuel oil soared 8.5 percent and natural gas rose 3.3 percent. Gasoline prices fell 3.5 percent, holding back overall energy gains.

The fall in wholesale food costs was led by a 17.1 percent drop in turkey prices.