Yes -- it sounds like some sewage treatment plants, industrial-scale recycling programs, maybe underground farms in the cool Earth powered by solar PV using LED lights, agricultural robots, improved discussion systems to route around corruption over land use planning, and so on would make the Nile valley into a happy place again (assuming equitable distribution of the resulting prosperity -- a big assumption). And it would cost trillions as you say. But there are tens of trillions of dollars and more sloshing around in global markets looking for a good home, so money is not the issue. It is ultimately a choice by our collective global society to prefer to see all this needless suffering on the planet for ideological, political, moral, ignorant, or aesthetic reasons...

Related: https://en.wikipedia.org/wiki/The_Ones_Who_Walk_Away_from_Om...
""The Ones Who Walk Away from Omelas" is a 1973 plotless, short, descriptive work of philosophical fiction, though popularly classified as a short story, by American writer Ursula K. Le Guin. With deliberately both vague and vivid descriptions, the narrator depicts a summer festival in the utopian city of Omelas, whose prosperity depends on the perpetual misery of a single child."

Also, as with the French selling warships into this conflict, there is a lot of money to be made by privatizing gains and socializing costs and risks -- since as Major General Smedley Butler wrote in his book, "War is a Racket".

And beyond the history of exploitative colonialism, there is climate change from fossil fuel burning -- and maybe also top soil loss of carbon from bad farming practices in Europe and the US -- which has contributed to this crisis:
http://www.ibtimes.com/climate-change-africa-african-global-...
"While Africa’s lack of modern energy and minimum carbon footprint have made it the slightest contributor to the growing global warming crisis, the massive continent bears the brunt of the world’s rising temperatures with damaging effects such as massive droughts, flooding, unreliable crop yield and waning ecosystems. And yet, analysts have indicated that Africans represent just a small fraction of the global voices partaking in the crucial conversation about climate change."

As with the recent HN question on finding meaningful work: https://news.ycombinator.com/item?id=15480233 or this suggestion by Nobel Prize winner Muhammad Yunnus: https://qz.com/1101430/a-nobel-prize-winner-says-tech-compan... sadly most the best and the brightest in the Western world are focused on "me too" efforts on how to us AI to enslave people's eyeballs via social media technology -- meanwhile these genuinely meaningful and interesting challenges like building underground farms run by robots and powered by renewable energy (a seeming prerequisite for space habitats) are not pursued. Addressing those Nile challenges could instead be a lot of "hard fun" for a lot of people:
http://www.papert.org/articles/HardFun.html

One computer-related thing that could help is to connect an idea like Bucky Fuller's "Design Science" or E.F. Schumacher's thoughtful "Appropriate Technology" -- or my suggested potentially self-replicating "OSCOMAK" variation on all that: http://www.kurtz-fernhout.com/oscomak/ with funding like in the "Billions in Change" movie about the philanthropic work of Manoj Bhargava: https://billionsinchange.com/

And as that "Billions in Change" film shows, or the books "Design For The Other 90%" and "Design Like You Give A Damn: Architectural Responses To Humanitarian Crises", or elsewhere, change is happening, even if in a disorganized slow sort of way. But that change to bring prosperity and sustainability to everyone on the planet is mostly uniformed by what modern computing and social media could significantly help with -- like as with the approach outlined in the OSCOMAK propsoal from about twenty years ago (and which has even earlier roots than that).

I suggested another variation on that idea when Greece was running out of tear gas to use against its young people:
"Getting Greece and Iceland to be 99% self-sufficient by mass; international consortium"
https://groups.google.com/forum/#!topic/openmanufacturing/Yz...
"Now, does this make any sense if you understand the possibilities of open manufacturing or an open society? In Greece you have a warm climate, access to oceans, lots of sun and wind, an educated populace with a 2000+ year history of democracy (on and off :-), no obvious external enemies declaring war, and so on. And they are so worried about their future ability to make and use things (which is how I translate "fears for Greece's economic future") that they are running out of tear gas? This all makes no physical sense. The place should be a paradise. Instead it is in "self-destruct mode" according to one editor. It must be ideology. Or, more correctly, ideology embodied in a certain type of productive infrastructure."