Bird
Raised Fist0
Linux CLIscripting~20 mins

Linux distributions overview (Ubuntu, CentOS, Fedora) in Linux CLI - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Linux Distributions Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
Identify the package manager output
You run the command sudo apt update on a Linux system. Which distribution are you most likely using?
ACentOS
BUbuntu
CFedora
DArch Linux
Attempts:
2 left
💡 Hint
Think about which distributions use apt as their package manager.
💻 Command Output
intermediate
1:30remaining
Determine the output of a release info command
What is the expected output of the command cat /etc/centos-release on a CentOS system?
ACentOS Linux release 7.9.2009 (Core)
BUbuntu 20.04.4 LTS
CFedora release 38 (Thirty Eight)
DDebian GNU/Linux 11 (bullseye)
Attempts:
2 left
💡 Hint
This file contains the distribution name and version for CentOS.
📝 Syntax
advanced
2:00remaining
Correct command to install a package on Fedora
Which command correctly installs the package htop on Fedora?
Asudo dnf install htop
Bsudo apt install htop
Csudo yum install htop
Dsudo pacman -S htop
Attempts:
2 left
💡 Hint
Fedora uses a modern package manager replacing yum.
🚀 Application
advanced
1:30remaining
Choose the correct command to check the kernel version on Ubuntu
You want to check the Linux kernel version on an Ubuntu system. Which command will give you the correct output?
Aapt-get kernel-version
Bcat /etc/fedora-release
Cuname -r
Drpm -q kernel
Attempts:
2 left
💡 Hint
The kernel version is shown by a system command, not a package manager.
🧠 Conceptual
expert
2:30remaining
Identify the main difference between CentOS and Fedora
What is the primary difference between CentOS and Fedora in terms of their release and support model?
ACentOS is based on Debian; Fedora is based on Arch Linux
BCentOS uses <code>apt</code> package manager; Fedora uses <code>yum</code>
CCentOS is community-driven; Fedora is commercially supported by Red Hat
DCentOS is a stable, long-term support distribution; Fedora is a cutting-edge, short lifecycle distribution
Attempts:
2 left
💡 Hint
Think about how often each distribution releases new versions and their target users.

Practice

(1/5)
1. Which Linux distribution is known for being beginner-friendly and suitable for general use?
easy
A. Ubuntu
B. CentOS
C. Fedora
D. Arch Linux

Solution

  1. Step 1: Understand beginner-friendly distributions

    Ubuntu is widely recognized for its ease of use and beginner-friendly interface.
  2. Step 2: Compare with other distributions

    CentOS is more server-focused and Fedora targets advanced users, so they are less beginner-friendly.
  3. Final Answer:

    Ubuntu -> Option A
  4. Quick Check:

    Beginner-friendly = Ubuntu [OK]
Hint: Ubuntu = beginner-friendly, CentOS = servers, Fedora = advanced [OK]
Common Mistakes:
  • Confusing CentOS as beginner-friendly
  • Thinking Fedora is for beginners
  • Choosing Arch Linux which is advanced
2. Which command correctly installs a package on CentOS using the default package manager?
easy
A. apt-get install httpd
B. pacman -S httpd
C. dnf install httpd
D. yum install httpd

Solution

  1. Step 1: Identify CentOS package manager

    CentOS traditionally uses yum as its package manager.
  2. Step 2: Check command syntax

    yum install httpd is the correct syntax to install the Apache web server on CentOS.
  3. Final Answer:

    yum install httpd -> Option D
  4. Quick Check:

    CentOS uses yum = yum install [OK]
Hint: CentOS uses yum, Ubuntu uses apt, Fedora uses dnf [OK]
Common Mistakes:
  • Using apt-get on CentOS
  • Using pacman which is for Arch Linux
  • Confusing dnf as default on CentOS
3. What will be the output of the command cat /etc/os-release | grep '^ID=' on a Fedora system?
medium
A. ID=fedora
B. ID=centos
C. ID=ubuntu
D. ID=debian

Solution

  1. Step 1: Understand /etc/os-release file

    This file contains identification info about the Linux distribution, including the ID field.
  2. Step 2: Recognize Fedora's ID value

    Fedora's ID in this file is fedora, so the grep command outputs ID=fedora.
  3. Final Answer:

    ID=fedora -> Option A
  4. Quick Check:

    Fedora ID = fedora [OK]
Hint: Fedora's ID in os-release is 'fedora' [OK]
Common Mistakes:
  • Assuming ID=ubuntu on Fedora
  • Confusing CentOS and Fedora IDs
  • Not using grep correctly
4. You try to update packages on Fedora using yum update but get an error. What is the likely cause?
medium
A. CentOS commands work on Fedora without changes
B. You need to run 'apt-get update' instead
C. Fedora uses 'dnf' instead of 'yum' for package management
D. You must use 'pacman' on Fedora

Solution

  1. Step 1: Identify Fedora's package manager

    Fedora uses dnf as its default package manager, replacing yum.
  2. Step 2: Understand error cause

    Using yum update on Fedora may fail because yum is deprecated or not installed by default.
  3. Final Answer:

    Fedora uses 'dnf' instead of 'yum' for package management -> Option C
  4. Quick Check:

    Fedora package manager = dnf [OK]
Hint: Fedora uses dnf, not yum, for updates [OK]
Common Mistakes:
  • Trying apt-get on Fedora
  • Assuming CentOS commands always work
  • Using pacman which is Arch Linux's manager
5. You want to set up a stable web server environment with long-term support and minimal updates. Which Linux distribution should you choose?
hard
A. Ubuntu
B. CentOS
C. Fedora
D. Debian Testing

Solution

  1. Step 1: Understand stability and support needs

    Stable web servers require long-term support and minimal frequent updates to avoid disruptions.
  2. Step 2: Match distribution to requirements

    CentOS is known for its stability and long-term support, making it ideal for servers.
  3. Step 3: Compare other options

    Fedora is cutting-edge and updates often; Ubuntu is user-friendly but less stable long-term; Debian Testing is unstable.
  4. Final Answer:

    CentOS -> Option B
  5. Quick Check:

    Stable server = CentOS [OK]
Hint: Choose CentOS for stable, long-term server setups [OK]
Common Mistakes:
  • Choosing Fedora for stability
  • Assuming Ubuntu is best for servers
  • Picking Debian Testing for production
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard