This document provides an overview of a presentation on the basics of Linux based on the LPIC-1 certification. It discusses topics 101 and 102 from the LPIC-1 exam, including system architecture, hardware configuration, booting, runlevels, disk partitioning, installing boot managers, managing shared libraries, and using Debian and RPM package management. The presentation aims to teach basic Linux skills like command line work, user administration, backups and restores, and connecting Linux systems to networks.
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Linux Installation and Package Management Guide
1. Basis Linux
(aan de hand van LPIC-1)
Peter Martin, twitter: @pe7er
Linux User Group Nijmegen, 11 februari 2014
2. Overzicht Presentatie
● Introductie
● Topic 101:
System Architecture
● Topic 101.1–101.3
● Topic 102:
Linux Installation
and Package Management
● Topic 102.1–102.5
3. LPIC-1 – Junior Level Linux Certification
● Basisvaardigheden Linux:
● Werken op de command line
● Eenvoudige onderhoudstaken uitvoeren: gebruikers
ondersteunen, gebruikers toevoegen aan systeem,
backup & restore, shutdown & reboot
● Installeren en configureren van een werkstation (incl. X)
en aan LAN netwerk verbinden, of stand-alone PC via
modem aan het Internet.
● Distributie onafhankelijk
● Gecertificeerd door National Commission For
Certifying Agencies
5. LPIC-1 – Exam 101
● Topic 101: System Architecture
● Topic 102: Linux Installation and Package
Management
● Topic 103: GNU and Unix Commands
● Topic 104: Devices, Linux Filesystems, Filesystem
Hierarchy Standard
6. LPIC-1 – Exam 102
● Topic 105: Shells, Scripting and Data Management
● Topic 106: User Interfaces and Desktops
● Topic 107: Administrative Tasks
● Topic 108: Essential System Services
● Topic 109: Networking Fundamentals
● Topic 110: Security
7. Topic 101 + 102 van Exam 101
● Topic 101: System Architecture
● 101.1 Determine and configure hardware settings
● 101.2 Boot the system
● 101.3 Change runlevels and shutdown or reboot system
● Topic 102: Linux Installation and Package Management
● 102.1 Design hard disk layout
● 102.2 Install a boot manager
● 102.3 Manage shared libraries
● 102.4 Use Debian package management
● 102.5 Use RPM and YUM package management
10. 101.1 Determine and configure hardware settings (w-2)
Candidates should be able to determine and configure fundamental system
hardware.
●
Key Knowledge Areas:
● Enable and disable integrated peripherals.
● Configure systems with or without external peripherals such as keyboards.
● Differentiate between the various types of mass storage devices.
● Set the correct hardware ID for different devices, especially the boot device.
● Know the differences between coldplug and hotplug devices.
● Determine hardware resources for devices.
● Tools and utilities to list various hardware information (e.g. lsusb, lspci, etc.)
● Tools and utilities to manipulate USB devices
● Conceptual understanding of sysfs, udev, hald, dbus
● Terms and Utilities: /sys /proc /dev modprobe lsmod lspci lsusb
11. 101.1 Determine and configure hardware settings (w-2)
Opstarten van PC + besturingssysteem:
● BIOS – Basic Input/Output System
● Power On Self Test (POST)
● Datum/tijd
● Configuratie (boot order)
● Inladen bootroutine
● Master Boot Record (MBR)
● Inladen boot manager (Lilo/Grub)
● Inladen van kernel
● Aanmaken RAM disk voor “init”
● Inladen van allerlei software
12. 101.1 Determine and configure hardware settings (w-2)
● HAL - Hardware Abstraction Layer
(aka “hald” → HAL daemon)
● Intel® Centrino® Advanced-N 6200 → wlan0
● dbus
● D-Bus = inter-process communication (IPC) system.
Voornamelijk communicatie tussen componenten van Gnome, KDE,
XFCE
● udev
● automatic hardware discovery and initialization
● device manager voor Linux kernel
mounten van /dev/sda1 als bijv /dev/camera
13. 101.1 Determine and configure hardware settings (w-2)
● Sysfs = virtual filesystem = ~ “system filesystem”
● /sys → HAL’s database
● Procfs = proc filesystem = over “processes”
● /proc
● Device File = interface for device driver that appears
in a file system as if it were an ordinary file.
● /dev
– /dev/null
– /dev/random
14. 101.1 Determine and configure hardware settings (w-2)
ls – list files
● lsmod = list kernel modules
● lsusb = list usb devices
● lspci = list pci devices
16. 101.2 Boot the system (w-2)
Candidates should be able to guide the system
through the booting process.
● Key Knowledge Areas:
● Provide common commands to the boot loader and
options to the kernel at boot time.
● Demonstrate knowledge of the boot sequence from
BIOS to boot completion.
● Check boot events in the log files.
● Terms and Utilities: /var/log/messages dmesg BIOS
bootloader kernel init
20. 101.3 Change runlevels and shutdown or reboot system (w-3)
Candidates should be able to manage the runlevel of the system. This
objective includes changing to single user mode, shutdown or rebooting
the system.
Candidates should be able to alert users before switching run level and
properly terminate processes. This objective also includes setting the
default run level. It also includes basic feature knowledge of potential
replacements to init.
● Key Knowledge Areas:
● Set the default runlevel.
● Change between run levels including single user mode.
● Shutdown and reboot from the command line.
● Alert users before switching runlevels or other major system event.
● Properly terminate processes.
● Knowledge of basic features of systemd and Upstart
● Terms and Utilities: /etc/inittab shutdown init /etc/init.d telinit
21. 101.3 Change runlevels and shutdown or reboot system (w-3)
Runlevels – manier om systeem verschillend te gebruiken.
Runlevel bepaalt wat wel/niet wordt ingeladen
● /etc/inittab -> configuratie van runlevels & init process
● runlevels verschillen tussen distros!
● 0 – Halt
● 1 – single user mode (recovery)
● 2 – .deb default (GUI/txt)
● 3 – .rpm txt
● 4 – wildcard (kun je zelf bepalen)
● 5 – .rpm GUI
● 6 – Reboot
22. 101.3 Change runlevels and shutdown or reboot system (w-3)
● /etc/init.d/ -> scripts om services te laden
● bijv /etc/init.d/exim4
→ status / stop / start
● /etc/rc.d/ bevat folders met scripts voor runlevels
● rc.local → bij elke runlevel
● rc.sysinit → bij elke runlevel
● /etc/rc.d/rc1.d → scripts voor runlevel 1 (single user recover mode)
– Symbolic links naar scripts (Kill, Start)
● /etc/rc.d/rc2.d → scripts voor runlevel 2 (debian default)
– Symbolic links naar scripts
23. 101.3 Change runlevels and shutdown or reboot system (w-3)
● Wisselen tussen runlevels:
$ sudo init [runlevel nummer]
● telinit = init
● Shutdown / reboot
● shutdown -r now → nu reboot
● shutdown -h +5 → over 5 minuten shutdown
● shutdown -h 23:55 Some system maintenance
message
26. 102.1 Design hard disk layout (w-2)
Candidates should be able to design a disk partitioning
scheme for a Linux system.
● Key Knowledge Areas:
● Allocate filesystems and swap space to separate
partitions or disks.
● Tailor the design to the intended use of the system.
● Ensure the /boot partition conforms to the hardware
architecture requirements for booting.
● Knowledge of basic features of LVM
● Terms and Utilities: / (root) filesystem /var filesystem
/home filesystem swap space mount points partitions
27. 102.1 Design hard disk layout (w-2)
● Partitions / disks
● Filesystems
● Mount points
● mount
● /etc/fstab = file systems table, o.a. mountpoints bij startup
● SWAP space
● Superblock = meta info over filesysteem, soort “FAT”
● MBR – Master Boot Record
● LVM – logical volume manager for Linux kernel that
manages disk drives and similar mass-storage devices
→ volgens 3rd editie nog geen deel van examen
28. 102.1 Design hard disk layout (w-2)
● Opzet van Harddisk afhankelijk van:
● Grootte van diskruimte
● Grootte van het systeem
● Gebruik van systeem
● Hoe & waar backups
29. 102.1 Design hard disk layout (w-2)
●
Desktop
●
/boot/ 100MB
● swap (not mounted) swap size = 2x RAM
● Network workstation
●
/
●
/boot/
●
/home/ ->NFS, SMB, SSH. Elke gebruiker eigen /home/subfolder/
●
swap (not mounted)
● Server
●
/
● /boot/
●
/home/
●
/opt/
●
/usr/ bijv /usr/bin/apache -> zelfde versie voor alle gebruikers
●
/var/
●
swap (not mounted)
31. 102.2 Install a boot manager (w-2)
Candidates should be able to select, install and
configure a boot manager.
● Key Knowledge Areas:
● Providing alternative boot locations and backup boot
options.
● Install and configure a boot loader such as GRUB
Legacy.
● Perform basic configuration changes for GRUB 2.
● Interact with the boot loader
● Terms and Utilities: /boot/grub/menu.lst grub-install
MBR superblock
32. 102.2 Install a boot manager (w-2)
● Lilo (“Linux Loader”)
● bootloader & command
● Grub (GRand Unified Bootloader)
● /boot/grub/menu.lst (grub1)
● /boot/grub/grub.cfg (grub2)
● Grub-install
● MBR backup
● -> 1e hd bepalen
$ mount
● Bit-voor-bit copy dmv disk dump:
$ sudo dd if=/dev/sda of=/root/backup.mbr bs=512 count=1
34. 102.3 Manage shared libraries (w-1)
Candidates should be able to determine the shared
libraries that executable programs depend on and
install them when necessary.
● Key Knowledge Areas:
● Identify shared libraries
● Identify the typical locations of system libraries
● Load shared libraries
● Terms and Utilities: ldd ldconfig /etc/ld.so.conf
LD_LIBRARY_PATH
36. 102.4 Use Debian package management (w-3)
Candidates should be able to perform package
management using the Debian package tools.
● Key Knowledge Areas:
● Install, upgrade and uninstall Debian binary packages.
● Find packages containing specific files or libraries which
may or may not be installed.
● Obtain package information like version, content,
dependencies, package integrity and installation status
(whether or not the package is installed).
● Terms and Utilities: /etc/apt/sources.list dpkg dpkg-
reconfigure apt-get apt-cache aptitude
38. 102.5 Use RPM and YUM package management (w-3)
Candidates should be able to perform package
management using RPM and YUM tools.
● Key Knowledge Areas:
● Install, re-install, upgrade and remove packages using
RPM and YUM.
● Obtain information on RPM packages such as version,
status, dependencies, integrity and signatures.
● Determine what files a package provides, as well as
find which package a specific file comes from.
● Terms and Utilities: rpm rpm2cpio /etc/yum.conf
/etc/yum.repos.d/ yum yumdownloader