CHAPTER 02 ( ) rpm ( / ) yum ( / ) yum utils yum rpm yum 15
Fedora Fedora Fedora DVD CD Fedora Fedora Project (http://fedoraproject. org/wiki/distribution/download) CentOS http://centos.org RedHat (www.redhat.com/apps/download) RedHat Enterprise RHEL Fedora 7 RedHat (Fedora RHEL CentOS) anaconda installer anaconda RHEL CentOS installer 16
CHAPTER anaconda installer DVD CD CD DVD( README ) boot Fedora anaconda image boot.iso boot.iso image boot.iso diskboot.img diskboot.img /dev/sda # dd if=/media/cdrom/diskboot.img of=/dev/sda isolinux initrd.img vmlinu intrd.img vmlinuz /boot/grub/grub.conf 17
Fedora image/pxeboot /usr/share/doc/syslinux * Fedora installer CD DVD Enter boot: linux askmethod vmlinuz askmethod, text, vnc 18
CHAPTER cp ar boot: linux text boot: linux vnc boot: linux vnc vncconnect=192.168.0.20 vncpassword=99pass07 boot: linux ks=floppy boot: linux ks=hd:/dev/hda1/ks.cfg boot: linux ks=http://example.com/ks.cfg linux text ( ) linux vnc VNC IP VNC server IP listening mode vncconnect VNC vnc vncviewer listen 99pass07 192.168.0.20 ks kickstart installer ks cfg IDE ks cfg example.com root ks cfg kickstart kickstart Fedora /root/anaconda ks cfg kickstart 19
Fedora http://fedora.redhat.com/projects/config-tools/redhat-config-kickstart.html /usr/ share/doc/anaconda-* kickstart-docs.txt boot: linux rescue boot: linux local boot: linux memtest86 Fedora installer CD/DVD Fedora rescue local CD/DVD memtest86 [ 2 1] ide=nodma nodma acpi=off all-generic-ide irqpoll noprobe nousb nopcmcia nofirewire noapic nolapic selinux=0 console=/dev/ttys0 20
CHAPTER resolution=800x600 skipddc vga=ask mem=256m dd bootparam man Boot Prompt HOWTO (www tldp org/howto/bootprompt HOWTO html) [ 2 2] Ctrl+Alt+F1 F2 F3 F4 F5 Ctrl+Alt+F1 Ctrl+Alt+F2 shell shell Ctrl+Alt+F3 Ctrl+Alt+F4 Ctrl+Alt+F5 Ctrl+Alt+F7 X ide=nodma 21
Fedora iwconfig Fedora RPM RPM (.rpm ) 22
CHAPTER Fedora Fedora Fedora RHEL CentOS Fedora rpm yum yum yum rpm yum rpm rpm Fedora 6 2200 RPM ( DVD 5 CD) Fedora Fedora Core RedHat Fedora Fedora Core Extras RPM Digital Millennium Copyright Act(DMCA) U S Fedora Core Extras Fedora 7 Fedora 7 23
Fedora RedHat third party yum main Fedora RedHat RedHat RedHat rpm rpm rpm Debian GNU/Linux Debian apt apt4rpm apt enable RPM RedHat yum Fedora apt Debian yum Yellow Dog Linux(Mac RedHat Linux ) yum (Yellow dog Updater Modified) apt Fedora apt4rpm Fedora yum RHEL RPM up2date yum RHEL 5 24
CHAPTER Fedora Core Fedora Extras Fedora 7 /etc/yum repos d.repo yum Fedora yum Fedora main Fedora yum Fedora Fedora.repo GPG third party Fedora RPM 25
Fedora Fedora http://rpmforge.net http://dag.wieers.com/rpm http://rpm.livna.org http://freshrpms.net http://atrpms.net ( Fedora ) release RPM Fedora Fedora # rpm -Uhv http://ftp.belnet.be/packages/dries.ulyssis.org/fedora/ fc5/i386/rpms.dries/rpmforge-release-0.2-2.2.fc5.rf.i386.rpm # rpm -Uhv http://rpm.livna.org/livna-release-6.rpm 26
CHAPTER # rpm -Uhv http://ftp.freshrpms.net/pub/freshrpms/fedora/linux/6/ freshrpms-release/freshrpms-release-1.1-1.fc.noarch.rpm RPMForge Livna org FreshRPMS rpm RPMForge Fedora Core 5 Fedora Core 6 ATrpms Fedora ATrpms # rpm --import http://atrpms.net/rpm-gpg-key.atrpms yum ATrpms Fedora yum /etc/yum conf Fedora /etc/yum repos d/ repo /etc/yum repos d atrpms repo [atrpms] name=fedora Core $releasever - $basearch - ATrpms baseurl=http://dl.atrpms.net/fc$releasever-$basearch/atrpms/stable gpgkey=http://atrpms.net/rpm-gpg-key.atrpms gpgcheck=1 atrpms baseurl ATrpms gpgkey ATrpms key gpgcheck yum Fedora yum yum 27
Fedora pirut yum yum yum list # yum list available # yum list installed list # yum list extras # yum list *vorbis* vorbis # yum list updates info # yum info wordpress wordpress # yum info word* word search # yum search mp3 mp3 whatprovides # yum whatprovides ogg123... vorbis-tools.i386 1:1.1.1-5.fc7 installed Matched from: /usr/bin/ogg123 /usr/share/doc/vorbis-tools-1.1.1/ogg123rc-example /usr/share/man/man1/ogg123.1.gz 28
CHAPTER install # yum install wordpress... Dependencies Resolved ========================================================================== Package Arch Version Repository Size ========================================================================== Installing: wordpress noarch 2.1-0.fc7 extras 725 k Installing for dependencies: php i386 5.2.1-3 development 1.3 M php-cli i386 5.2.1-3 development 2.1 M php-common i386 5.2.1-3 development 197 k php-mysql i386 5.2.1-3 development 72 k php-pdo i386 5.2.1-3 development 53 k Transaction Summary ========================================================================== Install 6 Package(s) Update 0 Package(s) Remove 0 Package(s) Total download size: 4.5 M Is this ok [y/n]: y WordPress blogging y( yes ) yum localinstall rpm yum 29
Fedora # yum localinstall heyu-2.0beta.3.1-1.i386.rpm XFCE # yum groupinstall XFCE # yum check-update. # yum list updates openoffice* openoffice*. # yum update openoffice* openoffice. # yum update. # yum groupupdate XFCE XFCE. yum # yum remove beagle beagle. # yum remove xscreen* xscreen. # yum groupremove XFCE XFCE. yum remove yum clean yum keepcache /etc/yum conf 1 /var/cache/yum/repo/ packages headers Metadata repomd xml comps xml 30
CHAPTER # yum clean packages cache. # yum clean metadata cache medata. # yum clean headers cache header. # yum clean all metadata, header, package. yum yum enablerepo= disablerepo= (livna ) # yum --disablerepo=livna search yum-utils # yum --enablerepo=livna install mplayer yum utils livna ( ) livna (.repo enabled 0 ) mplayer yum metadata metadata yum metadata update C metadata yum # yum -C info yum-utils Setting up repositories Reading repository metadata in from local files... C cache 30 yum metadata metadata /etc/yum conf metadata_expire (metadata_expire=1800) 31
Fedora yum utils (yum install yum utils) repoquery yum repoquery -il tomcat5 repoquery --provides tomcat5 il tomcat5 repoquery RPM rpm q man repoquery yumdownloader cacti # yumdownloader cacti yum rpm RPM rpm RPM query RPMs rpm rpm RPM query root 32
CHAPTER i v hash h # rpm -ivh rpmforge-release-0.2-2.2.fc5.rf.x86_64.rpm Preparing... ########################################### [100%] 1:rpmforge-release ########################################### [100%] http ftp # rpm -ivh http://ftp.belnet.be/packages/dries.ulyssis.org/fedora/fc5/x8 6_64/RPMS.dries/rpmforge-release-0.2-2.2.fc5.rf.x86_64.rpm Retrieving http://ftp.belnet.be/packages/dries.ulyssis.org/fedora/ fc5/x86_64/rpms.dries/rpmforge-release-0.2-2.2.fc5.rf.x86_64.rpm Preparing... ########################################### [100%] 1:rpmforge-release ########################################### [100%] rpm Uvh # rpm -Uhv flash-plugin-9.0.31.0-release.i386.rpm e # rpm -e rpmforge-release 64 32 full # rpm -e avahi-0.6.11-3.fc5 error: avahi-0.6.11-3.fc5 specifies multiple packages 33
Fedora # rpm -e avahi-0.6.11-3.fc5.i386 # rpm -e --allmatches avahi-0.6.11-3.fc5 error: Failed dependencies: libavahi-client.so.3()(64bit) needed by (installed) vino-2.13.5-2.2.x86_64 avahi ( ) yum i386 # rpm -e --nodeps avahi-0.6.11-3.fc5.i386 rsync ( ) # rpm -q rsync rsync-2.6.9-1.fc5.1 qp # rpm -qp rpmforge-release-0.2-2.2.fc5.rf.x86_64.rpm # rpm -qa less glibc-2.5.90-15 libice-1.0.3-1.fc7 34
CHAPTER # rpm -qf /etc/sysctl.conf initscripts-8.31.6-1 (rpmforge release ) # rpm -qi rpmforge-release Name : rpmforge-release Relocations: (not relocatable) Version : 0.2 Vendor: Dries RPM Repository http://dries.ulyssis.org/rpm/release : 2.2.fc5.rf Build Date: Wed 12 Apr 2006 12:57:29 AM PDT Install Date: Wed 14 Feb 2007 01:21:54 AM PST Build Host: koblenz.kotnet.org Group : System Environment/Base Source RPM: rpmforge-release-0.2-2.2.fc5.rf.src.rpm Size : 14574 License: GPL Signature : DSA/SHA1, Wed 12 Apr 2006 07:17:23 AM PDT, Key ID 9c14a19c1aa78495 Packager : Dag Wieers <dag@wieers.com> URL : http://rpmforge.net/ Summary : RPMforge release file and package configuration Description : RPMforge.net release file. This package contains apt, yum and smart configuration for the RPMforge RPM Repository, as well as the public GPG keys used to sign them. # rpm -qlp rpmforge-release-0.2-2.2.fc5.rf.x86_64.rpm less /etc/apt /etc/apt/sources.list.d rpm # rpm -qilp rpmforge-release-0.2-2.2.fc5.rf.x86_64.rpm less RPM # rpm -q --scripts kernel less 35
Fedora query rpm man rpm query queryformat ( qf) # rpm -qa --queryformat %{VENDOR} %{NAME}\n grep -v Red Hat sort # rpm -qa --qf %{NAME} is licenced under %{LICENSE}\n # rpm -qa --qf The size of %{NAME} is %{SIZE} bytes\n # rpm -qa --qf For %{NAME} get more info here: %{URL}\n # rpm -qa --qf For %{NAME} the architecture is: %{ARCH}\n # rpm -qa --qf The %{NAME} package is: %{SUMMARY}\n # rpm --querytags less ls ps rpm rpm [ 2 3] 36
CHAPTER bin # rpm -Va grep bin S.5...T /usr/bin/curl curl curl RPM ( MD5 checksum ) # rpm -Vv coreutils coreutils # rpm -V -f /usr/bin/pr pr # rpm -V -g Applications/Multimedia RPM rebuild # rm /var/lib/rpm/ db.00* # rpm --rebuilddb rpm rpm man (man rpm) (rpm help) 37
Fedora RPM build rebuild rpm build RPM(SPRM) (yum install rpm build) rpmforge release SPRM # wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release- 0.3.6-1.rf.src.rpm # mkdir -p /usr/src/redhat/sources # rpm -ivh rpmforge-release-0.3.6-1.rf.src.rpm (src rpm) rpm /usr/src/redhat rpm build binary RPM rebuild spec rebuild # rpmbuild -bb /usr/src/redhat/specs/rpmforge-release.spec RPM /usr/src/redhat/rpms/arch arch ( i386 i586 ) RPM (descriptions checksums build information ) RPM archive cpio archive 38
CHAPTER cpio 8 tar RPM cpio archive rpm2cpio # rpm2cpio rpmforge-release-0.3.6-1.rf.x86_64.rpm > rpmforge-release.cpio rpmforge release RPM archive rpm release cpio cpio archive cpio archive rpm2cpio cpio tv # rpm2cpio rpmforge-release-0.3.6-1.rf.x86_64.rpm cpio -tv rpm rpm qlvp rpmforge release 0 3 6 1 rf x86_64 rpm rpm2cpio RPM cpio idv rpm2cpio rpmforge yum usr/doc/rpmforge release 0 3 6 # rpm2cpio rpmforge-release-0.3.6-1.rf.x86_64.rpm \ cpio -idv./usr/doc/rpmforge-release-0.3.6/rpmforge.yum rpm release Fedora RedHat RPM anaconda installer Fedora boot yum rpm 39