The 28-year-old man was previously convicted with attempted rape and served six months at Bomana.
Samson Dasi was arrested on Jan 11 and charged with being in possession of an offensive weapon, a charge under Section 12(1) of the Summary Offense Act.
He appeared before Magistrate Maristella Painap on Friday where he pleaded guilty to making the homemade gun himself. The gun was found on him at the market after police searched him.
He asked the court to be lenient in its sentence today, saying he has an ageing mother and a young family of three children who rely on him.
But Police Prosecution submitted to court that this was not the first time Dasi has been arrested and charged for an offense, and having served time already at Bomana for a previous conviction, he should have known better.
Magistrate Painap in sentencing Dasi to two years in jail with hard labour said the penalty is to show that making homemade guns is a serious offense and hopes that his time in jail will help him think about his family.