Finding ubuntu linux version

How to Find Which Linux Version You Are Running

Logged in on a Linux system via SSH and wondering which Linux distribution is it? Here’s how to check the Linux version.

When you install a Linux distribution on your own, you know which distribution and version it is.

But if you use SSH to log in to a remote Linux server provided by an enterprise or client, you may wonder which Linux distribution and version it is.

The simplest way to check Linux version is to see the content of the /etc/os-release file:

It will show an output similar to this:

NAME="Ubuntu" VERSION="20.04.1 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.1 LTS" VERSION_ID="20.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=focal UBUNTU_CODENAME=focal

As you can see, the Linux name is Ubuntu and the version is 20.04.1.

However, that’s not the only way to know the Linux distribution details. In this beginner’s tip, I’ll show you different ways to check which Linux you are running.

Find Linux distribution details

How to check Linux version

Method 1: Use /etc/os-release file

If you are familiar with the Linux directory structure, you probably already know that /etc directory contains the core configuration files of the system.

The os-release file in the /etc directory keeps the information about the Linux distribution. It gives you the distribution name, distribution version, release name or ID.

Here’s what it displays for Alpine Linux server running on Linode infrastructure.

handbook:~# cat /etc/os-release NAME="Alpine Linux" ID=alpine VERSION_ID=3.12.0 PRETTY_NAME="Alpine Linux v3.12" HOME_URL="https://alpinelinux.org/" BUG_REPORT_URL="https://bugs.alpinelinux.org/"

As you can see, the name of Linux distribution is Alpine Linux and the distribution version is 3.12.

The content of the /etc/os-release is usually different for different distributions. Distributions often use it to provide additional information like where to get support or file bugs etc.

For example, the /etc/os-release provides more lines for CentOS Linux.

NAME="CentOS Linux" VERSION="8 (Core)" ID="centos" ID_LIKE="rhel fedora" VERSION_ID="8" PLATFORM_ID="platform:el8" PRETTY_NAME="CentOS Linux 8 (Core)" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:centos:centos:8" HOME_URL="https://www.centos.org/" BUG_REPORT_URL="https://bugs.centos.org/" CENTOS_MANTISBT_PROJECT="CentOS-8" CENTOS_MANTISBT_PROJECT_VERSION="8" REDHAT_SUPPORT_PRODUCT="centos" REDHAT_SUPPORT_PRODUCT_VERSION="8" 

However, all of them provide the Linux distribution name and version so it is a pretty reliable way to know which Linux you are running. In fact, it is the most reliable way.

Читайте также:  Kali linux windows 10 wsl2

Method 2: Use hostnamectl command

Most Linux distributions these days use systemd. On such a system, you can use the hostnamectl command to get Linux version detail.

For the same CentOS system that you saw above, hostnamectl provides the following details:

[[email protected] ~]# hostnamectl Static hostname: localhost.localdomain Transient hostname: li2498-99.members.linode.com Icon name: computer-vm Chassis: vm Machine ID: e3fe2be3e17be3e1763bf43e8337e68b Boot ID: 33d3052bbffd44b1869bbffd4b00d26c Virtualization: kvm Operating System: CentOS Linux 8 (Core) CPE OS Name: cpe:/o:centos:centos:8 Kernel: Linux 4.18.0-147.8.1.el8_1.x86_64 Architecture: x86-64

You can see the Linux version detail in the line starting with ‘Operating System’.

The hostnamectl command is primarily used for dealing with the hostname but if it provides other details why not use it?

Method 3: Use lsb-release command

This is NOT a command that you’ll find in all Linux distributions. I think it is mostly used by Debian/Ubuntu based distributions.

You can use the lsb_release command with option -a and it will provide distribution details:

Don’t mind the No LSB modules are available line. It’s not an error of any kind.

[email protected]:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.1 LTS Release: 20.04 Codename: focal

Bonus Tip: Find Linux kernel version

Now that you know which distribution you are running, perhaps you would also like to know about the Linux kernel version running on the system.

You can get the kernel details using the uname command in any Linux distribution.

The output shows only the Linux kernel version:

handbook:~# uname -r 5.4.43-1-virt

No prizes for guessing that the above system is running on Linux kernel version 5.4.43.

I hope you find this quick tip helpful in finding Linux version detail. If you have questions or suggestions, please let me know in the comment section.

Источник

Как узнать версию дистрибутива Ubuntu

Компания Canonical выпускает новые версии своего дистрибутива Ubuntu дважды в год, в апреле и октябре. Таким образом, номер каждой версии состоит из двух последних цифр года и номера месяца. например: 13.04, 14.10, 16.04 и т д. Также каждая версия получает кодовое имя, состоящее из двух слов начинающихся на одинаковую букву. Первым кодовым именем было Warty Warthog (Бородавчатый Бородавочник) его получил дистрибутив с номером версии 4.10.

Бывают случаи когда вам нужно узнать версию Ubuntu. Конечно, если систему ставили вы сами то наверняка знаете что ставили. Но если компьютер не ваш, или сервер хостинга, а нужно установить специфическое программное обеспечение, обновить систему или подключить сторонний репозиторий, нужно искать решение. В этой статье мы рассмотрим как узнать версию Ubuntu в терминале, в графическом интерфейсе, а также как узнать версию ядра используемого в системе.

Как узнать версию установленной Ubuntu в GUI

