To those who think that loneliness sucks I only have to say that it’s a state of mind and it very much depends on your perspective. There are plenty of tips out there for lone travellers, so if you feel lonely during one of your trips, go online and find the kind of suggestions that’ll work for you, for instance this web site.
I personally like finding the local library and reading comics. You may not understand the local language, but images will speak to you.
I’ve always thought that being sociable is overrated (I read an article in Spanish today that confirms this idea). I’m quite a solitary person myself and I rarely feel lonely. I love silence! Being off the grid and finding a good book can be a blessing to me.

Ironically, I’ve felt most lonely while travelling with the wrong companions. Travelling might be great, but it definitely sucks with the wrong people. One should carefully choose who to travel with.
There comes actually the other side of the spectrum: wanting to be alone and not being allowed to. For such moments, it’s important to learn polite ways to reject any undesired company both in the local language and the accepted body language.
In any case, remember that if you feel lonely or you want to be left alone, it’s in your hands to do whatever is necessary – do not wait for something or somebody to decide for you.
As for taking up corrective measures, remember: Better late (and alone) than sorry.