Update Fedora Linux using terminal for latest software patches

Posted on in Categories , last updated May 22, 2018

I recently switched from Windows server to Fedora 28 server running in the cloud. How do I apply software updates and patches on Fedora 28 server using the terminal application?

Fedora Linux uses dnf command. It is the next upcoming major version of yum command. Yum is a package manager for RPM-based Linux distributions such as CentOS/RHEL 7.x and older version of Fedora Linux. You need to use the dnf command to update Fedora Linux using terminal for latest software patches.

Procedure to update Fedora Linux using terminal for latest software

Let us see all commands in details to update Fedora Linux using terminal to get latest software patches.

Step 1. Open the terminal application

Open the terminal application. At the bash shell prompt type the following command to login into remote server:
$ ssh vivek@fedora28-nixcraft-cloud

Step 2. Update Fedora Linux using the terminal dnf command

Type the following dnf command and sudo command:
sudo dnf update
How to update Fedora Linux using terminal for latest software

Step 3. Note down the Fedora Linux kernel version

Type the following command to find our the Linux kernel version:
uname -mrs
Sample outputs:

Linux 4.16.3-301.fc28.x86_64 x86_64

Step 4. Reboot the Fedora Linux box

Type the following command to reboot the Fedora Linux server/desktop:
sudo reboot
OR
sudo shutdown -r now
Sample outputs:

Connection to 192.168.122.156 closed by remote host.
Connection to 192.168.122.156 closed.

Step 5. Verify new Fedora Linux kernel

Type the following command after ssh into your Fedora Linux cloud server/desktop:
ssh vivek@fedora28-nixcraft-cloud
uname -mrs

Sample outputs:

Linux 4.16.9-300.fc28.x86_64 x86_64

Step 6. Learning more about the dnf command to update Fedora Linux software

The dnf command also acts as a package manager for Fedora Linux. You can install new software, remove existing software, update specific software, list installed patches and more. Here are some command examples:

How to install new software called htop on Fedora Linux

sudo dnf install htop

Delete/erase an existing software called htop on Fedora Linux

sudo dnf remove htop

List all installed software

sudo dnf list installed| more
To learn more about the dnf command, type the following man command or read the official docs here:
$ man dnf

Conclusion

And there you have it. I updated Fedora Linux using terminal to get latest software patches.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Share this on (or read 0 comments/add one below):

Join the discussion at www.nixcraft.com