Some news websites in both countries had been targeted for censorship.
President Ahmed Mohammed Madobe garnered 56 votes out of the 74 cast by MPs.
Uganda says New Times is “a hostile platform that is likely to cause insecurity in the country.”
Joseph Gandye published news about alleged police abuse of suspects in custody.
New heads of Somalia intelligence agency, police and army are selected.