One blast took place near the former military academy for women, while the other struck close to the interior ministry.
Emergency crews rushed to the scenes of the blasts, which were cordoned off.
It is the first deadly bomb attack since the toppling of Muammar Gaddafi last year.
The bombs struck at dawn close to the interior ministry's administrative offices and near the military academy on Omar al-Mokhtar Avenue.
The city's head of security, Col Mahmoud Sherif, said the blast outside the military academy left two people dead and four or five injured.
No casualties were reported from the other explosion, he said.
Mr Sherif blamed Gaddafi supporters for the attacks, who he alleged were receiving financial backing from contacts based in neighbouring countries.
The attacks took place as crowds prepared for mass morning prayers to mark Eid al-Fitr, the Muslim celebration at the end of the fasting month Ramadan.
Earlier this month, Libya's interim National Transitional Council handed power to a newly elected assembly, in the first peaceful transition in the country's modern history.
But violence remains a challenge for the government, with several attacks taking place in the eastern city of Benghazi in recent months.
The BBC's Rana Jawad, in Tripoli, says that the government has often blamed these attacks on Gaddafi loyalists.
For many Libyans, she says, it is easier and more plausible to believe that loyalists of the former regime are behind them, but this is difficult to assess.
Security forces have also struggled to assert control over armed men who took part in last year's uprising and who refuse to lay down their weapons.
At least two people have been killed in a twin car bomb attack in the Libyan capital, Tripoli, security officials say.