I would definitely look into adopting from a shelter. If you're UK-based then I'm sure some forumers here can hook you up with a good rescue.
Usually shelter pigs are passed their first year, which is when a lot of issues can occur. There's also a smaller chance you'll end up with a female instead of the desired male, plus a lot of shelters are more than happy to let you hold their guinea pigs and even let you date your boar with another one.
Also here shelter piggies are cheaper and you know you're helping out when you adopt instead of shop. I wish you luck in finding yourself a companion for your boar. It's good he's not letting any grief stop him from eating, which can very well happen.
Sadly, the reason your pig died is unlikely to do with you. You can always take extra percautions by making sure you're not feeding a lot of calcium; unless you own a young (> 6 months) cavy or a nursing/pregnant sow. Also keep temperates not too cold or hot, avoid direct sunlight and drafty areas. You should also regularly 'check up' your guinea pig by examining their feet (trim nails), their weight (weight naturally fluctuates but 3-4 ounces is a cause for alarm), check fur and skin areas for cuts, bald patches, irregular wounds and other things that can indicate injury or parasites, check for weird symptoms that indicate illnesses like URIs which are sadly a common thing for pigs to get and check the eyes (eyes are a surprisingly overlooked thing and there's a lot of problems that can occur there) and tooth length. Guinea pigs hide their illnesses as said above so you have to often look yourself for warning signs of near death.