Inmates staged a mass escape during armed clashes in two cities near Tripoli.