LPIC-1 Linux Installation and Package Management Practice Question
An administrator needs to install a package named 'nginx' on a Debian system, but the package is already installed. The administrator wants to ensure that the latest available version from the configured repository is installed, upgrading if necessary. Which command should be used?
⚠ Common exam trap
The trap here is assuming that apt-get install will skip an already installed package, when in fact it will upgrade it if a newer version is available.
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
apt-get install nginx will install the package if not present, or upgrade it to the newest version if one is available in the repositories. It automatically handles dependencies and is the standard method for ensuring a package is at the latest available version on Debian systems.
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 requires a local .deb file path, not a package name from the repository. It would look for a file named 'nginx' in the current directory and fail. dpkg does not resolve dependencies from repositories, so it is unsuitable for installing from a repository.
- ✗
apt-get reinstall nginx
Why it's wrong here
apt-get reinstall is not a valid subcommand in standard apt-get; it is available in apt (e.g., apt reinstall) but not in apt-get. Even if it were, it would reinstall the same version rather than upgrading to the latest, which is not what the administrator wants.
- ✓
apt-get install nginx
Why this is correct
apt-get install will check if nginx is already installed and, if a newer version is available in the repository, it will upgrade to that version. If no newer version exists, it reports that the package is already the newest version. This satisfies the requirement to install or upgrade as needed.
- ✗
apt-get upgrade nginx
Why it's wrong here
apt-get upgrade does not accept a package name argument; it upgrades all installed packages to their latest versions without removing or installing new packages. Using it with 'nginx' would result in an error or be ignored. It cannot target a single package for installation or upgrade.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LPIC-1 question from scratch — 402 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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.