Linux:...ibution(3pm)

πŸ“¦
version 0.23 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Linux::Distribution β€” perl's lil' "which distro am I even on??" detector πŸ’–

okay so real talk, bestie: this is Linux::Distribution, a User Contributed Perl Documentation page (a 3pm man page, iykyk). It's a Perl extension whose whole personality is detecting on which Linux distribution we are running. She's nosy, she's thorough, she's iconic. πŸ¦‹


✨ NAME ✨

Linux::Distribution β€” Perl extension to detect on which Linux distribution we are running.

🌸 SYNOPSIS 🌸

The classic, function-style way, no objects, just vibes:

use Linux::Distribution qw(distribution_name distribution_version);

if(my $distro = distribution_name) {
      my $version = distribution_version();
      print "you are running $distro, version $version\n";
} else {
      print "distribution unknown\n";
}

Or else do it OO:

use Linux::Distribution qw(distribution_name distribution_version);

my $linux = Linux::Distribution->new;
if(my $distro = $linux->distribution_name()) {
      my $version = $linux->distribution_version();
      print "you are running $distro, version $version\n";
} else {
      print "distribution unknown\n";
}

πŸŽ€ DESCRIPTION πŸŽ€

This is a simple module that tries to guess on what linux distribution we are running by looking for release's files in /etc. Not me being a detective πŸ”, but like, that's literally the job.

It now looks for 'lsb-release' first as that should be the most correct and adds ubuntu support. Secondly, it will look for the distro specific files. Priorities, bestie. πŸ’…

It currently recognizes slackware, debian, suse, fedora, redhat, turbolinux, yellowdog, knoppix, mandrake, conectiva, immunix, tinysofa, va-linux, trustix, adamantix, yoper, arch-linux, libranet, gentoo, ubuntu, scientific, oracle enterprise linux, amazon linux and redflag. That's a whole roster. She ate. πŸ‘‘

It has function to get the version for debian, suse, fedora, redhat, gentoo, slackware, scientific, oracle enterprise linux, amazon linux, redflag and ubuntu(lsb). People running unsupported distro's are greatly encouraged to submit patches :-)

fr fr, if your distro isn't on the version list, that's your main character moment β€” go send a patch. 🫢

πŸ“¦ EXPORT πŸ“¦

None by default.

πŸ”₯ TODO πŸ”₯

Add the capability of recognize the version of the distribution for all recognized distributions.

πŸ‘‘ AUTHORS πŸ‘‘

  • Alexandr Ciornii <alexchorny@gmail.com>, <http://chorny.net>
  • Alberto Re, <alberto@accidia.net>
  • Judith Lebzelter, <judith@osdl.org>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.


okay that's the whole page, bestie, no notes. this beauty ships as perl v5.36.0, dated 2022-10-15, and it's the Linux:...ibution(3pm) page β€” love that for her. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from