baicai

白菜

一个勤奋的代码搬运工!

Ways to check the Debian system version

Ways to Check Debian Distribution Version

1. Using lsb_release Command#

The lsb_release command can be used to view the specific version of a Linux distribution operating system. It may not be installed on your operating system, so you need to install it first. Run the following command to install lsb_release:

    apt-get install lsb-release

Once the installation is complete, simply enter the following command to view the version information of your current system:

    lsb_release -a

You will see results similar to the following:

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

The above results indicate that the current operating system version being used is Debian 11.

2. Viewing the /etc/issue File#

The second method to check the current Debian version is to view the issue file located in the /etc directory. You can use the cat command to view the contents of the file by entering the following command:

    cat /etc/issue

You will see results similar to the following:

    Debian GNU/Linux 11 \n \l

3. Viewing the /etc/os-release File#

/etc/os-release is a file that contains operating system identification data and can only be found on the latest Debian release running systemd. You can also use the cat command to view the contents of this file by entering the following command:

cat /etc/os-release

You will see results similar to the following:

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

If you want to know the more specific minor version number, you can view the /etc/debian_version file by entering the following command:

    cat /etc/debian_version

You will see results similar to the following:

    11.4

4. Using the uname Command#

The uname command can display information about the computer and operating system. Enter the following command:

    uname -a

You will see results similar to the following:

    Linux baicai-l01 5.10.0-16-amd64 #1 SMP Debian 5.10.127-1 (2022-06-30) x86_64 GNU/Linux

5. Using the hostnamectl Command#

The hostnamectl command is used to configure or modify the system's hostname, but it can also be used to get the version of the Debian system. Simply enter hostnamectl:

    hostnamectl

You will see results similar to the following:

   Static hostname: baicai-l01
         Icon name: computer-desktop
           Chassis: desktop
        Machine ID: xxx
           Boot ID: xxx
  Operating System: Debian GNU/Linux 11 (bullseye)
            Kernel: Linux 5.10.0-16-amd64
      Architecture: x86-64
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.