I am developing an application on qt5 using C++ which will support all popular distros, for this currently I am using QSysInfo
qDebug() << "currentCpuArchitecture():" << QSysInfo::currentCpuArchitecture();
qDebug() << "productType():" << QSysInfo::productType();
qDebug() << "productVersion():" << QSysInfo::productVersion();
qDebug() << "prettyProductName():" << QSysInfo::prettyProductName();
It returns ubuntu, manjaro... in prettyProductName, I actually need a base system like Debian, arch...
All Linux distros are just Linux so you need to read distro-specific values:
The files are distro-specific and the information in those files are also distro-specific so the files and fields may differ from one distro to another. Some distro may not even have them
Similarly there's a common tool named
lsb_releasein most common distros and you can check its output if it existsIf a rare distro doesn't have any of those then probably you're out of luck