If one of your guinea pigs sadly dies, leaving a single guinea pig left alone then yes, your remaining guinea pig will be very lonely and needs a companion. If you have more than two guinea pigs and one dies, then it’s not absolutely necessary to get another, but if you want to buy or adopt more then go right ahead. If one of your two guinea pigs dies and you absolutely don’t want to adopt or buy another then it would be kindest to give your remaining guinea pig to a trusted friend who already has guinea pigs, or to a local sanctuary. Guinea pigs are herd animals and don’t wish to be kept on their own, even if they don’t get on particularly well with others. If you need help or advice with grumpy guinea pigs that you’re nervous of finding a new friend for, have a look at the Introducing Guinea Pigs section for some handy tips.

Guinea pigs get very lonely
Some owners think that their guinea pig needs to be kept on their own because they don't enjoy the company of other guinea pigs. However, since guinea pigs are herd animals, this is not true. When attempting to make introductions, what some owners miss is the idea that guinea pigs get along best when they are introduced on a neutral territory. A neutral territory is an area in which neither animal has spent a lot of time, and so hasn't had a chance to explore it and mark it as its own. You can make neutral territories out of a very large, safe cardboard box with air holes, or by establishing one in a special area of your house that is safe for guinea pigs to roam around in. Make sure that this area is big enough so that they aren't forced very close together, or they could feel a little threatened and less likely to bond. Introducing the animals in areas such as these means that neither is feeling as if the other has invaded their space, which is likely to mean they get along better.
Sadguineaowner, 21 October 2021
One of my two guineas died this morning due to unknown causes but he was 5 years old and had quite major surgery in the past. His brother is the same age and is still healthy but I'm worried about him becoming lonely. I don't want to get another guinea pig as my future living situation is uncertain. My guineas have always been free in my quite large garden and I'm worried that if I give me remaining guinea away he might not have the same quality of life, having to spend most of his time in a cage. What should I do? I love my remaining guinea and I'm scared I might have to put him down so that his whole life is happy and he doesn't become sad.