Problem Statement
How do you update all system packages safely in Linux?
Explanation
On Debian systems, use apt update to refresh the package index, then apt upgrade to install new versions.
On RHEL or CentOS, use yum update. Always run updates with sudo to apply them system-wide.
Code Solution
SolutionRead Only
sudo apt update && sudo apt upgrade -y
Practice Sets
This question appears in the following practice sets: