Linux find version ubuntu

SOLVED: Check Ubuntu Version the RIGHT WAY

If you are an Ubuntu user, there is a high probability you have come across an error, and you went online to find a solution from the various tech forums. Unfortunately, some solutions won’t work since you use a different version/ release of Ubuntu from the one mentioned in the solution. There are also situations where you want to install an application, but you get an error like, «Repository does not have a release file.» Therefore, knowing the Ubuntu release running on your Computer is quite essential.

To better understand these differences in Ubuntu versions, we need to discuss the Ubuntu release cycle before you can check Ubuntu version.

Ubuntu Release Cycle

Ubuntu is made available to users through the Long Term Support release (LTS) and Interim releases. As the name suggests, Long Term Releases or commonly referred to by the abbreviation LTS is the Ubuntu version supported for the longest time. That is always up to five years for standard support and ten years for Enterprise-grade support. LTS releases are published after every two years in April. As of writing this post, the most popular Ubuntu LTS releases are Ubuntu 180.4 and Ubuntu 20.04.

On the other hand, Interim releases are published every six months LTS releases and are only supported for nine months. As of writing this post, the latest interim release is Ubuntu 21.10 that uses the code name Impish Indri.

This post will give you a detailed guide on checking the Ubuntu version running on your system. There are two ways which we can use to achieve this:

If you are a command-line person, then you have more than enough methods which you can use to check the version of Ubuntu running on your system. All you need is to run a simple command, and you are good to go.

Method-1: Use the lsb_release -a Command

The lsb_release command which is present in all Linux systems shows the Linux Standard Base (LSB) information about the current Linux distribution running on your system. That includes the codename and version number. Follow the steps below.

Launch the Terminal from the applications menu or use the keyboard shortcut (Ctrl + Alt + T)

Читайте также:  Find hidden file on linux

SOLVED: Check Ubuntu Version the RIGHT WAY

Type the command «lsb_release -a» into the command line and press enter.

From the image above, you will get information like Distributor ID, Description, Release version, and the release code name.

Method-2: Read the Contents of /etc/lsb-release File

This method is not very different from the lsb_release -a command. Instead of using the -a parameter, we will just read the contents inside the lsb_release file present in the /etc directory using the cat command. Follow the steps below.

Launch the terminal from the applications menu or use the keyboard shortcut [Ctrl] + [Alt] + [T].

SOLVED: Check Ubuntu Version the RIGHT WAY

Type the command cat /etc/lsb-release into the command line and press Enter.

From the image above, you can see the terminal displays the Ubuntu version you’re running under DISTRIB_RELEASE and DISTRIB_DESCRIPTION parameters.

Method-3: Read the Contents of the /etc/os-release File

Before we dive in on how to use this method, let’s discuss the files lsb_release and os_release in detail since they are somewhat similar.

The /etc/lsb-release file is found in most (but not all) Linux distributions intended for use by older programs. The LSB which stands for Linux Base Standards is a project that defines rules and standards Linux distros should follow. However, not all Linux systems include these file.

On the other hand, the /etc/os-release file is that standard set and you will find it in almost all Linux distributions. Additionally, any Systemd-based distribution like Ubuntu, RHEL, CentOS, Gentoo, etc is required to have it by default. Therefore, if the lsb-release command above didn’t work for you, you should try using the os-release . Follow the steps below.

Display the contents of the /etc/os-release file using the cat command as shown below.

SOLVED: Check Ubuntu Version the RIGHT WAY

From the image above, you can view the version of Ubuntu running on your system next to the VERSION_ID parameter.

Method-4: Read the Contents of the /etc/issue File

The /etc/issue file is a standard file across all distributions which contains a message to be displayed before the logging prompt.

Open the terminal using “Show Applications” or with the keyboard shortcut [Ctrl] + [Alt] + [T].

Type the command » cat /etc/issue » into the command line and press enter.

SOLVED: Check Ubuntu Version the RIGHT WAY

Method-5: Check Ubuntu Version with hostnamectl Command

Another command that also gives you information about the Ubuntu version is the hostnamectl command. Run the command as shown below.

SOLVED: Check Ubuntu Version the RIGHT WAY

Method-6: View the Ubuntu version via GUI

In the case you don’t like to use the command line, there’s always a way to view the Ubuntu version via GUI. This will be different depending on the desktop environment you’re using. In the GNOME desktop environment on Ubuntu, the available information is found in the Settings > About section.

SOLVED: Check Ubuntu Version the RIGHT WAY

Conclusion

Ubuntu offers many ways for us to check the version of the operating system. Knowing which version of Ubuntu you’re on, and what type of release it is – either long term support or interim – will help you determine several things like when to update, which software to install, and much more. We recommend keeping your Ubuntu system up-to-date, especially with the latest LTS releases. However, if you love living on the bleeding edge, you can also check out the interim releases which come with the latest features.

Читайте также:  Переменная shell в linux

