The first African nations to achieve independence were Liberia on July 26, 1847; Egypt on February 28, 1922; Libya on December 24, 1951; Sudan on January 1, 1956; Morocco on March 2, 1956; Tunisia on March 20, 1956; Ghana on March 6, 1957; and Guinea on October 2, 1958. Many other nations in Africa subsequently followed suit in the 1960s and beyond.
The reason African countries seek independence is to be free from colonial rule and to have freedom to call their own shots. They seek independence to formulate their own laws and programs as befits their people as they see fit, based on their heritage, customs, and cultures. In essence, they believe that outsiders do not understand the history and nuances of their respective nations and therefore cannot rule over them properly.
For example, Italy marched into Libya in an invasion in 1911. It invaded Benghazi, Homs, Tripoli, and Tubruk and after World War I carried out vicious attacks against Libya. Libya desired to be independent and to be rid of the Italians and achieved this goal in 1951.
The primary factor that accounts for the drive for independence of African countries is that they do not want political control to be in the hand of the colonizers. They oppose discrimination against them from colonizers. They seek bountiful opportunity of their own making, not from anything imposed on them against their will and vision for their respective nations. The sought rights, not the rights from any constitution imposed on them, but their own constitution, which addressed the concerns of the majority African populace.