Linux debian консольная версия

Как проверить версию Debian Linux

Когда вы входите в систему Debian Linux в первый раз, перед выполнением какой-либо работы всегда рекомендуется проверить, какая версия Debian работает на машине.

Всегда активно поддерживаются три выпуска Debian:

  • Стабильный — последний официально выпущенный дистрибутив Debian. На момент написания этой статьи текущим стабильным дистрибутивом Debian была версия 9 (stretch). Это версия, рекомендованная для производственных сред.
  • Тестирование — предварительный выпуск, который станет следующим стабильным выпуском. Он содержит пакеты, которые еще не готовы к стабильному выпуску, но находятся в очереди на это. Этот выпуск постоянно обновляется, пока он не будет заморожен и не выпущен как стабильный.
  • Нестабильный , всегда под кодовым названием sid — это дистрибутив, в котором идет активная разработка Debian.

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

Проверка версии Debian из командной строки

Утилита lsb_release отображает информацию LSB (Linux Standard Base) о дистрибутиве Linux.

Предпочтительный метод проверки вашей версии Debian — использовать утилиту lsb_release которая отображает информацию LSB (Linux Standard Base) о дистрибутиве Linux. Этот метод будет работать независимо от того, какую среду рабочего стола или версию Debian вы используете.

No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 9.5 (stretch) Release: 9.5 Codename: stretch 

Ваша версия Debian будет показана в строке описания. Как видно из вывода выше, я использую Debian GNU / Linux 9.5 (stretch).

Вместо того, чтобы печатать всю вышеуказанную информацию, вы можете отобразить строку описания, в которой указана ваша версия Debian с параметром -d .

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

Description: Debian GNU/Linux 9.5 (stretch) 

Кроме того, вы также можете использовать следующие команды, чтобы проверить свою версию Debian.

Проверка версии Debian с помощью файла /etc/issue

Следующая команда cat отобразит содержимое файла /etc/issue который содержит текст идентификации системы:

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

Проверка версии Debian с помощью файла /etc/os-release

/etc/os-release — это файл, содержащий идентификационные данные операционной системы, и его можно найти только в новых дистрибутивах Debian, работающих под управлением systemd.

Этот метод будет работать, только если у вас Debian 9 или новее:

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

PRETTY_NAME="Debian GNU/Linux 9 (stretch)" NAME="Debian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" 

Проверка версии Debian с помощью команды hostnamectl

hostnamectl — это команда, которая позволяет вам установить имя хоста, но вы также можете использовать ее для проверки вашей версии Debian.

Эта команда будет работать только в Debian 9 или более новых версиях:

 Static hostname: debian9.localdomain Icon name: computer-vm Chassis: vm Machine ID: a92099e30f704d559adb18ebc12ddac4 Boot ID: 4224ba0d5fc7489e95d0bbc7ffdaf709 Virtualization: qemu Operating System: Debian GNU/Linux 9 (stretch) Kernel: Linux 4.9.0-8-amd64 Architecture: x86-64 

Выводы

В этом руководстве мы показали вам, как найти версию Debian, установленную в вашей системе. Для получения дополнительной информации о выпусках Debian посетите страницу выпусков Debian .

Читайте также:  Личный кабинет альт линукс

Не стесняйтесь оставлять комментарии, если у вас есть вопросы.

Источник

Как узнать версию Linux из консоли?

Для получения версии Linux на хосте я чаще всего использую команду:

команда lsb_release

Эта команда входит в пакет lsb-core, который по-умолчанию установлен в Ubuntu и Debian. Поэтому она не является универсальной.

В rpm дистрибутивах Linux (RHEL, CentOS, Rocky/Oracle Linux) имя дистрибутива можно узнать так:

CentOS Linux release 7.9.2009 (Core)

