General Motors Corp., the world's biggest automaker and the nation's second-biggest industrial company, today announced the appointment of Executive Vice President Roger B. Smith as chairman, effective Jan. 1.

Smith will replace Thomas A. Murphy, who will retire on Dec. 31, after heading General Motors for seven years.

Smith, who was considered by most the front-runner for the chairmanship, comes out of the traditional General Motors executive mold: He has been with the company since 1949 in a wide variety of positions, most of them on the financial side of the firm. He is currently executive vice president for the finance, operating staffs and public affairs groups and is vice chairman of the board's finance committee.

His financial credentials are similar to Murphy's, but he lacks some to the production experience that Murphy has.

However, F. James McDonald, executive vice president for North American car and truck, worldwide components and power products group, was named president and chief operating officer today. He will succeed Elliott M. Estes, who retires on Jan 31. McDonald brings the production experience -- he has headed both the Chevrolet and Pontiac divisions in his long GM career -- that the new chairman may lack, McDonald is 58.

Howard H. Kehrl, now executive vice president for the overseas group and the technical staff group, will fill the now-vacant post of vice chairman of the board.

Three of the four executive vice presidents of GM were tapped for the top slots in the company.

"You can count on one hand the number of times the company has not moved an executive vice president into moved an executive vice president into the top positions," according to one GM official.

General Motors, although one of the most powerful companies on the globe, like other domestic automakers faces unprecedented challenges in the 1980s as consumers almost overnight have switched their car-buying preference to small fuel-efficient models from the bigger cars that provided most of Detroit's profits for decades. The companies are finding it difficult to switch production quickly and are losing sales to foreign producers mainly the Japanese.

Domestic car makers saw shipments drop precipitously late last year and this year after gasoline lines clogged the nation's service stations in the spring of 1979 and sent the American consumer to smaller cars -- whether domestic or foreign.

That happened once before, in 1974 during the Arab oil embargo, but domestic consumers quickly shifted their preference back to bigger models when the crisis was over. This time the consumers stuck to the smaller cars, even after the lines evaporated.

GM car sales during the first six months of the year fell 18 percent, to 2.1 million vehicles from 2.6 million vehicles last year. General Motors posted a $412 million loss during the second quarter of 1980, the first time the company has lost money since the third and fourth quarters of 1970, when a 67-day strike hit the company.

Ford Motor Co., with fewer resources than GM, also has posted large losses, and Chrysler Corp. -- the smallest of the so-called Big Three -- is in business today only because the federal government has agreed to underwrite up to $1.5 billion of the company's borrowings.

General Motors was the first American manufacturer to market a product line of redesigned, fuel-efficient autos. The X cars debuted in the spring of 1979 and have been strong sellers.

As a result -- although all domestic car makers have suffered at the hands of foreign makers -- General Motors has suffered relatively less than either Ford or Chrysler, both of whom have their own new lines of fuel-efficient automobiles scheduled to be introduced next month.

"Murphy leaves a company with a hell of a lot of new products having a lot better position in the domestic market than the one he inherited," according to David Healey, an analyst at Drexel Burnham Lambert Inc., a major brokerage firm. "But he also leaves one losing money" that has to borrow more than it had to seven years ago, he said.

GM's $412 million loss during the second quarter compared with profits of $1.18 billion in the second quarter of 1979. Sales plummeted from $19 billion in 1979's second quarter to $13.8 billion this year.

Most analysts think that GM will show up with its first full-year loss since 1921. It earned a slim $155 million profit during the first three months of 1980.

Nevertheless, General Motors plans to spend $40 billion between now and the end of 1984 to improve its product line worldwide, modernize its plants and retool its operations to build new, more attractive models.

But because of its recent profit problems -- the company earned $2.9 billion in 1979 and $3.5 billion in 1978 -- the company will have to borrow more than it ever has before.