Didn’t find what you were looking for? Perform a quick search across GoLinuxCloud

If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.

Buy GoLinuxCloud a Coffee

For any other feedbacks or questions you can either use the comments section or contact me form.

Thank You for your support!!

Источник

Linux find version ubuntu

How to check Debian version: the quick and easy way

How to check Debian version: the quick and easy way

Knowing which Debian version you have not only helps you to choose the right install package for a program – you also need it to get appropriate support in forums. There are several different methods to check your Debian version. In this step-by-step guide, we’ll explain how to check your version using Terminal and Hardinfo.

How to check your Ubuntu version: a guide

How to check your Ubuntu version: a guide

Knowing which Ubuntu version you’re running is helpful for different things. You can use this information to check whether programs are compatible with your system. Or you can include the version number in troubleshooting searches. It’s thus of crucial importance to know how to check your Ubuntu version. Keep reading to find out how to do so in a few simple clicks.

How to delete a Linux directory

How to delete a Linux directory

Sometimes you may need to delete an entire folder rather than just individual files. If you want to remove a Linux directory, there are several ways to do it. Here are a few basic solutions that use either File Manager or Terminal. We also explain what you can do if you don’t have the necessary rights.

How to delete files in Linux

How to delete files in Linux

Deleting files in Linux couldn’t be easier. Whether you use the file manager or work directly in the terminal with the command “rm”, you can remove Linux files in just a few clicks. Keep reading to find out how to remove single files, multiple files, files of a certain type, or entire folders.

How to use the Linux find command

How to use the Linux find command

While working on a Linux system the command line is frequently used. Many administrative tasks require you to find files and directories based on specific criteria. In doing so, Linux admins are accustomed to using the find command. Here, we’ll show you how the command works and how to use it as a handy tool.

Источник

How to Check Ubuntu Version in Command Line

Illustration of checking Ubuntu version details

Knowing your Ubuntu version is helpful in several situations. If you are adding an external repository for additional packages or if you want to know whether a certain program version is available for your Ubuntu install or not. Or, if you simply seeking help in Linux forums and you need to provide the information on your Ubuntu version.

Whatever may be the reason, it’s always good to know the basic information about the system you are using.

Читайте также:  Линукс операционная система установка виндовс

How to check Ubuntu version?

The easiest way to check the Ubuntu version is to use the following command in the terminal:

This gives all the necessary distributions specific information.

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

You can see the Ubuntu version in the Description or Release line. As you can see in the output above, I am using Ubuntu version 22.04 which is codenamed ‘jammy’.

This codename is also useful, especially when you are adding an external repository that needs the codename of the Ubuntu release.

Checking Ubuntu version using ls_release -a command

Now that you know how to show Ubuntu version in CLI, let me share a handy tip.

Check how long your system is supported

The LTS in the description means that this is a long-term support (LTS) release. The LTS release is supported for five years from its release. You can see how long your current Ubuntu system will be supported with the following command:

Checking Ubuntu support status in command line

As you can see in the screenshot above, my Ubuntu system is supported till April 2027 (4/2027).

Get only the Ubuntu version or release name

The command lsb_release -a gives you 5 lines of output in two columns.

It’s not convenient to use this information in a script or command. The good thing here is that you don’t need to do any ninja stuff to format the output with grep and cut command. There is a shorter version to give you the exact necessary detail.

To get just the Ubuntu version number, combine the s (short) and d (description) options:

Similarly, to get just the Ubuntu codename, combine the s and c (codename) options:

You can see the outputs in the screenshot below:

Get only the version number and codename of Ubuntu releases

This is more appropriate to be used in the scripts, right?

Other ways to check Ubuntu version

While lsb_release -a is my preferred way to get the Ubuntu version details; it’s not the only way. There are other commands that provide you with this information.

You can use the hostnamectl command:

You can see the Ubuntu version detail in the output but no codename:

Static hostname: learnubuntu Icon name: computer-vm Chassis: vm Machine ID: c022d7fa917ec36bb318f777628c6940 Boot ID: a2fe9f564a424550bf5db043ce94bdce Virtualization: kvm Operating System: Ubuntu 22.04 LTS Kernel: Linux 5.15.0-25-generic Architecture: x86-64 Hardware Vendor: DigitalOcean Hardware Model: Droplet 

You get additional details such as whether it’s a physical or virtual system, kernel version, and CPU architecture. From the output, you can surmise that I am using a VM on DigitalOcean.

Another way to get the Ubuntu version detail is to read the content of file /etc/os-release:

This gives plenty of information in addition to the codename and version name:

PRETTY_NAME="Ubuntu 22.04 LTS" NAME="Ubuntu" VERSION_ID="22.04" VERSION="22.04 (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 

So, you learned various ways to find the version of Ubuntu installed on your system. The command-line methods work everywhere, be it Ubuntu running in WSL or AWS.

Let me know if you have any questions.

Источник

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