Terminal command and script that retrieves the linux version of Manjaro Minimal LTS?

Is there a way to retrieve the linux version(s) of Manjaro, especially Manjaro Minimal LTS via script/terminal?
I’d like to use it in a script.


I just realized that I actually need to ask two slightly different questions than the one I originally had in mind.

Question #1:

I can get the exact version from uname -r, but how could I translate that to the correct package?

So I can do the same as one would do in Ubuntu like this:

sudo apt-get install linux-headers-`uname -r`

As this doesn’t work.

$ sudo pacman -S linux`uname -r`
erreur : impossible de trouver la cible : linux5.4.148-1-MANJARO

Question #2:

What script in HCL2 or JSON would get me the link to Manjaro Minimal LTS permanently?

Do you mean kernel version? If so, is uname -r what you are looking for?

1 Like

I mean retrieve the kernel version of Manjaro Minimal LTS Manjaro’s download page.
Not the one of my machine.

for kernel information you can use, uname -r
and for manjaro information you can use, cat /etc/*release*

1 Like

something like this ?

pacman -Qsq "^linux" | grep "^linux[0-9]*[-rt]*$" | awk '{print $1"-headers"}' ORS=' '

To actually install headers for any installed kernel

sudo pacman -S $(pacman -Qsq "^linux" | grep "^linux[0-9]*[-rt]*$" | awk '{print $1"-headers"}' ORS=' ') 

Credit to @dalto for the above command.

just check the link - it has the kernel version in the filename e.g.


Thank you, but this shorter command:

sudo pacman -S `pacman -Qq linux` 

was enough for my script.

My apologies for not being clear enough, as I was actually searching for this:

Solution #1:

basestrap /mnt `pacman -Qq linux` 

Solution #2:

curl -s https://manjaro.org/downloads/official/xfce/ | grep -o "https://.*manjaro-xfce.*minimal.*iso" | tail -1

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.