Libya is struggling with anarchy as two governments compete for legitimacy three years after Muammar Gaddafi was ousted.
The elected House of Representatives and senior officials moved to the eastern city of Tobruk after an armed group from the western city of Misrata seized the capital and set up a rival assembly and cabinet.
Last week the House of Representatives, which is recognized by the international community, agreed on a second cabinet list after rejecting an initial 16-member lineup as too large.
The new cabinet has 13 ministers including three deputies for Thani and no oil minister. The vital oil sector will be run by state firm National Oil Corp (NOC), as under Gaddafi.
Thani, a former career soldier, has been prime minister since March but had resigned after a June election. Lawmakers then asked him to again form a new government.
Western powers fear Libya is heading towards civil war. The government cannot control former rebels who helped oust Gaddafi but now fight for power and a share of oil revenues.