Recent deadly clashes between two largest armed groups in the Libyan capital, Tripoli, underscore the dire security situation there and are undermining preparations for elections slated for later this year, the top UN envoy for the country said on Tuesday.