Barre 48, told parliament he would form a "quality" government that would focus on "creating inclusive political stability (in line with) the president's motto of a reconciled Somalia that is at peace with the world".
All 220 lawmakers present gave their blessing to Barre's appointment, and he was then sworn in to office, the parliament speaker said.
The MP from the semi-autonomous state of Jubaland was chosen earlier this month by President Hassan Sheikh Mohamud, who was elected by parliament in May after a long-delayed and stormy voting process.
"Our government has an ambitious policy program which seeks to improve our security, strengthen our economy and deliver basic services for our people," Mohamud said on Twitter after Barre was approved.
"Let us move forward together."
Somalia's new administration faces a raft of challenges including a looming famine and a grinding insurgency by Al-Shabaab jihadists.
There are hopes that Mohamud's presidency will draw the line under a seething political crisis that blighted the rule of his predecessor Mohamed Abdullahi Mohamed and threatened to plunge the country back into violent chaos.
Mohamud himself did not appear at the parliamentary session after he said on Friday that he had tested positive for Covid-19.