How do I find out what version of Linux I am running?

You might be managing one server or hundreds of servers. One task that always comes up is to verify what version of Linux you are currently running. The easiest and quickest way I have found to check this is below.

  1. Open up SSH session or a terminal session.
  2. Run following command to determine the version you are on.
lsb_release -d

3. Example Output.

4. In this example you can see that we are running Ubuntu version 19.10.

How do you upgrade Debian 9 Stretch to Debian 10 Buster?

One of the tasks you might be trying to complete is upgrading Debian 9 to Debian 10. There are still several data centers that are only offering Debian 9 as an option. Below are the following commands to upgrade the Linux operating system.

1. Open ans SSH session to the server or command terminal.
2. Log into the server.
3. Use SU to become root if you are not already a root user.
(We are using root as the example user, this could be any user that has su permissions)

su root

4. Update and upgrade all packages for Debian 9 Stretch. To do this run the the below two commands.

apt update
apt upgrade

5. Reboot the system.

shutdown -r now

6. Open SSH session to the server or command terminal. Switch user to root by following step 3 again.
7. Update repo from Debian 9 Stretch to Debian 10 Buster

sed -i 's/stretch/buster/g' /etc/apt/sources.list

8. Update system to flush out the old ache and load the existing cache that was updated in step 7.

apt update

9. Upgrade Debian 9 Stretch to Debian 10 Buster.

apt upgrade

10. During the upgrade process you will be asked if you are you want to restart services during the upgrade without asking. You can select YES so the upgrade can be completed.

Example of what the upgrade process looks like after selecting yes.

11. When the upgrade is complete run the following command to clean up anything that might have been missed during the first upgrade process.

apt dist-upgrade

12. Remove old packages to insure you have a clean system after the upgrade.

apt autoremove

13. Reboot the system (otptional).

shutdown -r now

14. Check to insure the version is Debian 10 Buster. Open SSH terminal or terminal window and run the following command.

lsb_release -d

How do you find your IP address on Linux?

There are several different methods you can use to find your IP address on the Linux operating system. I find the below method the quickest and easiest method.

Steps
1. Open a SSH session to the server or open up a terminal window.
2. Enter the below command.

ip address

Sample Output

192.168.1.172 is the IP address of the server in this example.

Additional Information

You can also use the short version of the command which is listed below.

ip a

How do you find the kernel version on Linux?

One of the big questions you might have when running Linux is what server version am I running. One of the quickest way is to use the uname command.

Steps
1. Open a SSH Session to the server or open a terminal.
2. Enter the below command.

         uname -r

Sample Output

5.3.0-29-generic

Per the output of the command it shows that you are running kernel version 5.3.0-29-generic or in general terms 5.3

  • 5: Kernel Version
  • 3: Major Revision
  • 0: Minor Revision
  • 29: Patch Level
  • Generic: Linux Kernel Type

Additional Information

You can find the latest information and releases at Kernal.org
https://www.kernel.org/