Objective: Get Ubuntu distribution codename such as trusty
for 14.04 and xenial
for 16.04
To get the codename of a Ubuntu release, use the lsb_release
command.
1 2 |
# lsb_release -c Codename: xenial |
Another way is to cat
the /etc/os-release
file.
1 2 |
# cat /etc/os-release | grep UBUNTU_CODENAME UBUNTU_CODENAME=xenial |
The third option is to extract the codename from the /etc/lsb-release
file.
1 2 |
# cat /etc/lsb-release | grep CODENAME DISTRIB_CODENAME=xenial |