Patching
Sytem Updates
What are System Updates?
- Updates make sure your Linux system has the latest features and security fixes. It's like updating your phone's operating system to get new features and stay safe.
Why Update?
- To protect your system from hackers.
- To fix bugs that might cause problems.
- To get the latest features and improvements.
How to Update Your System:
-
For Ubuntu/Debian systems:
- Check for updates:
sudo apt update
- Install updates:
sudo apt upgrade
-
For Fedora/Red Hat systems:
-
Check and install updates:
sudo dnf upgrade
- Check for updates:
Package Management
What is Package Management?
- Package management involves installing, updating, and removing software packages. Think of it as managing apps on your phone.
Why Manage Packages?
- To install new software or apps you need.
- To remove software you don't use anymore.
- To keep your software up to date with the latest versions.
How to Manage Packages:
-
Installing a new package:
- Ubuntu/Debian:
sudo apt install packageName
- Fedora/Red Hat:
sudo dnf install packageName
-
Removing a package:
-
Ubuntu/Debian:
sudo apt remove packageName
- Fedora/Red Hat:
sudo dnf remove packageName
-
Searching for a package:
-
Ubuntu/Debian:
apt search packageName
- Fedora/Red Hat:
dnf search packageName
- Ubuntu/Debian:
Example: Setting Up a Web Server
- Objective: Install Apache web server on your Linux system.
- Steps:
- Update your system using the update commands mentioned above.
- Install Apache:
- Ubuntu/Debian:
sudo apt install apache2
- Fedora/Red Hat:
sudo dnf install httpd
- Ubuntu/Debian:
- Check if Apache is running:
sudo systemctl status apache2
orhttpd
depending on your system.
Assignments
- Install a Software: Choose any software, install it using your system's package manager, and then use it.
- Remove the Software: After trying the software, remove it from your system using the package manager.
Interview Questions
- What command would you use to update all packages on a Ubuntu system?
- How do you install a package using DNF?
- What's the difference between
apt
andapt-get
? - How can you list all installed packages on your Linux system?