Topic 102 Linux Installation & Package Management · 1.102.1 Design hard disk layout Description: Candidates should be able to design a disk partitioning scheme for a Linux system. This objective includes allocating filesystems or swap space to separate partitions or disks, and tailoring the design to the intended use of the system. It also includes placing /boot on a partition that conforms with the BIOS' requirements for booting. Key files, terms, and utilities include: / (root) filesystem /var filesystem /home filesystem swap space mount points partitions cylinder 1024 !! 分區策略 linux至少需要2個分區 / 與 swap /boot 要在1024磁區(8G)之前 /分區越小越好 swap分區要比實體記憶體大 [整理中] · 1.102.2 Install a boot manager Description:Candidate should be able to select, install, and configure a boot manager. This objective includes providing alternative boot locations and backup boot options (for example, using a boot floppy). Key files, terms, utilities: /etc/lilo.conf /boot/grub/grub.conf lilo 安裝lilo lilo -u /dev/hda lilo -U /dev/hda DOS: fdisk/MBR 刪除lilo grub-install 安裝grub MBR superblock first stage boot loader lilo -C 選擇/etc/lilo.conf之外的配置文件 lilo -q 察看當前的配置 引導時按[tab]或[?]顯示?動功能表\r 輸入Linux single進入單用戶模式 /sbin/lilo /etc/lilo.conf /boot/grub/grub.conf(menu.lst) 選擇map文件 -m mapfile map=mapfile ?動分區 -b bootdev boot=bootdev root(hd0,0) 超時時間 -d dsec timeout=dsec timeout=dsec 顯示選單 [tab] prompt 默認選項 -D label default=label default=1 kernel image=/boot/vmlinuz kernel /vmlinuz initrd=/boot/initrd.img initrd /initrd.img 顯示名 label linux title linux lba -L lba32 lilo配置修改後要運行/sbin/lilo grub不需要 lilo密碼?明文 grub用md5加密 grub根目錄?/boot lilo有1024限制 · 1.102.3 Make and install programs from source Description: Candidates should be able to build and install an executable program from source. This objective includes being able to unpack a file of sources. Candidates should be able to make simple customizations to the Makefile, for example changing paths or adding extra include directories. Key files, terms, and utilities include: gunzip = gzip -d gcat = gzip -c gzip *.gz bzip2 *.bz2 bunzip2 = bzip2 -c tar -r --append -c --create -t --list -u --update -x --extract -C --directory -j --bzip -Z --compress -z --gzip --use-compress-program configure make 軟體的安裝方法 tar xzvf xxx.tar ./configure --prefix make make install · 1.102.4 Manage shared libraries Description: Candidates should be able to determine the shared libraries that executable programs depend on and install them when necessary. Candidates should be able to state where system libraries are kept. Key files, terms, and utilities include: ldd 顯示命令的共用庫 ldconfig 建立資料庫 /etc/ld.so.conf 資料庫config /etc/ld.so.cache 資料庫cache LD_LIBRARY_PATH · 1.102.5 Use Debian package management Description: Candidates should be able to perform Debian package management.This objective includes being able to use command-line and interactive tools to install, upgrade, or uninstall packages, as well as find packages containing specific files or software (such packages might or might not be installed). This objective also includes being able to obtain package information like version, content, dependencies, package integrity and installation status (whether or not the package is installed). Key files, terms, and utilities include: unpack configure /etc/dpkg/dpkg.cfg /var/lib/dpkg/* /etc/apt/apt.conf /etc/apt/sources.list dpkg dselect dpkg-reconfigure apt-get alien · 1.102.6 Use Red Hat Package Manager (RPM) Description: Candidates should be able to perform package management under Linux distributions that use RPMs for package distribution. This objective includes being able to install, re-install, upgrade, and remove packages, as well as obtain status and version information on packages. This objective also includes obtaining package information such as version, status, dependencies, integrity, and signatures. Candidates should be able to determine what files a package provides, as well as find which package a specific file comes from. Key files, terms, and utilities include: ??/etc/rpmrc ??/usr/lib/rpm/* rpm [install] -i --install -U --upgrade -F --freshen --allfiles --force --nodeps --prefix NEWPATH [query] -q -a --all -f --file -p --package --changelog -c --configfiles -d --docfiles -i --info -l --list -R --requires -s --state [Verify] -V --verify S M 5 D L U G T c [Signature] --checksig [Erase] --nodeps --repackage [Other] --initdb --rebuilddb grep grep -E egrep grep -F fgrep -c --count -i --ignore-case -n --line-number -r --recursive -v --invert-match -E --extended-regexp -F --fixed-strings Regular Expressions [0123456789] = [:digit:] [0-9A-Za-z] = [:alnum:] [^0-9A-Za-z] = [^[:alnum:]] [:alpha:] [:lower:] [:upper:] [:cntrl:] [:space:] ^ 行首 $ 行末 \< 字首 \> 字末 ? 符合一次 * 符合零次以上 + 符合至少一次以上 {n} 重復n遍 {n,} 重復n遍以上 {n,m} 重復n到m遍 (運算式)|(運算式) 普通運算式不支援 ? + { | ( 要用轉意字元\,¥先導) 擴展運算式不支援 { ( 要用轉意字元\,¥先導) rpm gpkg