Nigeria, Black Africa's oil giant and its richest and most populous country, is about to take its first cautious step from military back to civilian rule.

After nine months of energetic and, at times, quarrelsome campaigning, candidates in the first of five scheduled elections will go before Nigeria's 48 million registered voters this Saturday.

Candidates and voters alike are haunted by the memory of a brutal civil war a decade ago in which an estimated 1 million Nigerians died - a war blamed largely on the country's previous civilian leadership.

In the elections, to be held at weekly intervals, Nigerians will choose nearly 2,000 federal and state officials, selecting their first civilian government since 1966. Afterward, on Oct. 1, the government of Lt. Gen. Olusegun Obasanjo is due to step aside, ending 13 years of military rule.

For many Nigerians, the change holds the promise of political participation, and presumably greater freedom, under a more democratic system. But it also is raising some doubts about whether a civilian government can hold Nigeria together, given the West African country's fractious past of tribal, ethnic, religious and regional animosites, which destroyed the first elected government.

Other African military governments with their own political problems in mind, have been closely watching developments in Nigeria's transition.

Equally watchful are Western governments, which share a concern about future production of Nigeria's low sulfur "sweet crude," currently running at 2.5 million barrels a day.The United States buys 40 percent of that production, making Nigeria the second-biggest source of U.S. oil imports after Saudi Arabia.

Nigeria has played an increasingly important role in African efforts to end white rule in Rhodesia and Namibia during the past two years. Its relations with the United States have improved significantly since President Carter took office. Carter visited Lagos in 1978, a distinct shift from the tenure of former secretary of state Henry Kissinger when relations were chilly because of differences over Angola.

Today, with the end of the civil war nine years behind it, Nigeria's "caretaker" government has sternly warned citizens that it will not tolerate a return to the "chaos" of the past.

The election campaign, as yet unmarred by the riots and political unrest of elections in the early 1960s, has nonetheless witnessed some rock throwing, charges of false voter registration and disturbances.

Two weeks ago, an unruly crowd was dispersed by policemen firing tear gas in the northern Nigerian town of Kano following the disqualification of socialist presidential candidate Aminu Kano, 58, for nonpayment of income taxes. Six policemen and 35 demonstrators were reportedly injured in the melee.

Gen. Obasanjo, 42, delivered a nationwide television speech warning all political candidates and their supporters to behave.

"Various groups and individuals are beginning to degenerate into undesirable political practices akin to those that bedeviled the past civilian regime," Obasanjo said.

"There is hardly any family in Nigeria today that has not suffered some irreparable loss as a result of political chaos which led to tragic results," he said.

"This administration will no longer tolerate those political activities of party leaders and followers which threaten the march forward of our society."

Four of the five parties contesting the elections hastily issued statements deploring acts of "molestation" carried out by their political opponents.

At stake in the five elections, ending with the presidential election Aug. 11, are the 19 state legislatures, the state governorships, the 95-member Senate, a 450-seat House of Representatives and the presidency.

The Nigerians have scrapped the parliamentary system they inherited from the British at independence in 1960 and borrowed heavily from the American model in writing a new constitution.

"They will be trying to operate a system of government with which they are not familiar," said U.S. Ambassador Donald Easum. "But they have made impressive efforts" in familiarizing themselves with how the American system works, he added.

American political scientists are holding seminars with civil servants and would-be politicians on the give-and-take of American politics. The Nigerians have requested more.

"We've had trouble keeping up with the demand," said a diplomatic source.

Part of the problem is that rural Nigerians, who make up about 70 percent of the population, are "not sophisticated voters," as a senior government official acknowledged.

"Whichever party wins the Senate vote on Saturday will probably win the remaining four elections," he said. "It will be a bandwagon effect."

Nigeria's first civilian government was overthrown by a military coup in January, 1966, six years after independence, following a total breakdown of law and order.

"Nigerians were indifferent to or indeed relieved at the demise of a [civilian] regime hopelessly encumbered by corruption, election-rigging, vote-buying, indifference to the plight of its citizens and thorough ineffectiveness," reads a passage in "Elections 1979," a book published by the Lagos newspaper, The Daily Times.

The coup, led by officers of the Ibo tribe, resulted in a second coup and massacres of Ibos. Then Ibos from throughout Nigeria streamed back to their native region in eastern Nigeria and attempted to secede naming their oil-rich area the State of Biafra and the civil war followed.

An unanswered question for Nigeria's industrialized oil customers is what this country's oil policy will be under a civilian government. All four of the presidential contenders have been vague on foreign policy, which has become intertwined with Nigeria's oil sales.

"It is true that the parties' positions are not very clear on foreign policy," Easum said, "but I do not detect any difference between them and the [outgoing] military government."

Foreign observers and Nigerians alike speculate that the new government will be too concerned with fulfilling promises of expanding employment, stepping up development and increasing social services to take an aggressive stance on whom they will or will not sell oil to. The military government has implied it might cut off oil sales to countries recognizing the Zimbabwe-Rhodesia government.

Although Nigeria's oil exports have been bringing in more than $9 billion annually for the past few years, Nigerians tend to react angrily when refered to as "oil rich." Only the educated urban elite has benefited substantially from Nigeria's oil wealth. The vast majority of Nigeria's 80 million to 100 million people still scratch a living from subsistence farming or live in crowded urban slums.

Lagos, the capital and main seaport, suffers from a severe housing shortage and inadequate sanitation facilities. In the teeming older parts of the city, carpenters do a brisk business selling child-sized coffins on the streets.

Statistics are difficult to come by. But Nigerians say that besides a high infant mortality rate, health services are inadequate and schools grossly overcrowded.

Other economic problems are a rising food import bill currently running at $1 billion a year, an inflation rate of 30 percent and heavy government commitments on ambitious development projects, many of which remain half-completed.