LPIC-1 Linux Installation and Package Management Practice Question
Which TWO directories are commonly used to store source code before compiling? (Choose two.)
⚠ Common exam trap
A common mix-up: candidates confuse /usr/src with /var/src (which does not exist in the FHS) or assume /tmp is appropriate for source code, overlooking the FHS's explicit design for persistent source storage in /usr/src and /usr/local/src.
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
✓
/usr/src
In Linux, source code for compiling software is conventionally stored in /usr/src (for kernel sources or distribution-provided source packages) and /usr/local/src (for locally compiled software not managed by the package manager). These directories follow the Filesystem Hierarchy Standard (FHS), which designates /usr/src for system-wide source and /usr/local/src for locally installed source code.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
/tmp
Why it's wrong here
/tmp is temporary and not suitable for source storage.
- ✗
/var/src
Why it's wrong here
/var/src is not a standard source directory.
- ✓
/usr/src
Why this is correct
Standard source directory.
- ✓
/usr/local/src
Why this is correct
Common for locally compiled source.
- ✗
/opt
Why it's wrong here
/opt is for add-on software packages, not source code.
Go deeper
Related to this question
About these practice questions
This LPIC-1 question is part of Courseiva's 527-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 by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.