How to Check Ubuntu Version Using Terminal and GUI - A Comprehensive Guide

LightNode
By LightNode ·

Checking Ubuntu Version via Command Line

One of the most straightforward methods to check your Ubuntu version is by using the command line, also known as the terminal. This approach is particularly useful for users who prefer working with text-based interfaces or for situations where the graphical user interface (GUI) is not accessible.

Using the lsb_release Command

The lsb_release command is a versatile tool that provides detailed information about your Linux distribution, including the Ubuntu version you're running. This command supports various flags that allow you to display specific information about your system.

To get the full details about your Ubuntu version, open the terminal (you can use the keyboard shortcut Ctrl + Alt + T) and enter the following command:

lsb_release -a

This command will output a comprehensive list of details, including the distribution description, release number, and codename. For example:

lsb_release

You can also use different flags with the lsb_release command to obtain specific information:

  • lsb_release -d: Displays the description of your Ubuntu version.
  • lsb_release -s -d: Displays only the description, omitting any additional text.
  • lsb_release -c: Shows the codename of your Ubuntu version.
  • lsb_release -r: Prints the release number of your Ubuntu version.
  • lsb_release -r -s: Displays only the release number, without any additional text.

These variations of the lsb_release command allow you to quickly retrieve the information you need about your Ubuntu version, making it a versatile tool for both novice and advanced users.

LightNode Linux VPS

Buy Ubuntu VPS by Hourly

Best Ubuntu VPS with high-performance and hourly billing.

Accessing Ubuntu Version Files

In addition to using the lsb_release command, you can also check your Ubuntu version by directly accessing specific files on your system that contain version information.

Reading /etc/lsb-release and /etc/os-release Files

The /etc/lsb-release and /etc/os-release files are text-based files that store information about your Linux distribution, including the Ubuntu version you're running. You can view the contents of these files using the cat command in the terminal.

To check your Ubuntu version with the /etc/lsb-release file, open the terminal and enter the following command:

cat /etc/lsb-release

This command will display the contents of the file, which typically includes the distribution ID, release number, and description. For example:

cat_lsb_release

Alternatively, you can use the /etc/os-release file, which is compatible with Ubuntu 16.04 and later versions. To view its contents, run the following command in the terminal:

cat /etc/os-release

The output will be similar to the /etc/lsb-release file, but with additional information like the Ubuntu version name and links to resources.

These files provide a straightforward way to check your Ubuntu version without the need for additional flags or options. However, keep in mind that they may not display the information in a formatted or user-friendly manner like the lsb_release command.

Checking Ubuntu Version with /etc/issue File

The /etc/issue file is another text-based file that contains system identification data, including the Ubuntu version you're running. Unlike the previous files, the /etc/issue file typically displays only the version number, making it a concise option if you don't need additional details.

To view the contents of the /etc/issue file, open the terminal and enter the following command:

cat /etc/issue

The output will display a single line of text with the Ubuntu version number, usually followed by "LTS" if you're running a Long Term Support (LTS) release.

While the /etc/issue file provides a more minimalistic approach to checking your Ubuntu version, it may not be as informative as the other methods if you require additional details or a more user-friendly output.

Alternative Commands for Checking Ubuntu Version

While the lsb_release command and file-based methods provide straightforward ways to check your Ubuntu version, there are a few additional commands that can display this information in a more visually appealing or comprehensive manner.

Using the hostnamectl Command

The hostnamectl command is primarily used to view or modify the hostname of a system, but it also provides additional information, including the Ubuntu version you're running. To use this command, open the terminal and enter:

hostnamectl

The output will display a list of system details, including the "Operating System" field, which shows your Ubuntu version and Linux kernel version.

Displaying Ubuntu Version with screenfetch

The screenfetch script is a popular tool that displays system information, including the Ubuntu version, in the terminal alongside an ASCII logo. If you don't have screenfetch installed, you can install it using the following command:

sudo apt install screenfetch

Once installed, run the command:

screenfetch

This will display an ASCII representation of the Ubuntu logo, along with various system details, such as the Ubuntu version, kernel version, and other relevant information.

Checking Ubuntu Version with neofetch

neofetch is a modern alternative to the screenfetch script, offering a more visually appealing and customizable output. Similar to screenfetch, neofetch displays system information, including the Ubuntu version, along with an ASCII logo and a color palette.

To install neofetch, run the following command:

sudo apt install neofetch

Then, execute neofetch by entering the following in the terminal:

neofetch

The output will include an ASCII representation of the Ubuntu logo, system details (such as the Ubuntu version and kernel version), and a color palette that showcases the supported colors.

These alternative commands can be particularly useful if you prefer a more visually appealing or comprehensive output when checking your Ubuntu version. They can also serve as a fun way to display system information while showcasing ASCII art and color palettes.

Checking Ubuntu Version via Graphical User Interface

For those who prefer a more visual approach or are less comfortable with the command line, Ubuntu provides a user-friendly way to check the version through its Graphical User Interface (GUI). This method is particularly convenient for users who are new to Ubuntu or prefer a more intuitive experience.

Accessing Ubuntu Version Information in Settings

To check your Ubuntu version through the GUI, follow these simple steps:

  1. Click on the "Activities" icon located in the top-left corner of your screen (or press the "Super" key on your keyboard).
  2. In the search box that appears, type "Settings" and click on the "Settings" icon when it appears in the search results.
  3. In the "Settings" window, navigate to the "Details" tab, which is typically located in the left-hand sidebar.

Once you're in the "Details" section, you'll find the Ubuntu version number prominently displayed, along with other relevant system information, such as the operating system name and the Ubuntu codename.

This straightforward method provides a quick and easy way to check your Ubuntu version without having to navigate through terminal commands or text-based files. It's particularly useful for users who prefer a more visual and user-friendly experience.

By offering both command-line and GUI options, Ubuntu caters to a diverse range of users, ensuring that everyone can easily access and verify their Ubuntu version, regardless of their preferred interaction method or level of technical expertise.