For example Nigeria. Did it ever consider dividing itself into 3 separate countries (Igbo, Hausa, Yoruba)?
There were two factors working against any such "ethnic" division:
First, the idea of "tribes" as distinct and compartmentalized entities was largely a product of colonial models of organization, when in fact people often had layered identities or did not have distinct boundaries between them. The British tried to figure out ethnolinguistics after World War II, in part to determine how to govern Nigeria (which was itself a merged entity of two former colonies, Northern and Southern Nigeria), and found many areas where the predominance was not clear, or might even vary from urban to rural settings. In addition, those three affiliations were not the only ones in Nigeria--not by a long shot (Fulani-speakers, for example, were inextricably linked to Hausa and sometimes Yoruba and present all across the north)--and there were plenty of divisions within groups of people by territoriality or patronage. Using the colonial boundaries was really the most efficacious way of sidestepping the huge can of worms that an act of division would open, which is why the Organization of African Unity made honoring the colonial boundaries (except when all parties agreed to a change) one of their very first resolutions in 1963.
Second, the people in power usually wielded that power in a political context that included the whole former colony. If they had that authority, why would they carve it up? Quite often the independence-era leaders were US, UK, Soviet, or French-educated, so they took in the nation-state-based assumptions of those educations--even though many also had a broader pan-African set of values as well (again, based on some form of "Africanness" and not ethnicity writ small). The belief that such divisions might be overcome by an educated political class who transcended ethnic divisions and "tribalism" (not to mention party politics) was a feature of early regimes in many states, so they had no reason to believe they couldn't--and sometimes they could actually paper over all such divisions, at least for a while.
It happened in Ethiopia after rebels overthrew the communist Derg regime of Mengistu Hailemariam established a federal state divided into 'autonomous' ethnic region for all major ethnic groups. This happened mostly because of the irredentist and separatist aspirations of the Somali Ogaden region who wished to secede from Ethiopia and unite the Ogaden with their kinsmen in Somalia which they came dangerously close to with the 1977 Somali blitzkrieg into the Ogaden with the uprising of Somali irredentist fighters who were joined by the influx of official Somali military mechanized and infantry units pouring over the border from Somalia, as well as routine Somali air force bombardment resulting in about 80% of the Ogden region being captured (about 50% of present-day Ethiopia). It took a huge Soviet airlift and tens of thousands of Cuban troops, South Yemeni, East German troop and advisors, and Israeli pilots to make the Somali offensive into a defensive and forcibly make the Ogaden Somali rejoin Ethiopia.
The war was far too costly in manpower and resources, and with the successful overthrow of the Derg by the TPLF (Tigrey) rebels and their allies, they saw that in order to maintain Ethiopia's borders intact and quell any further disastrous and deadly separatist and ethnic nationalist conflicts like the Ogaden war, they would give all the major ethnic groups a degree of autonomy and power over their respective ethnic regions. As such, they created the Oromo region, the Somali region, the Amhara region, and the Tigray region, and other ethnic regions, making Ethiopia a federal state.
Nigeria had a civil war to separate. Long story short colonial Nigeria had a civil war regarding ethnicity, inequality, etc. The UK and US helped Nigeria kill millions of the Biafrans that wanted to succeed. At that point in time shell and the UK controlled Nigeria's oil. If they let Biafra go so would have some of the oil too. Nigeria won and till this day the "biafrans" still want to succeed...