Faris al-Khori, had chemicals, ball bearings, bolts, nuts and a bag of toxic beans which can be used to produce the poison Ricin.
The haul was found after firefighters were called to deal with a rubbish chute fire at a tower block in Edinburgh.
Last month al-Khori admitted a breach of the 1883 Explosives Substances Act.
He pleaded guilty to possessing the explosives at flats at Fidra Court and Persevere Court between 27 December 2007 and 27 April 2014.
"The number and nature of the explosive substances and the places you chose to store them lead me to conclude there is no alternative to a custodial sentence," said Judge Lady Wolffe.
"The sentence is one of five years but in light of your early plea I reduce it to 40 months. It will be backdated and I shall also impose a supervised release order for a period of 12 months," Wolffe said.
The discovery was made after the blaze in the block of flats was extinguished.
Fire crews forced entry to the flats to check no-one was inside, but when they entered a property where al-Khori was a tenant they found items that gave them cause for concern.
He was the full-time carer for his wife, who suffers from schizophrenia, and has had British citizenship since 1998.
Recently, Britain has denied admission to over 700 international students from taking courses in nuclear, biological and chemical warfare subjects amid fears they might use the knowledge to build weapons of mass destruction.
