You’re rewriting history.
The reason France and its crook leader invaded Libya was, according to public reports[1], because they had negotiated back-room deals with anti-Qaddafi rebels for oil. 35% of Libya's oil production in exchange for French support. Literally a war for oil.
Qaddafi's atrocities were real, but they were never the motivation of the French-lead bombing of Libya. That was a false rationalization made up to manufacture public consent. Manufacture consent for a failed intervention, that left Libya worse off than it had ever been.
> "was approved by the full UN Security Council"
Whose members actually knew about the corrupt oil deal[2], and chose to go along with the fraud, lying to their own people.
[0] https://en.wikipedia.org/wiki/Libyan_financing_in_the_2007_F... ("Libyan financing in the 2007 French presidential election")
[1] https://www.theguardian.com/world/2011/sep/01/libya-oil ("The new Tripoli government has denied the existence of a reported secret deal by which French companies would control more than a third of Libya's oil production in return for Paris's support for the revolution")
[2] https://www.vice.com/en/article/libyan-oil-gold-and-qaddafi-... ("Libyan Oil, Gold, and Qaddafi: The Strange Email Sidney Blumenthal Sent Hillary Clinton In 2011")
The "revolution" was done by the Tripoli (western) tribe, against the Cyrenaica (eastern) one - it was more a civil war starting than a popular uprising.
Gaddafi could have indeed crushed them, bring back order to the country, avoiding the current long lasting chaos, civil war, open slavery, migrant waves and so on.
It's hard to evaluate situations with a westerner mind, in countries that are structured around very different cultural norms, and with deep ethnic divisions. "Democracy" is not the silver bullet it those cases, and maybe we should acknowledge that.