You are not logged in.

#1 2022-08-07 21:08:09

matthias.scholze
Member
Registered: 2022-08-07
Posts: 3

How can I detect the current ArchLinux version?

Hi all,

I have an ArchLinux Docker container and would like to detect on the ArchLinux version.
I have tried all the common Linux commands for version detection, but have not found any successful variants.

Can anyone give me a tip?

Regards
Matthias

Offline

#2 2022-08-07 21:10:13

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,472
Website

Re: How can I detect the current ArchLinux version?

The concept of a version cannot be applied to Arch.  Update your system.  You're up-to-date.

https://wiki.archlinux.org/title/Arch_Linux#Modernity

Last edited by graysky (2022-08-07 21:10:47)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2022-08-07 21:10:25

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,376
Website

Re: How can I detect the current ArchLinux version?

There is no  "Arch Linux" version. There is the version of the currently running kernel, or of pacman, or of...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2022-08-07 21:23:40

matthias.scholze
Member
Registered: 2022-08-07
Posts: 3

Re: How can I detect the current ArchLinux version?

Thanks @graysky and @jasonwryan for real time response :-)

@graysky:
If there is a page with the release overview for ArchLinux (see https://archlinux.org/releng/releases/, then there should also be a version to be determined on the command line.
Or, why do you think I am wrong here?

@jasonwryan
If I use a docker container, then the operating system running in the container uses the kernel of the guest OS.
At this point, I can't tell if I'm using an outdated ArchLinux that may even have known security issues.
What is wrong with my thinking?

Last edited by matthias.scholze (2022-08-07 21:30:05)

Offline

#5 2022-08-07 21:32:37

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,376
Website

Re: How can I detect the current ArchLinux version?

Like graysky said: `pacman -Syu` is how you update Arch Linux. There is no "version" in a rolling release.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#6 2022-08-07 21:52:29

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 27,833
Website

Re: How can I detect the current ArchLinux version?

matthias.scholze wrote:

At this point, I can't tell if I'm using an outdated ArchLinux that may even have known security issues.

Then update your system.  Once you run the update, you are all set for any known security issues (and generally for many that are not even yet publicly well known ... security patches frequently make it to the arch repos before any popular media reports on a given vulnerability).  In other words, don't try to check a version to see if you could be vulnerable, just update and eliminate any such possibility.

But if you really really want a script that will give you the closest thing to a "Version", here it is:

#!/bin/sh

pacman -Syu
echo "Arch Linux Version = Current"
matthias.scholze wrote:

If there is a page with the release overview for ArchLinux (see https://archlinux.org/releng/releases/, then there should also be a version to be determined on the command line.
Or, why do you think I am wrong here?

1) That's releases of the isos.  2) You don't even install what is on the iso, you install the most up-to-date packages at the time of your installation regardless of which iso you use.

Last edited by Trilby (2022-08-07 21:56:36)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2022-08-08 09:00:25

matthias.scholze
Member
Registered: 2022-08-07
Posts: 3

Re: How can I detect the current ArchLinux version?

Thanks to all for the timely and good comments. I think I got it now!

What is my motivation? We offer Versio.io, a solution that enables enterprise customers to verify product lifecycle and security governance compliance.
And here we were missing Arch Linux in the knowledgebase. But with your comments, we now know how to map it in the knowledgebase. Thank you!

Offline

#8 2022-12-27 15:03:24

JKMooney
Member
Registered: 2021-10-23
Posts: 5

Re: How can I detect the current ArchLinux version?

First off, they are all correct.  Arch is a "rolling release" there is no "version".  However, I do know that, during boot, you may get a message that looks like an "Arch Version"  (Currently "252.4-2-arch" as of the time of my typing this).  That is actually the Systemd version and you can get that by typing "systemctl --version" in the command line.  That, along with "uname -r" to get the current running kernel could, perhaps, be thought of as your current build state of Arch.

....that being said, everyone here is correct, there is no "Arch Version", just run "sudo pacman -Syu" and you're up to date.

Offline

#9 2022-12-27 15:57:37

ua4000
Member
Registered: 2015-10-14
Posts: 276

Re: How can I detect the current ArchLinux version?

@matthias.scholze
an idea for your Docker container could be:
determine, when the last arch package was installed, display this as  # days since last updated package.

Since not all packages are updated every day, and depending on your setup, there is no rule for saying it's now outdated, or it's up-to-date,
but you can put in a very rough calculation, maybe you get better numbers from others here:
1 day: system probably up-to-date
30 days: system probably outdated
90 days: system outdated.

You could check /var/log/pacman.log for '[ALPM] upgraded' ...

Offline

#10 2022-12-27 16:16:38

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 27,833
Website

Re: How can I detect the current ArchLinux version?

ua4000 wrote:

...determine, when the last arch package was installed

That tells you virtually nothing as one could install a new package without updating anything else.  A less-problematic approach would be to check the age of the sync databases - though it is possible that a user could sync the databases without updating.  Though that is completely unsupported / ill-advised, and no reasonable archer ever would:

date -r /var/lib/pacman/sync/core.db

One could also check the pacman.log for the last full system upgrade (or at least when it started on the assumption it was not interrupted):

sed -n '/starting full system upgrade/h;${g;s/ .*//p;}' /var/log/pacman.log

Though either of these also makes assumptions about the status of the enabled mirrors.  So overall checking the actual version of relevant packages would be most reliable.

Last edited by Trilby (2022-12-27 16:20:19)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB