LPIC-1 exam format and topic weights
LPIC-1 is two separate exams, 101-500 and 102-500, both required and each scored on its own. It is also the only certification on this site whose objectives name both dpkg and rpm, which is why every page here uses two machines. This guide covers the exam structure, then shows how a script - or a candidate under time pressure - works out which package family a machine belongs to before touching anything.
Start Here Guide 1 of 33 Beginner
- PlatformsUbuntu 26.04 LTS + AlmaLinux 10.2
- TimeAbout 14 min
Exam structure and topic weights are LPI's published objectives for 101-500 and 102-500, linked below. Nothing on this page is derived from this site's practice questions - a question bank is edited, and a guide that quotes one goes quietly out of date.
- RPM packagingrpm 4.19.1.1, dnf 4.20.0
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| LPIC1-A01 | 192.168.0.76 | Ubuntu 26.04 LTS | Debian-family host - dpkg and apt, which objective 102.4 names | 2 Core | 4 GB | 50 GB |
| LPIC1-B01 | 192.168.0.77 | AlmaLinux 10.2 | RPM-family host - rpm and dnf, which objective 102.5 names | 2 Core | 4 GB | 50 GB |
This guide includes
Use this before booking either paper. This matters because LPIC-1 is two separate exams and both are required - and the login shell on these hosts is not bash, which a scripting paper punishes.
- meeting the two machines, and what each says about itself
- reading the file a script actually parses, rather than the human-facing tool
- asking which family you are on the way a portable script asks
- checking what
$SHELLreally is, before trusting anything to it
Before you start
-
The two machines, and what each says about itself
hostnamectlanswers four questions at once.bash Example session hostnamectl | grep -E 'Operating System|Kernel|Architecture|Virtualization' Virtualization: microsoft Operating System: Ubuntu 26.04 LTS Kernel: Linux 7.0.0-30-generic Architecture: x86-64hostnamectl | grep -E 'Operating System|Kernel|Architecture|Virtualization' Virtualization: microsoft Operating System: AlmaLinux 10.2 (Lavender Lion) Kernel: Linux 6.12.0-211.7.3.el10_2.x86_64 Architecture: x86-64Expected resultUbuntu 26.04 LTS on kernel 7.0.0-30-generic and AlmaLinux 10.2 on 6.12.0-211.7.3.el10_2 - both x86-64, both reporting the hypervisor they run under.
Success conditionYou can identify an unfamiliar machine in one command.
-
The file a script actually reads
hostnamectlis for humans./etc/os-releaseis for programs.bash Example session cat /etc/os-release | grep -E '^(ID|ID_LIKE|VERSION_ID|PRETTY_NAME)='PRETTY_NAME="Ubuntu 26.04 LTS"VERSION_ID="26.04"ID=ubuntuID_LIKE=debiancat /etc/os-release | grep -E '^(ID|ID_LIKE|VERSION_ID|PRETTY_NAME)='ID="almalinux"ID_LIKE="rhel centos fedora"VERSION_ID="10.2"PRETTY_NAME="AlmaLinux 10.2 (Lavender Lion)"ls /etc/*-release; echo "--- the RPM family keeps a second, older file"/etc/almalinux-release/etc/os-release/etc/redhat-release/etc/system-release--- the RPM family keeps a second, older fileExpected result
ID=ubuntuon one;ID="almalinux"withID_LIKE="rhel centos fedora"on the other - and the RPM host carrying a second, olderredhat-releasefile.Success conditionYou know which file to test in a portable script.
-
Which family am I on, the way a portable script asks
Do not parse a name. Test for the tool.
bash Example session if command -v apt-get >/dev/null; then echo "debian family"; elif command -v dnf >/dev/null; then echo "rpm family"; fidebian familyif command -v apt-get >/dev/null; then echo "debian family"; elif command -v dnf >/dev/null; then echo "rpm family"; firpm familyExpected result
debian familyfrom one host andrpm familyfrom the other, from the same line of shell.Success conditionYou can branch on package family without maintaining a list of distributions.
-
The login shell, which a scripting paper punishes
Check what
$SHELLactually is before trusting any$BASH_VERSIONexample.zsh Example session echo "SHELL=$SHELL"; echo "BASH_VERSION=${BASH_VERSION:-(empty - this is not bash)}"; bash -c 'echo "under bash -c: $BASH_VERSION"'SHELL=/usr/bin/zshBASH_VERSION=(empty - this is not bash)under bash -c: 5.3.9(1)-releaseExpected result
SHELL=/usr/bin/zsh, an emptyBASH_VERSION, and5.3.9(1)-releaseonce the same question is asked underbash -c.Success conditionYou will not be caught by a shell that is not the one you assumed.
Troubleshooting
A script works when pasted into the terminal and fails when run as a file.
Why: The login shell on these hosts is zsh, and the script's shebang decides the interpreter. Syntax that zsh accepts interactively can be invalid to whatever the shebang names.
Fix:Put
#!/bin/bashat the top and make the file executable. Confirm what you are typing into withecho $SHELLand what the script runs under withps -p $$.echo $BASH_VERSIONprints nothing, so bash looks absent.Why: The variable is only set by bash itself. An empty value means the current shell is not bash - not that bash is missing.
Fix:
bash --versionreports the installed version regardless of the login shell. On these hosts it is 5.3.9 while$SHELLis /usr/bin/zsh.A portable script takes the wrong branch on AlmaLinux, Rocky or CentOS.
Why: It matches on
IDalone, which is distribution-specific, rather than onID_LIKE.Fix:Source
/etc/os-releaseand testID_LIKEas well - AlmaLinux reportsID_LIKE="rhel centos fedora". Never parsehostnamectl, which is formatted for humans.Preparation feels endless because both papers are being revised at once.
Why: 101-500 and 102-500 are separate exams, booked and scored independently, and each has its own topic list.
Fix:Prepare and sit one at a time. Failing one does not affect the other, and the certificate arrives when both are passed.