Guess its time again to use more brainpower and experience
As i try to write my script collection to be able to use (many) diffrent distros, not only fedora, i face very diffrent syntax for some commands.. example.. yum, apt-get, pacman

My first attempt in getting soem basic system recognation, was to parse /etc for files named *-release or *-version.
That was semi successfull, all redhat based system worked well, as well as debian itself and arch.
However, Ubuntu and its derivates dont work the same way.
Well, in ubuntu i would find a debian-version, would would let me know i had to use apt-get rather than yum.
However, it doesnt tell me its ununtu, or which version of ubuntu.

lsb-release was another approach, but, since i want to run my scripts without installation required (yet it still needs), i'd have to implement some sort of checking if its available. and install it then 'accordingly' which results a problem, as i dont know which installation syntax is required.

Now to give you an impression of how confused i'm currently are regarding this topic, here are the current code segments: ( / refers to the script base, not the root dir)

You could always test for the existence of yum - that should identify the RH based distributions right off.

Looking for apt-get should identify the debian family.

Granted, some systems have both installed, but these would likely be debian derivatives that also access some RH repositories.

A thought - you could also look at the repository files itself - if /etc/yum.repos.d exists AND fedora-repo exists, you have Fedora, and can parse the repository file to see if [fedora] is active. This might exist for source rpms, but that would be under [fedora-source] instead. Similarly a CentOS release would also have a repository file listed.

Similar tests for the other distributions should work too. A bit long perhaps, but more reliable than a nonexistent file.

Yes, but again, that checks actualy only rh (or fedora for the same reason).
Would there be another way to figure out what kind of system (or its base) it is?
Something thats not too much of the current distro (to name just a few: arch, deb, rh, slack) is focused.

When i first figured out that theres a /etc/system-release i thought that would be exactly my solution, until i figured out that this is only a RH based solution

Namely i ask if there is a linux wide way to identify a distro with as basic command (therefore distro-independent) as possible, or on the other hand, a (better) way to install lsb-release.
My current try doesnt work that well