cat /etc/*rel* версия centos

В менее распространённых дистрибутивах Linux можно вывести архитектуру процессора и версию ядра с помощью команда uname:

В выводе этой команды также содержится и версия дистрибутива Linux.

Как вы видите, для определения версии Linux в разных дистрибутивах используются разные команды.

В версиях Linux с systemd (большинство современных дистрибутивов), чтобы узнать версию ОС можно использовать универсальную команду:

Static hostname: appubnt1 Icon name: computer-vm Chassis: vm Machine ID: xxxxxxxxxxxxxxxxxxx Boot ID: xxxxxxxxxxxxxxxxxxxxxx Virtualization: vmware Operating System: Ubuntu 22.04.1 LTS Kernel: Linux 5.15.0-56-generic Architecture: x86-64 Hardware Vendor: VMware, Inc. Hardware Model: VMware Virtual Platform

hostnamectl - информация о версии Linux

Она одинаково работает на всех платформах. Кроме того, вы сразу видите на какой платформе запущена Linux: контейнер, ВМ или железо

Источник

How to Check Debian Version? [Get Debian Version Command]

Are you looking into get Debian version command, or wanna check Debian version you are using? This blog post will help you to achieve your goal.

How to Check Debian Version? [Get Debian Version Command]

List of content you will read in this article:

Debian is one of the most popular Linux distributions. It is always a good option before working on any operating system to check its specification. Keep on reading this article to find out how to check Debian version via GUI and how to get the Debian version using command line. Debian has three types of releases actively maintained by its community. The three releases are:

  • Stable — In this article, we consider the stable distribution of Debian version 9 (stretch), which is highly recommended for production environments.
  • Testing — The preview distribution might become the next stable release containing the required packages that are not ready for stable release yet.
  • Unstable — It is the distribution where most of the active development of Debian takes place.

Whenever you log into the Debian operating system, check what version of Debian has been installed on your system.

In this guide, we will be highlighting various methods to determine how to get Debian version or how to check Debian version on your operating system.

Methode 1: How To Check Debian Version using Command-Line?

Being one of the popularly used distributions of Linux- Debian also comes with the most interactive terminal where you can run commands for carrying out several tasks without any problem. Debian has a utility called the lsb_release that will help display the information regarding the available Linux distribution on the system. Here, the LSB represents the Linux standard base.

For using the lsb_release command, make sure that you install the LSB. Only after that will you print the required information about the system. Also, ensure that you have sudo access to run the desired command.

Читайте также:  Ppd файл в linux

For installing LSB, run the following commands with the sudo access:

sudo apt update
sudo apt upgrade
sudo apt install lsb

In the above image, you can see that the package for LSB has been installed successfully. Now, as you have installed the LSB package, you can run the lsb_release command. You will get the desired information about the system. You can use the following syntax to use is:

If you want to get the list of all the options that can be used in conjunction with the lsb_release command, you can use this command along with the “-h” option, and it will open the documentation for this command.

Below are the available options-

  1. -h — it will display the help menu.
  2. -v — specifies the version that will display the LSB modules supported by the system.
  3. -i — it will display the present Linux distribution.
  4. -d — a description will display the detailed description of the Linux Distribution.
  5. -r — it will display the version of the distribution.
  6. -c — codename will display the codename of the distribution.
  7. -a — it will display all the information mentioned above.
  8. -s — it will display the output in a short format.

Suppose we run lsb_release along with the “-a” option as shown below; you will get the following output. Also, this method will work for any desktop environment or with any version of Debian. The check Debian version command is as follows:

No LSB modules are available
Distributor ID: Debian
Description: Debian GNU/Linux 9.5 (stretch)
Release: 9.5
Codename: stretch

As per the above output, you can see that we have the Debian GNU/Linux 9.5 (stretch) version.

  • Also, if you do not want to get the information in the above format, you can run the lsb_release command along with the “-d” option, as shown below:
Description: Debian GNU/Linux 9.5 (stretch)

Read the next section to learn how to get Debian version

Method 2: How to Get Debian Version using the /etc/issue file?

Debian has a /etc/issue file in its filesystem hierarchy that will hold the required information about the OS installed on your system. To get the details of this file, you can run the cat command on this file, as shown below:

You can see that the installed version of Debian is GNU/Linux 9 (stretch).

Method 3: How to Check Debian Version using the /etc/os-release file?

Another simple way to check the installed version of Debian on your system is to execute the cat command on the file /etc/os-release that contains valuable information about the system, such as identification data and others.

PRETTY_NAME=»Debian GNU/Linux 9 (stretch)»
NAME=»Debian GNU/Linux»
VERSION_ID=»9 (stretch)»
ID=debian
HOME_URL=»https://www.debian.org/»
SUPPORT_URL=»https://www.debian.org/support»
BUG_REPORT_URL=»https://bugs.debian.org/»

Method 4: How to Check Debian Version using the hostnamectl command?

You can use the hostnamectl command to set the hostname for the system and check the installed version of Debian on your system. You can see the desired output as shown below.

Static hostname: debian9.localdomain
Icon name: computer-vm
Chassis: vm
Machine ID: a92099e30f704d559adb18ebc12ddac4
Boot ID: 4224ba0d5fc7489e95d0bbc7ffdaf709
Virtualization: qemu
Operating System: Debian GNU/Linux 9 (stretch)
Kernel: Linux 4.9.0-8-amd64
Architecture: x86-64

Читайте также:  Меняем разрешение экрана linux

Methode 5: How to Check the Debian version using the uname command?

Another simple way for checking the installed Debian version is to use the “uname” command on your terminal. This command works similarly to the “ver” command used for MS-Dos systems. You can use the below syntax for the “uname” command.

Whenever you run the “uname” command without passing any parameters, you will only get the OS name but not the distribution, kernel-related information. But, by default, the command will take the “-s” option.

  • There is a list of parameters that you can use with the “uname” command. This list is shown below. For this, you can use the “-help” option along with the “uname” command.

  • If you want to check the version of the “uname” command, then you can use the “—version” parameter along with the “uname” command.

  • For getting detailed information about the distribution, such as Kernel name, Domain, name (localhost.local Domain), Kernel version, and others, you can use the “-a” option along with the “uname” command.
  • Also, you can combine different options for getting desired details about the system’s distribution.

Method 6: How to Check Debian Version from Graphical User Interface

If you prefer to view the Debian version via GUI instead of the command line, there are a few ways to do so, depending on your desktop environment.

If you are using GNOME, you can go to the System Information section by clicking on the Activities button and searching for System Information. Alternatively, you can open the Terminal application and type gnome-control-center to open the GNOME Control Center, then navigate to the Details section.

If you are using KDE, you can check the Debian version by going to the System Settings section and clicking on Details. This should display the Debian version along with other system information.

For other desktop environments, the steps may vary. However, most provide a System Information or System Settings section that should display the Debian version. If you cannot locate this information in the GUI, you can always fall back to the command line methods mentioned in other articles.

Conclusion

If you are a technical person, you might be aware of the simple commands that will help you get Debian version of the installed Debian distribution on your system. Knowing the version beforehand is good practice once you start using the system. It is beneficial to troubleshoot any issue or reach any root cause for that occurred issue. Also, it helps you while installing any package as you can look for the specific package that has compatibility with the installed Debian version.

You can go through the various methods to check Debian version. These are simple ways that even a beginner can implement. But make sure that you have sudo access to run the terminal commands to get the desired output. if you are looking to buy a Debian VPS, you can opt for monovm.com

People Are Also Reading:

Источник

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