0
0
Linux CLIscripting~15 mins

Linux distributions overview (Ubuntu, CentOS, Fedora) in Linux CLI - Mini Project: Build & Apply

Choose your learning style9 modes available
Linux distributions overview (Ubuntu, CentOS, Fedora)
📖 Scenario: You are learning about popular Linux distributions used in servers and desktops. Each distribution has its own package manager and commands to check system info.This project will help you practice basic Linux commands to identify and compare Ubuntu, CentOS, and Fedora systems.
🎯 Goal: Build a simple script that stores Linux distribution names and their package managers, then prints out the info clearly.
📋 What You'll Learn
Create a dictionary with Linux distributions and their package managers
Add a variable to hold a message prefix
Use a for loop to print each distribution and its package manager
Print the final output lines exactly as specified
💡 Why This Matters
🌍 Real World
System administrators often need to know which Linux distribution is running and which package manager to use for installing software.
💼 Career
Understanding Linux distributions and their package managers is essential for roles in IT support, DevOps, and system administration.
Progress0 / 4 steps
1
Create the Linux distributions dictionary
Create a dictionary called distros with these exact entries: 'Ubuntu': 'apt', 'CentOS': 'yum', 'Fedora': 'dnf'.
Linux CLI
Need a hint?

Use curly braces {} to create a dictionary with keys and values separated by colons.

2
Add a message prefix variable
Add a variable called message and set it to the string 'The package manager for'.
Linux CLI
Need a hint?

Assign the exact string to the variable message.

3
Loop through the dictionary to prepare output
Use a for loop with variables distro and pkg_mgr to iterate over distros.items(). Inside the loop, create a variable line that combines message, distro, and pkg_mgr in this format: ' is '.
Linux CLI
Need a hint?

Use an f-string to combine variables into the desired sentence.

4
Print the output lines
Inside the same for loop, add a print(line) statement to display each line.
Linux CLI
Need a hint?

Use print(line) inside the loop to show each message.