Warren Buffett wants to sell you a car.

The billionaire investor on Thursday agreed to buy America’s fifth-largest auto retailer and use it to launch a consolidation of the highly fragmented business.

His Berkshire Hathaway Inc. would acquire an about $8 billion retail business with operations from Florida to California, and use it to snap...