when the four gubernatorial candidates were queried at a debate about the cars they drove, Republican Charlie Baker drew some envious chuckles when he said he had a ’66 Mustang.

But more than a few people nodded their heads knowingly because they, too, are driving old cars, many out of necessity. According to the Registry of Motor Vehicles, the average statewide age of all the cars, SUVs, trucks, trailers, and motorcycles in Massachusetts was 10.4 years as of Sept. 4, up from 7.5 years in 2000.

The aging of vehicles has had a widespread effect, from a decline in municipal excise tax collections to a dearth of used cars available for sale, thus driving up the price of pre-owned vehicles.

Barnstable Tax Collector Maureen Niemi said the graying of the fleet has had a big impact in her community. The average age of vehicles in Barnstable is 11.2 years, up from 8.1 years a decade earlier. Niemi and other tax collectors say most people are not buying new cars and many are doing away with cars they use infrequently. She mailed out 44,275 excise tax bills worth $4.4 million in 2008; in 2009, she sent out 39,228 bills worth $3.8 million, a 16 percent reduction. “Because of the economy, nobody’s going out and buying a new car,” she says.

Drivers in Aquinnah on Martha’s Vineyard have the oldest vehicles, with the average age of 15.7 years. Registry spokeswoman Ann Dufresne says that’s a trend officials have seen for years because island residents bring their “junks” and leave them. Also, the limited miles that year-round residents put on their cars makes them last longer.

The community with the newest vehicles in the state is Chelsea, but Robert Boulrice, the city’s treasurer/collector, says most of the credit goes to Enterprise, the car rental company that moved its fleet from Logan International Airport to Chelsea in 2009. Enterprise brought thousands of relatively new cars, which are now registered in Chelsea, pushing the average age of the car fleet down from 11.9 years in 2008 to 7.1 years now.