An indebted university graduate was sentenced to four years and eight months of prison yesterday for attempting to rob his workplace with an air gun.