I want to find out the linux flavor running on the vm created using minikube-kubernetes.
I log in to the vm and do a cat /proc/version
Linux version 4.9.13 gcc version 5.4.0 (Buildroot 2017.02).
Can someone tell me which flavor this is?
Obviously not ubuntu as none of the commands man, apt-get work.
cat /etc/*release
This works across most distributions.
The minikube distro is custom built using buildroot. It is meant to be a minimal distro and does not include a package manager or package repository.
https://github.com/kubernetes/minikube/tree/master/deploy/iso/minikube-iso
https://github.com/kubernetes/minikube/blob/master/docs/contributors/minikube_iso.md
lsb_release -ai but you might need to install lsb module.
Related
I have a CentOS Linux release 7.2.1511 (Core).
I want to build some kernel code for currently running kernel.
My uname -r says 3.10.0-327.10.1.el7.x86_64, but ls -l /usr/src/kernels/
shows only 3.10.0-327.13.1.el7.x86_64. Why do I have sources of not current kernel on my filesystem(vanilla fresh provisioned Digitalocean box)?
Why does yum install kernel-devel does not install headers for currently running kernel?
uname is a system call to the kernel to get information. It's telling you what's running on that machine. What's physically present on the hard drive can be anything that anyone has installed. Someone may have downloaded the wrong package or you may have multiple kernels installed etc. But, the one that's running is what uname is telling you.
I have been working with Linux kernel, compiling and inserting modules, in my custom kernels. Previously I had Ubuntu where I had been working with my custom kernel and all the commands for compiling and installing kernel worked like a charm once I had installed all the required libraries.
Now I have switched over to Fedora 20, here I want to install my custom kernel and for that I downloaded all possible kernel tools, namely, Kernel Development Kernel Tools these are group installs and other libraries that I downloaded were ia32 libraries (as I am working on 64-bit OS), kernel-devel package. Still I am not able to work with make-kpkg command. It says bash: make-kpkg: command not found....
I googled out and did everything I could.
Can anyone get me out of this trouble?
make-kpkg is a Debian kernel packaging tool. It does not exist on RHEL family distributions, such as Fedora.
Please refer to the Fedora documentation page "Building a custom kernel" for the correct procedure. (I have not reproduced it here as it is rather long, and I'm not sure how far you may have gotten.)
The make-kpkg tool is part of the 'kernel-package' package on Debian systems. It is a Debian tool to produce debian package files. Ubuntu is based on Debian and has this tool. However, Fedora uses a different system to manage packages. So, make-kpkg would not be available on Fedora.
I want to use control group (cgroup) to control and manage the computing resources of my cluster. I've done some survey work on cgroup itself, either the command line tool or the linux kernel source code. But when I was to implement a hello world program with cgroup, I found that the header file
#include <linux/cgroup.h>
is not existed in /usr/include/linux/cgroup.h, on my Ubuntu Server 12.04 LTS x86_64 with Linux Kernel version 3.2.0-29.
However I downloaded the kernel source file from kernel.org, and found that header file in the proper folder.
I also apt-get install libcgroup-dev and found something in /usr/include/libcgroup/, but those aren't what I want.
I start to wonder whether Ubuntu disabled the cgroup functionality or migrate it from the default path? How can I programming like RedHat guys do? Thank you!
I also I have installed ubuntu 12.04 and have been working with the cgroups for some time.
Try this:
apt-get install libcgroup
Use #include <libcgroup.h> instead of #include <linux/cgroup.h>.
How do I determine which RedHat Linux version I am running?
Here's what I've read:
/etc/redhat-release file contains the version, but anybody can tamper with that file.
people say uname command, but you can install any kernel on Redhat.
If I am running redhat 5.1 and someone upgrade it with 5.2 or 5.x, what determines the version of RedHat?
even lsb_release -a read /etc/redhat-release file.
Try this command:
rpm -qa | grep release
for instance on my machine I get this
redhat-release-workstation-6Workstation-6.4.0.4.el6.x86_64
If "anybody" has root access to your machine to either change /etc/redhat-release or install an alternate kernel you're most probably in bigger trouble than determining the redhat version of your system.
Just use the value pointed out by /etc/redhat-release or even better in terms of portability use the output of lsb_release as this is exactly the purpose they were made for.
With "anybody" being able to do anything with your system there is no other chance at all.
You can use the lsb_release command on recent linux distributions. If you issue:
lsb_release -i -r
Or
uname -r
And map the output. 2.6.9 kernels are RHEL4, 2.6.18 kernels are RHEL5. If necessary, you can map the full version to the specific update releases from Red Hat (i.e. 2.6.9-89 is RHEL5 U4).
Note: since July 2012, /etc/os-release should be the standard file where to look for the version of any OS.
It relieves application developers who just want to know the distribution they are running on to check for a multitude of individual release files.
It provides both a "pretty" name (i.e. one to show to the user), and machine parsable version/OS identifiers (i.e. for use in build systems).
It is extensible, can easily learn new fields if needed.
See its man page.
Example for RedHat:
# cat /etc/os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.0 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="7.0"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.0 (Maipo)"
A trick working on numerous Linux distributions:
cat /etc/issue
Example on Red Hat 6:
$ cat /etc/issue
CentOS release 6.7 (Final)
Kernel \r on an \m
$
The most simple command is:
lsb_release -d
try
uname -r
or
cat /etc/issue
for recent linux machines
lsb_release -d
For folks who are reading this today, or in the future:
The kernel version that is RUNNING is your version of RedHat. There may be other versions installed, but not running.
Thus, if RedHat 5.1, 5.2 & 5.x are installed on the machine, only 1 can be running at a time. This is the version that was booted at system start uop.To determine which version is actually running, use the uname command:
uname -r
This returns the Kernel release number.
For RedHat 5, it will be 2.6.18-[something]
RH 5.1 is 2.6.18-53
RH 5.2 is 2.6.18-92
To translate kernel release numbers into Redhat Version numbers, see this link:
Red Hat Enterprise Linux Release Dates
The file /etc/redhat-release is standart way to get vendor version (including 5.X). I don't think you should ignore this way. Of course, you can use various tricks from other software to display the current version of OS, but anyway many of them are parsing the /etc files. As mentioned above you can use rpm query to get version. Another way to get such information: rpm -q <vendor-name>-release
BTW I agree with the commenters above that the way you knowing the version is the least of your problems if anyone can tamper with the standard /etc/redhat-release file or other system configuration files.
Additionally since RHEL 7.X versions you can also try hostnamectl | grep 'Operating System'
I would like to show the user some help on specific operations in my program of the form:
Please type "apt-get install foobar" to install the foobar feature.
Is there anything to do this or do i have to leave it to the user and offer a dozend choices from Red Hat, Suse, Debian/Ubuntu, Mandriva, Slackware, Gentoo ....
cat /etc/lsb-release
root#pierr-desktop:~# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.10
DISTRIB_CODENAME=intrepid
DISTRIB_DESCRIPTION="Ubuntu 8.10"
lsb_release -a might help on debian and apparented.
No, there is no generic way to find out which Linux distribution you are running on.
There is the lsb_release command, which is specified in the Linux Standard Base specification. But obviously this command is only present on LSB-compliant distributions, and many smaller or specialized distributions are not LSB-compliant. (For example, the distribution I am running on my FritzBox router is not.)
And if you are assuming an LSB-compliant distribution anyway, then why not simply package your application as an LSB package? That way it works the same on all LSB-compliant distributions.
You could give
cat /etc/issue
a try too
Given that Linux can be built starting with one system and morphed into another, you may not be able to tell precisely which it currently is. Some distribution provide the lsb tools if they are LSB compliant, so that might help.
Some distributions provide a file /etc/dist-release. For example, I have a file /etc/arch-release that is empty.
You might also execute:
uname -a
That might indicate the distribution the kernel was built for, but that might be a long shot. My Arch linux kernel has no mention of Arch, but I believe my Gentoo install indicates "Gentoo Linux".
Some tools can be indicative of the distribution, such as apt-get, rpm, emerge, but you can usually install those tools on other distributions as well.
You can do it for most well know distros(Redhat, Fedaora, Gentoo, Suse, Debian, Ubuntu), those have special files to identify the distribution and version. i.e. /etc/debian_version.
But it would be a tedious task for you to list out all the package and things but if you really want to be user friendly
try with cat:
cat /proc/version
but with uname is maybe better:
uname -a