The unpredictable billionaire confirmed Ms Yaccarino would take on the role, although she will focus on business operations in a Twitter post on Friday.
“I look forward to working with Linda to transform this platform into X, the everything app,” Musk wrote.
He said he will remain as CEO and will focus on product design and new technologies.
Hours earlier, Ms. Yaccarino said in a statement She left her role as NBCUniversal’s president of global advertising and partnerships after more than a decade with the media conglomerate.
“It’s been an absolute honor to be a part of Comcast NBCUniversal and to lead the most incredible team,” she said.
On Thursday, Mr Musk teased the appointment when he revealed he had hired a woman to take over the social media platform’s top job from him in six weeks’ time.