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. This page explains how to update a Fedora Linux using the terminal.
|Est. reading time||2m and your Internet connection speed|
Updating Fedora using the terminal go get 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 and then at the bash 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 upgrade
The dnf update command will also work. However, it deprecated the alias for the upgrade command. Therefore, I suggest you use the dnf upgrade only.
Step 3. Note down the Fedora Linux kernel version
Type the following command to find our the Linux kernel version:
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 shutdown -r now
Connection to 192.168.122.156 closed by remote host. Connection to 192.168.122.156 closed.
After reboot, make sure all services are running on your server. For instance, is Nginx running?
ps aux | grep nginx
Do check for log files for errors using a combination of egrep command
dmesg | egrep -i 'error|critical|warn|failed'
Make sure you look into other log files stored in /var/log/ directory too. For instance, one can use the tail command and journalctl command/systemctl command:
tail -f /var/log/nginx/error.log
systemctl status nginx
journalctl -u nginx
Daily backups are essential to avoid accidental damage or recovery from a lousy software update or disk failure. Hence I suggest that you make a backup. Verify it too.
What to do if Nginx or PHP upgrade causing a problem with my App? Can I rollback updates?
Fedora keeps track of all dnf commands. Here is how to view history:
sudo dnf history
sudo dnf history list
sudo dnf history info
For instance look for nginx install or update as follows:
sudo dnf history list | grep nginx
Note down the ID number. Say it is 304 for nginx update. Then, you need to type the following command to rollback or undo that update:
sudo dnf history undo 304
See “CentOS/RHEL Use yum Command To Downgrade or Rollback Updates” for more info.
Step 5. Verify new Fedora Linux kernel
Type the following command after ssh into your Fedora Linux cloud server/desktop:
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 documentation:
$ man dnf
And there you have it. You just updated Fedora Linux using terminal to get latest software patches. Keeping your software up to date is an essential task to avoid security problems. Hence, regularly run the ‘sudo dnf upgrade‘ command.
🐧 1 comment so far... add one ↓
|Category||List of Unix and Linux commands|
|Disk space analyzers||ncdu • pydf|
|Firewall||Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04|
|Network Utilities||NetHogs • dig • host • ip • nmap|
|OpenVPN||CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04|
|Package Manager||apk • apt|
|Processes Management||bg • chroot • cron • disown • fg • jobs • killall • kill • pidof • pstree • pwdx • time|
|Searching||grep • whereis • which|
|User Information||groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w|
|WireGuard VPN||Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04|