Bird
Raised Fist0
Jenkinsdevops~10 mins

Installing on Linux in Jenkins - Interactive Practice

Choose your learning style10 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to update package lists on a Debian-based Linux system.

Jenkins
sudo apt-get [1]
Drag options to blanks, or click blank then click option'
Aupgrade
Binstall
Cupdate
Dremove
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'install' instead of 'update' which tries to install a package.
Using 'upgrade' which upgrades packages but does not update the list.
2fill in blank
medium

Complete the command to install Jenkins on a Debian-based Linux system.

Jenkins
sudo apt-get [1] jenkins
Drag options to blanks, or click blank then click option'
Aremove
Bpurge
Cupdate
Dinstall
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'update' which only refreshes package lists.
Using 'remove' which deletes packages.
3fill in blank
hard

Fix the error in the command to start the Jenkins service on Linux.

Jenkins
sudo systemctl [1] jenkins
Drag options to blanks, or click blank then click option'
Astart
Bstop
Cdisable
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'stop' which halts the service.
Using 'status' which only shows the current state.
4fill in blank
hard

Fill both blanks to add the Jenkins repository and import its key on Debian-based Linux.

Jenkins
wget -q -O - [1] | sudo apt-key [2] -
Drag options to blanks, or click blank then click option'
Ahttps://pkg.jenkins.io/debian-stable/jenkins.io.key
Badd
Cremove
Dhttps://jenkins.io/debian/jenkins.key
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong URL for the key.
Using 'remove' instead of 'add' for the apt-key command.
5fill in blank
hard

Fill all three blanks to create a Jenkins systemd service file with correct ExecStart and User.

Jenkins
[Service]
ExecStart=[1]
User=[2]
Restart=[3]
Drag options to blanks, or click blank then click option'
A/usr/bin/java -jar /usr/share/jenkins/jenkins.war
Bjenkins
Calways
Droot
Attempts:
3 left
💡 Hint
Common Mistakes
Running Jenkins as root user which is unsafe.
Using wrong ExecStart command that does not launch Jenkins.
Not setting Restart to 'always' to keep Jenkins running.

Practice

(1/5)
1. What is the first step before installing Jenkins on a Linux system?
easy
A. Create a Jenkins user account manually
B. Start the Jenkins service immediately
C. Add Jenkins repository key without installing Java
D. Install Java (OpenJDK) because Jenkins requires it to run

Solution

  1. Step 1: Understand Jenkins prerequisites

    Jenkins requires Java to run, so Java must be installed first.
  2. Step 2: Confirm prerequisite installation order

    Installing Java first ensures Jenkins can run properly after installation.
  3. Final Answer:

    Install Java (OpenJDK) because Jenkins requires it to run -> Option D
  4. Quick Check:

    Java installation is the first step [OK]
Hint: Always install Java before Jenkins on Linux [OK]
Common Mistakes:
  • Trying to start Jenkins before Java is installed
  • Skipping Java installation
  • Adding repository key before Java
2. Which command correctly adds the Jenkins repository key on a Debian-based Linux system?
easy
A. curl https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-get update
B. sudo rpm --import https://pkg.jenkins.io/debian-stable/jenkins.io.key
C. wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
D. sudo apt-get install jenkins-key

Solution

  1. Step 1: Identify the correct key import command for Debian

    Debian uses apt-key to add repository keys, and wget with pipe is common.
  2. Step 2: Verify command syntax

    The command uses wget to download the key and pipes it to apt-key add, which is correct.
  3. Final Answer:

    wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add - -> Option C
  4. Quick Check:

    apt-key add with wget is correct for Debian [OK]
Hint: Use wget and apt-key to add Jenkins key on Debian [OK]
Common Mistakes:
  • Using rpm commands on Debian
  • Trying to install a non-existent package 'jenkins-key'
  • Using curl without proper piping
3. After adding the Jenkins repository and updating package lists, what is the output of the command sudo systemctl status jenkins immediately after installation but before starting Jenkins?
medium
A. Active: active (running)
B. Active: inactive (dead)
C. Active: failed
D. Unit jenkins.service could not be found

Solution

  1. Step 1: Understand Jenkins service state after installation

    Installing Jenkins does not start the service automatically; it remains inactive.
  2. Step 2: Interpret systemctl status output

    Since Jenkins is not started yet, status shows inactive (dead), not running or failed.
  3. Final Answer:

    Active: inactive (dead) -> Option B
  4. Quick Check:

    Service inactive before start command [OK]
Hint: Service is inactive until explicitly started [OK]
Common Mistakes:
  • Assuming service auto-starts after install
  • Confusing 'failed' with 'inactive'
  • Expecting 'unit not found' after install
4. You installed Jenkins on Linux but the command sudo systemctl start jenkins fails with 'Failed to start jenkins.service: Unit not found.' What is the most likely cause?
medium
A. Jenkins package was not installed properly or repository not added
B. Java is not installed on the system
C. Firewall is blocking Jenkins port 8080
D. You need to reboot the system before starting Jenkins

Solution

  1. Step 1: Analyze the error message

    'Unit not found' means systemd cannot find the Jenkins service file, likely missing installation.
  2. Step 2: Identify common causes

    Missing or incorrect repository setup or failed package install causes service file absence.
  3. Final Answer:

    Jenkins package was not installed properly or repository not added -> Option A
  4. Quick Check:

    Missing service file means Jenkins not installed correctly [OK]
Hint: Check Jenkins package and repo if service unit missing [OK]
Common Mistakes:
  • Blaming firewall for service start failure
  • Assuming Java missing causes 'unit not found'
  • Thinking reboot fixes missing service unit
5. You want to install Jenkins on a Linux server and ensure it starts automatically on boot. Which sequence of commands correctly achieves this?
hard
A. sudo apt install openjdk-11-jdk; add Jenkins repo and key; sudo apt update; sudo apt install jenkins; sudo systemctl enable jenkins; sudo systemctl start jenkins
B. sudo apt install jenkins; sudo systemctl start jenkins; sudo apt install openjdk-11-jdk; sudo systemctl enable jenkins
C. sudo systemctl start jenkins; sudo apt install openjdk-11-jdk; sudo apt install jenkins; sudo systemctl enable jenkins
D. sudo apt update; sudo apt install jenkins; sudo systemctl enable jenkins; sudo systemctl start jenkins

Solution

  1. Step 1: Install Java before Jenkins

    Jenkins requires Java, so install OpenJDK first to avoid runtime errors.
  2. Step 2: Add Jenkins repository and key, update package list, then install Jenkins

    Adding repo and key ensures latest Jenkins version is installed properly.
  3. Step 3: Enable Jenkins service to start on boot and start it now

    Enabling service ensures Jenkins auto-starts on reboot; starting it activates Jenkins immediately.
  4. Final Answer:

    sudo apt install openjdk-11-jdk; add Jenkins repo and key; sudo apt update; sudo apt install jenkins; sudo systemctl enable jenkins; sudo systemctl start jenkins -> Option A
  5. Quick Check:

    Correct install order and enable/start commands [OK]
Hint: Install Java first, then Jenkins, enable and start service [OK]
Common Mistakes:
  • Installing Jenkins before Java
  • Skipping repository setup
  • Not enabling service for auto-start
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