With a 3-1 home reversal in the first leg last weekend, the Northern Blues bowed out on a 5-1 aggregate.
Earlier on Saturday, Bechem United were kicked out of the Caf Confederation Cup by Algerian outfit MC Alger following a 5-3 defeat on aggregate.
The Ahly-All Stars match was played at the Stade Olympique D'el Menzeh in Tunisia due to security concerns in Libya.
Muaid Ellafi gave Ahly an early lead from a neat free-kick on one minute.
After half-time, Anis Mohamed Saltou added a second for Ahly in the 63rd minute to kill the game.
Ahly face Moroccan outfit FUS Rabat in the next round, the latter having recorded a 4-1 aggregate win over FC Johansen of Sierra Leone.
All Stars, who were on their debut season of continental football, qualified for the competition after winning the Ghana Premier League last season.