Prime Minister Shahpour Bakhtiar's efforts to install a civilian government and restore order in Iran suffered a major setback today when the retired general he had named as minister of war was reliably reported to have turned down the job.

Diplomatic sources said Gen. Freydoun Jam had never actually accepted the post, although his name was included on the Cabinet list Bakhtiar presented to Shah Mohammad Reza Pahlavi on Saturday. Bakhtiar was reported tonight to be trying to persuade the general to change his mind, because he is considered vital to any chance of success Bakhtiar may have.

Jam's reported decision not to join the government upset Bakhtiar's entire program for installing a new Cabinet, and for the departure of the shah that was expected to follow. It added to speculation about the possibility of a coup by military hard-liners, since Jam was considered the only person who could keep the army under Bakhtiar's control.

The prime minister, asked about the possibility of a military move, said "If things don't get sorted out, everything is possible."

Bakhtiar's efforts also were undermined by a new round of riots and demonstrations against him and the shah.The most serious violence was in Tabriz, where mobs were reported by the state radio to have stormed down the main street burning movie theaters, shops, schools and libraries.

An apparently uncontrolled mob at the town of Qarchak eight miles south of Tehran hanged two Afghanis after condemning them in a "people's court," apparently reflecting the growing antiforeign sentiment among protesters, reports from the scene said.

Bakhtiar ordered martial law lifted in Shiraz, but that was virtually the only sign of the return to normal that he hoped formation of his government would bring.

Thousands of demonstrators shouting "Death to the shah" marched in Tehran, Qazvin, Mashad and other cities on another day of mourning called by the shah's religious opponents. Most of the strikes that have crippled the country also remained in effect.

The new minister of information, Cyrus Amouzegar, said tonight that he knew nothing about Jam's reported refusal. Diplomatic sources familar with the government maneuvering however, said without qualification that Jam had turned down the job after talking to Bakhtiar and the shah.

A meeting of parliament scheduled for Tuesday to consider Bakhtiar's program and give him the vote of confidence that would formally allow him to take over was postponed at least until Thursday. The official announcement gave no reason, but diplomatic sources said it was because the loss of Jam meant that Bakhtiar did not have a full government to present.

The continued demonstrations and the report that Jam had declined to join the government led several experienced observers here to believe that the entire "Bakhtiar solution" may be unraveling.

Bakhtiar's program was to form a government containing enough people acceptable to the militant religious and political opposition to put an end to the riots, win the tolerance if not the enthusiasm of the army and ease the shah out of the country temporarily while order is gradually restored.

Even with Jam in the Cabinet, the political and religious opposition has denounced Bakhtiar for agreeing to form a Cabinet while the shah is in power. He has failed to entice any members of the opposition National Front into the Cabinet.

Bakhtiar has offered a program that meets most opposition demands, but the opposition position now is that the monarchy itself is the issue.

Bakhtiar told British journalists today that the formation of a regency council to represent the shah during his projected temporary absence is "nearly complete." He said it would be a "symbol of the monarchy."

"The important thing is that we have a government and a prime minister who actually govern," he added.

Asked when the shah would depart for the vacation he has said he plans to take, Bakhtiar replied: "These things can't be settled quickly. It could be a week or 10 days." That was a potentially dangerous retreat. Anticipation of the shah's departure is widely considered the main thing restraining the opposition from even more violent displays of their antagonism to the monarchy.

It had been expected that parliament would give formal endorsement to the new government on Tuesday and that the shah would depart, ostensibly on vacation, shortly thereafter. Then Bakhtiar was hoping that Iranians would begin to go back to work, the steam would go out of the militant opposition and those who want to perpetuate the monarchy in some form would assert themselves.

Tuesday may provide an important test. For one thing, Bakhtiar is still attempting to get Jam to join the Cabinet and a formal decision will be announced if he succeeds. With no demonstrations scheduled, it should be a day on which Iranians begin going back to work if they are satisfied with what Bakhtiar is offering. But there was nothing in today's events to hold out much hope that the violence is coming to an end.

In addition to the Tabriz violence, which was confirmed by independent sources, journalists reported that about 40,000 people marched on Qazvin, west of Tehran, shouting opposition to the shah and Bakhtiar. The National Front said half a million persons took part in a peaceful protest march through Isfahan, the country's second city. Demonstrations also were reported in several other towns.

Here in Tehran, religious leaders led tens of thousands of persons in an anti-shah march in a cemetery on the outskirts of town and troops fired into the air to break up demonstrations in the city center. News agency reports said at least five persons were killed.

Random checks by journalists indicated that many demonstrators are working class and middle class people who say they have had enough of the repression and corruption they associate with the shah's rule.

Bakhtiar has pledged to stamp out corruption. In a shrewd move to show the government's sincerity, he allowed reporters and photographers from Tehran's newspapers into Jamshidiyeh Prison to see high-ranking former officials awaiting trial on corruption charges.This morning's papers gave prominent display to photographs of former prime minister Amir Abbas Hoveyda and other former officials in their cells.