What do the OpenGL version strings from glxinfo actually mean? Note: I wasn't 100% certain if this question belonged here or in Ask Ubuntu. I figured since it was about OpenGL programming I'd put it here, but if I should move it to Ask Ubuntu, please let me know.
Background
I'm new to OpenGL and needed to figure out which version I could program in on my PC. A few Google/Stack Exchange searches shows that the usual solution is to run glxinfo | grep version and read the results, which I did and got the following:
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Max core profile version: 4.5
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.0.5
OpenGL core profile shading language version string: 4.50
OpenGL version string: 3.0 Mesa 18.0.5
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 18.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

The confusing part is the following three lines:
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.0.5
OpenGL version string: 3.0 Mesa 18.0.5
OpenGL shading language version string: 1.30

Everything I've read says to focus only on the Core Profile line, but I'm unable to draw anything unless I load functions and create a context under 3.0 or lower. Plus, when I call glGetString(GL_VERSION) I get 3.0 Mesa 18.0.5 printed to the terminal, but I'm not sure if that's because my hardware only supports 3.0 or if that's because I loaded functions for that level. Also, when I start writing shaders (I'm currently using Qt and an OpenGL Widget so haven't made a shader of my own yet) will I only be able to use GLSL 1.3 instead of 3.0+?
My Question
My big question is, what do the output strings actually mean? I can't find that answer. Which one tells me what my hardware can actually do? And, what do the other strings mean? Why am I getting a Core Profile of 4.5 when (as far as I can tell) I can't actually use 4.5? If my hardware can perform 4.5 operations, how do I make it do so?
When creating a OpenGL context you have to specify a profile mask, which is a way of telling the driver whether you want to use compatibility ("legacy") features or not.

Drivers are required to implement all core profile features, but compatibility profile is optional - creating a compatibility context can fail even if the driver supports the version you've requested.

The output from glxinfo you've pasted shows that you can create GL context with version up to 4.5 only when using core profile. If you want to use compatibility profile, the highest version you can request is 3.0.

One reason of the problem you are having is that you:


requested context version greater than 3.0, and
requested a compatibility profile (by setting GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB in GLX_CONTEXT_PROFILE_MASK_ARB).


If removing compatibility bit doesn't help, you'll need to double check if other context attributes are correct.

What I described above is documented in a more detailed way here.