LPIC-1 Linux Installation and Package Management Practice Question
A junior administrator needs to install the package 'nginx' on an Ubuntu 22.04 server. They want to ensure all required dependencies are automatically resolved and installed. Which command should they use?
⚠ Common exam trap
Many exam-takers confuse apt-get with dpkg; dpkg installs local .deb files but does not handle dependencies, while apt-get does.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
apt-get install nginx
The correct answer is apt-get install nginx. On Ubuntu, apt-get is the high-level package manager that downloads packages from repositories and resolves dependencies automatically. It ensures nginx and all required libraries are installed and configured properly.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
dpkg -i nginx
Why it's wrong here
dpkg -i installs a local .deb file but does not resolve dependencies. If nginx depends on other packages, the installation will fail or leave nginx unconfigured. This command is used for manual package files, not for installing from repositories with automatic dependency handling.
- ✓
apt-get install nginx
Why this is correct
The apt-get install command automatically resolves and installs dependencies from configured repositories. On Ubuntu, apt-get is the standard tool for package installation and will download and install nginx along with any required libraries, handling dependency resolution without manual intervention.
- ✗
yum install nginx
Why it's wrong here
yum is a package manager for RPM-based distributions such as CentOS and RHEL. It is not available by default on Ubuntu and cannot manage .deb packages. Using yum on Ubuntu would fail because the underlying package management system is different.
- ✗
rpm -ivh nginx
Why it's wrong here
rpm is the RPM Package Manager used on Red Hat-based systems like CentOS or Fedora. Ubuntu uses Debian packages (.deb) and the dpkg/apt ecosystem. Running rpm on Ubuntu would not work because the package format and database are incompatible.
Visual reference
Go deeper
Related to this question
About these practice questions
This LPIC-1 question is part of Courseiva's 402-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official LPI exam blueprint
This LPIC-1 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-1 exam.