Без установки дополнительных программ версию Ubuntu можно посмотреть с помощью утилиты Параметры системы. Запустите её из главного меню:

Читайте также:  Linux how to change user group

Затем выберите пункт О системе:

Здесь будет отображена не только версия Ubuntu, но и модель процессора, количество оперативной памяти, разрядность системы и размер диска. Это что-то вроде окна свойства системы в Windows. В предыдущих версиях дистрибутива еще была возможность посмотреть версию в мониторе ресурсов, но в начиная с Ubuntu 14.04 ее уже нет.

Как узнать версию Ubuntu в терминале

А здесь уже способов намного больше. Первый и самый простой — команда lsb_release:

Опция -a заставляет утилиту показать всю информацию, r — только номер версии, -c только кодовое имя. Хотя можно просто посмотреть содержимое файла /etc/lsb_release:

Следующий способ узнать версию Ubuntu в терминале — файл /etc/issue и /etc/issue.net. В этих файлах хранится текст приветствия, которое будет отображаться после входа в систему, но если вы ничего не меняли тут будет версия Ubuntu:

Следующий способ не такой удобный, но тоже работает:

awk ‘/^Description: Ubuntu 7/ ‘ /usr/share/python-apt/templates/Ubuntu.info

Есть ещё один способ посмотреть версию — с помощью systemd. Для этого выполните:

Как узнать версию ядра в Ubuntu

Для решения этой задачи служит утилита uname:

Здесь мы видим всю доступную информацию — версию, имя компьютера, дату сборки и архитектуру. Если нужно посмотреть только версию наберите:

Еще немного информации о процессоре и архитектуре можно узнать из вывода утилиты lscpu:

Чтобы узнать с какими параметрами было загружено ядро наберите:

Здесь тоже мы тоже можем узнать версию ядра Ubuntu.

Выводы

Вот и все. Как видите, это не такая уж сложная задача. Вы можете очень просто посмотреть какая система установлена на вашем компьютере или сервере. Если у вас остались вопросы, спрашивайте в комментариях!

Обнаружили ошибку в тексте? Сообщите мне об этом. Выделите текст с ошибкой и нажмите Ctrl+Enter.

Источник

How to Find which Ubuntu Linux Version Running on your Computer

This post describes steps one can take to find the version of Ubuntu Linux running on a computer.

A new version of Ubuntu Linux is released frequently. There are two release versions: Standard and Long-Term Support (LTS) releases.

Ubuntu Linux’s normal releases come out every 6 to 9 months. This is suitable for desktop users since the latest versions include new features and hardware support.

Ubuntu LTS releases occur every two years and are supported for five years for desktops and servers. The LTS versions are suitable for servers since long-term support is excellent for enterprise applications and services.

Below is how one can find out the version of Ubuntu Linux running on a system.

How to find the Ubuntu Linux version on a computer

As described above, there are two types of Ubuntu Linux releases Standard and Long-term support (LTS).

Below are steps you can use to find out the version of Ubuntu you are running.

Читайте также:  Выбрать диск в линукс

The quickest way to find out the Ubuntu Linux version is to use the lsb_release utility. LSB (Linux Standard Base) is a utility that provides information about Linux distribution.

To use the utility, open your terminal by typing Ctrl — Alt — T on your keyboard to open the terminal.

Then type the commands below:

lsb_release -a

That should output a similar info sheet below:

No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.1 LTS Release: 22.04 Codename: jammy

That gives you the version of Ubuntu and the release number.

When you use the -d switch with the lsb_release command instead of – a , it displays the description only.

Description: Ubuntu 22.04.1 LTS

Another way to find out the Ubuntu Linux version is via the issue or the os-release file.

Run the commands below to display the content of the issue file. The issue file contains the operating system identification text.

That should output a similar line as below:

Alternatively, you may look in the /etc/os-release file to learn and find out the Ubuntu Linux version.

That file contains more operating system identification data. For example, run the commands below to display the os-release data for Ubuntu Linux.

That should output the lines below:

PRETTY_NAME background-color:rgba(0, 0, 0, 0);color:#e00f0f" >22.04.1 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04.1 LTS (Jammy Jellyfish)" VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" UBUNTU_CODENAME=jammy

The hostnamectl command also shows you info about Ubuntu Linux. Run the commands below to view the Ubuntu Linux version.

That should up the info sheet below:

Static hostname: Ubuntu2204 Icon name: computer-vm Chassis: vm Machine ID: 103bd8b830824b90bca97c6ac84ad445 Boot ID: 8f430b32cc1b4831959fbdcae616810f Virtualization: oracle Operating System: Ubuntu 22.04.1 LTS  Kernel: Linux 5.15.0-47-generic Architecture: x86-64 Hardware Vendor: innotek GmbH Hardware Model: VirtualBox

There are many ways to discover the Ubuntu version number from the command line.

Find the Ubuntu Linux version via desktop system settings

If you are on an Ubuntu desktop and want to view the version of Ubuntu Linux running on your computer, you can do that from the Settings app.

To do that, click on the top bar and select the System menu at the top right corner.

Then select Settings.

In the Settings app, select About. You should see details about your computer, including the Ubuntu Linux version.

This post showed you the many ways to view the Ubuntu Linux version running on your computer. Please use the comment form below if you find any errors above or have something to add.

Richard W

I love computers; maybe way too much. What I learned I try to share at geekrewind.com.

Источник

Оцените статью
Adblock
detector