Pretty much I think it is. It is usually the main cause of depression and also the thing that leads to other bad habits(obviously many other things can cause these but loneliness is a very common one) . I can't help but wonder, if loneliness would be cured overnight how much our life change?
I believe you are quite right. Curing loneliness is possible by cultivating a friendship with yourself, a process of discovery that keeps you away from thoughts, and in more contact with emotions. This is my journey now, hard as hell, but... I hope worth it.
My solution (for now anyways) isn't really about social connections, but rather finding a meaningful purpose with your time.
I'm not espousing any religious beliefs here - but just treating the bible as philosophical poetry, I suppose it addresses that in Genesis - you know, God makes Eve because Adam is lonely IIRC the sumerian god Enki msturbated to form the Tigris and Euphrates because of his loneliness I think it appears in other creation myths as well (loneliness) so I think there's recognition that loneliness is a great source of discontent and is a central driver in humanity - so it could be even more fundamental than evil...action itself