CIT 500: IT Fundamentals Packages and Filesystems 1.

Slides:



Advertisements
Similar presentations
Linux+ Guide to Linux Certification, Second Edition
Advertisements

MCITP Guide to Microsoft Windows Server 2008, Server Administration (Exam #70-646) Chapter 2 Installing Windows Server 2008.
Support for Windows 7 Chapter 2 Securing and Troubleshooting Windows 7.
Chapter One The Essence of UNIX.
Chapter 9 Chapter 9: Managing Groups, Folders, Files, and Object Security.
Linux+ Guide to Linux Certification, Second Edition Chapter 3 Linux Installation and Usage.
Network+ Guide to Networks, Fourth Edition Chapter 10 Netware-Based Networking.
Lesson 4-Installing Network Operating Systems. Overview Installing and configuring Novell NetWare 6.0. Installing and configuring Windows 2000 Server.
Hands-On Microsoft Windows Server 2003 Chapter 2 Installing Windows Server 2003, Standard Edition.
Hands-On Microsoft Windows Server 2003 Administration Chapter 6 Managing Printers, Publishing, Auditing, and Desk Resources.
Laksh mi.  fdisk is an interactive utility to manipulate disk partitions.  Use fdisk –l to review the disks and partitions on the system.  Use fdisk.
Linux+ Guide to Linux Certification, Third Edition Chapter 11 Compression, System Backup, and Software Installation.
Installing Linux softwares Sirak Kaewjamnong. 2 Software packets  When Linux developers create their software they typically bundle all the executable.
Chapter 7 Installing and Using Windows XP Professional.
Configuring Disk Quotas Linux System Administration To implement disk quotas, use the following steps: Enable quotas per file system by modifying /etc/fstab.
Chapter 11 Compression, System Backup, and Software Installation.
Section 6.1 Explain the development of operating systems Differentiate between operating systems Section 6.2 Demonstrate knowledge of basic GUI components.
Downloading & Installing Software Chapter 13. Maintaining the System Yum Pirut BitTiorrent Rpm Keeping Software Up To Date Up2date Red Hat Network Wget.
Linux Operations and Administration
Linux+ Guide to Linux Certification, Third Edition
CompTIA Linux+ Certification
1 Web Server Administration Chapter 3 Installing the Server.
Linux Installation and Administration – Lesson 5 Tutor: George Papamarkos Topic: Devices in Linux.
Linux+ Guide to Linux Certification
Guide to Linux Installation and Administration, 2e1 Chapter 3 Installing Linux.
A+ Guide to Managing and Maintaining Your PC Fifth Edition Chapter 15 Installing and Using Windows XP Professional.
Tutorial 11 Installing, Updating, and Configuring Software
SUSE Linux Enterprise Server Administration (Course 3037) Chapter 4 Manage Software for SUSE Linux Enterprise Server.
LPIC-1 TRAINING COURSE Topic 102: Linux Installation and package management.
Guide to Linux Installation and Administration, 2e 1 Chapter 9 Preparing for Emergencies.
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
1 Web Server Administration Chapter 3 Installing the Server.
Package Management How to use rpms. Topics The Problem of Software Installation Package Management Systems Using RPM Finding RPMs Building RPMs.
COSC 4750 Customizing and maintenance. Installing software Redhat/Fedora (and linux in general) has a package installer, called rpm Many programs will.
Linux Package Management Dr. Michael L. Collard 1.
CIT 470: Advanced Network and System AdministrationSlide #1 CIT 470: Advanced Network and System Administration Package Management.
Install Software. UNIX Shell The UNIX/LINUX shell is a program important part of a Unix system. interface between the user & UNIX kernel starts running.
A Practical Guide to Fedora and Red Hat Enterprise Linux Unit 8: Installing Software in Linux Chapter 13: Downloading and Installing Software By Fred R.
Installation Overview Lab#2 1Hanin Abdulrahman. Installing Ubuntu Linux is the process of copying operating system files from a CD, DVD, or USB flash.
Linux Services Muhammad Amer. 2 xinetd Programs  In computer networking, xinetd, the eXtended InterNET Daemon, is an open-source super-server daemon.
1 Interface Two most common types of interfaces –SCSI: Small Computer Systems Interface (servers and high-performance desktops) –IDE/ATA: Integrated Drive.
SUSE Linux Enterprise Desktop Administration Chapter 6 Manage Software.
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
Installation of packages Objectives –Using software packaging tools Contents –Application delivered as –Where to get commonly used rpm’s –Autofs on! –Getting.
Creating and Managing File Systems. Module 5 – Creating and Managing File Systems ♦ Overview This module deals with the structure of the file system,
1 FreeBSD Installation AFNOG X Cairo, Egypt May 2009 Hervey Allen.
1 LINUX SECURITY. 2 Outline Introduction Introduction - UNIX file permission - UNIX file permission - SUID / SGID - SUID / SGID - File attributes - File.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification Chapter Six Linux Filesystem Administration.
System Administration – Part 2. Devices in UNIX are files: A device can be accessed with different file names All device files are stored in /dev or its.
Installation of packages Objectives –Using software packaging tools Contents –Application delivered as –Where to get commonly used rpm’s –Autofs on! –Getting.
I T Essentials I Chapter 5 JEOPARDY Installing & UpgradingComputerBasicsErrorsServicePotpourri
CSCI 330 UNIX and Network Programming Unit XX: Linux Administration.
Linux Operations and Administration
CSC414 “Introduction to UNIX/ Linux” Lecture 6. Schedule 1. Introduction to Unix/ Linux 2. Kernel Structure and Device Drivers. 3. System and Storage.
RedHat Package Management RPM and YUM in RedHat Enterprise, Fedora, Suse and Centos.
Materi managing user & groups, file system Managing Software Packages and File Systems The Complete Guide to Linux System Administration Chapter 10.
Linux Filesystem Administration
1 Free Electrons. Kernel, drivers and embedded Linux development, consulting, training and support. http//free-electrons.com The GRUB bootloader Michael.
System Administration Application Management. ● A common task for a system administrator is the installation, updating and removal of software. Several.
The GRUB bootloader Michael Opdenacker Thomas Petazzoni Free Electrons
Guide to Linux Installation and Administration, 2e
CIT 470: Advanced Network and System Administration
CIT 470: Advanced Network and System Administration
More Scripting & Chapter 11
RedHat Package Management
University of Texas Rio Grande Valley Systems Administration CSCI 6175
Linux File Systems Partitioning Mounting File Systems
Instructor Materials Chapter 5: Windows Installation
Presentation transcript:

CIT 500: IT Fundamentals Packages and Filesystems 1

Topics 1.Packages 1.The software installation problem 2.UNIX package managers 3.Dependencies 4.Advanced package managers 2.Filesystems 1.Filesystem types 2.Integrity and repair 3.Permissions and attributes 2

Software Installation 1.Customization Select options like language. Select file set. 2.Install new files in appropriate locations. 3.Modify existing configuration files. 4.Make software available to user. Shell configuration (PATH, etc.) GUI configuration (menu, icons, etc.) 3

What’s the problem? What prerequisites does your software have? What prereqs do your prereq packages have? How do you handle conflicts? What if two programs install/modify same file? Does your install work on every type of computer? How do you handle upgrades? What if user has customized configuration? What if ownerships/permissions have changed? What if user needs old and new versions? How do you uninstall software? 4

Package Manager Features Build management. Dependency tracking. Querying. Reversibility. Verification. Version control. 5

UNIX Package Management Systems deb: Debian system uses dpkg and APT. pkgadd: Solaris packaging system. portage: Gentoo uses with emerge. ports: BSD ports system. RPM: Redhat packaging system. tgz: Tarballs used by Slackware. 6

dpkg Debian package system – Original version created in 1993 – APT introduced in 1998 Distributions – Debian – Knoppix – Linspire – MEPIS – Ubuntu dpkg on other OS – Fink on MacOS X 7

RPM RPM Package Manager – Originally stood for Red Hat Package Manager – Came with Red Hat Linux 2.0 in Distributions – Red Hat – Red Hat Enterprise Linux (also CentOS) – Fedora – Mandriva – SUSE RPMs are not compatible between distributions. RPM on other OS – AIX – Novell Netware 8

RPM Package Names - -..rpm Name: name of the software package. Version: version of the software package. Release: release version of the RPM. Arch: architecture ( i386, noarch, ppc, etc.) If Arch is src, RPM contains source code for building the package. 9

RPM Package Contents Identification Identifies package and RPM version. Signature Checksum and digital signature. Header Package and version information. Specifies dependencies on other packages. Payload Actual files to install. Stored as cpio archive compressed with gzip. Use rpm2cpio to obtain cpio archive. 10

Using RPM 1.Install 2.Uninstall 3.Upgrade 4.Query 5.Verify 11

Installing a Package 1.Check the package and the files it wants to install. 2.Perform preinstallation tasks. 3.Uncompress the files and copy them in the proper locations 4.Perform post-processing tasks 5.Update the RPM Database > rpm -ivh foo i386.rpm Preparing... ########################################### [100%] 1:foo ########################################### [100%] 12

Upgrading a Package Uninstall + install, retaining configuration files. Will install a package if no older version. Will remove all older versions. Typically use –U instead of –i for installs too. > rpm -Uvh foo i386.rpm Preparing... ########################################### [100%] 1:foo ########################################### [100%] 13

Uninstalling a Package Completely removes package from system. > rpm -e foo > rpm –q foo package foo is not installed. 14

Dependencies Prevent install/removal if unfulfilled. # rpm -e setup error: Failed dependencies: setup is needed by (installed) basesystem setup >= is needed by (installed) initscripts setup >= is needed by (installed) filesystem setup is needed by (installed) xinetd setup is needed by (installed) dump-0.4b28-4 # rpm -q setup setup

RPM Database Tracks global package information: – List of all packages – Dependencies between packages For each package, stores: – Name, version, and architecture (-q) – Information fields, including description (-qi) – List of files (-ql), config files (-qc), doc files (-qd) – Date of install 16

Querying the RPM Database # rpm -q telnet telnet EL4.3 # rpm -ql telnet /usr/bin/telnet /usr/share/man/man1/telnet.1.gz # rpm -qi telnet Name : telnet Relocations: (not) Version : 0.17 Vendor: CentOS Release : 31.EL4.3 Build Date: Tue 14 Jun 2005 Install Date: Sat 11 Feb 2006 Build Host: build5 Group : Applications/Internet Src RPM: telnet-0.17.src.rpm Size : License: BSD Signature : DSA/SHA1, Tue 14 Jun 2005, Key ID a53d0bab443e1821 Packager : Johnny Hughes Summary : Client program for telnet remote login protocol. Description : Telnet is a popular protocol for logging into remote systems over the Internet. The telnet package provides a command line telnet client. 17

Querying the RPM Database # rpm -qc bash /etc/skel/.bash_logout /etc/skel/.bash_profile /etc/skel/.bashrc # rpm -qd sendmail /usr/share/man/man1/mailq.sendmail.1.gz /usr/share/man/man1/newaliases.sendmail.1.gz /usr/share/man/man5/aliases.sendmail.5.gz /usr/share/man/man8/mailstats.8.gz /usr/share/man/man8/makemap.8.gz /usr/share/man/man8/praliases.8.gz /usr/share/man/man8/rmail.8.gz /usr/share/man/man8/sendmail.sendmail.8.gz /usr/share/man/man8/smrsh.8.gz 18

Searching all Packages # rpm -qa | grep telnet telnet EL4.3 # rpm -qa | grep py python pyOpenSSL p23 rpm-python _nonptl pygtk python-devel python-ldap pyxf86config libxml2-python python-elementtree python-sqlite dbus-python EL.5 pyparted python-urlgrabber

Searching all Packages Find recently installed packages rpm -qa --last Find packages that are disk hogs rpm -qa --qf "%{size} %{name}\n" | sort –n The --qf (queryformat) option can print arch, name, size, version, distribution, etc. 20

Querying Files and Packages Find which package a file belongs to: # rpm -qf /usr/bin/telnet telnet EL4.3 # rpm -qf /etc/security/limits.conf pam Querying packages Add –p to any query to apply it to a.rpm file instead of to an installed package. 21

Verifying Packages Verifying a package returns nothing if ok # rpm -V telnet Returns errors if package has problems # rpm -V telnet-server missing c /etc/xinetd.d/telnet missing /usr/sbin/in.telnetd missing d /usr/share/man/man5/issue.5.gz 22

RPM Options Specify multiple RPMs at once. RPM will re-order installs to resolve dependencies. Prefix: install in new location. rpm --prefix /usr/local –Uvh *.rpm Oldpackage: revert to an older version rpm --oldpackage –Uvh foo i386.rpm Forcing install, upgrade, or removal --force allows overwriting of files/packages. --nodeps allows install w/o dependency check. 23

Dependency Resolution Higher level tools handle dependencies up2date, yum, yast, urpmi Automatic resolution + downloading. 1. Find dependencies in RPM headers. 2. Download dependencies, check their headers. 3. Repeat. 4. Install after all RPMs downloaded. 24

Yellow Dog Updater Modified – Rewrite of YUP from Yellow Dog Linux. – Used by many RPM-based distributions. Automatically syncs repo metadata. – Prevents problems arising from out of data package information on local system. – Wastes time when local data up to date. 25

Yum Installs yum install pkg: finds specified package, downloads it, and installs it. yum remove pkg: remove the specified package from the system. yum update : updates specified package or updates all packages if no package specified. 26

yum list Options: available: list packages available to be installed. installed: list installed packages like rpm –qa. extras: lists installed packages that are not available on any currently configured repo. recent: lists packages added to repositories in last 7 days. updates: lists updates for any installed packages. Package Specifications: bash bash-3.10 \*sh \*.i386 27

Yum Commands check-update: lists updates, returns 100 if any updates available. clean: removes yum cache files. deplist: list all dependencies for a package. info: list package data like rpm –qi yum provides: find which package provides the specified command, i.e. yum provides \*bin/ls. yum search: lists packages whose name, summary, description, or URL matches the specified search term. 28

Package Sources Sources – Local files (CD/DVD or hard disk) – Red Hat Network commercial sites for RHEL – CentOS network official mirrors for CentOS – Unofficial network repositories like RPMforge Source configuration up2date: /etc/sysconfig/rhn/sources yum: /etc/yum.conf, /etc/yum/repos.d 29

Finding RPMs 1.The Red Hat Enterprise Linux CD-ROMs 2.The Red Hat Errata Page available at A Red Hat FTP Mirror Site available at Dag RPM Repository at / / 5.Search for RPMs at 6.Search for RPMs at rpm.pbone.net. 30

Filesystem Types Disk-based Filesystems – Filesystems designed to store files to a fixed or removable permanent storage device. Flash Filesystems – Flash can only be written to 1000s of times. – Re-arrange block usage to avoid writing too many times to any one block on flash. Journaling Filesystems – Modify how writes are done to provide greater data integrity in case of a system crash. 31

Filesystem Tree Structure / binboottmpusrvar lsgrub binlibX11R6 vmlinuz menu.lst less zip binlib xclockxterm 32

Journaling Filesystems Problem: writing to file involves many disk writes 1.Modify inode to change file size 2.(potentially) Add new data block to used block map 3.(potentially) Add pointer to new data block 4.Write to new data block Journaling filesystems perform writes by: 1.Write blocks to journal. 2.Wait for write to be committed to journal. 3.Write blocks to filesystem. 4.Discard blocks from journal. 33

Common Disk-based Filesystems Extended Filesystem – ext2: first full featured UNIX fs for Linux in 1993 Recommended use: USB + other solid state drives. – ext3: ext2 + journalling – ext4: faster version of ext3 with larger file support Microsoft Filesystems – FAT: inefficient disk usage, slow, 8+3 filenames 16- and 32-bit versions used on flash storage – NTFS: modern filesystem, many versions Supports long + old 8+3 filenames for compatibility 34

Ext2 Disk Data Structures 35

Inode Block Addressing Slide #36

Creating a Filesystem Select a disk partition to create filesystem on fdisk –l /dev/sda will list partitions on 1 st disk fdisk –l /dev/sdb will list partitions on 2 nd disk, etc. Run mke2fs –v /dev/sda2 Creates ext2 filesystem on 2 nd partition of 1 st disk Wipes any data already existing on that filesystem Add a –j option to create an ext3 journaling fs. 37

Mounting a Filesystem 1.Create a mountpoint mkdir -p /stor/video 2.Mount filesystem on chosen directory mount -t ext3 /dev/sda2 /stor/video 3.Use filesystem 4.Unmount filesystem when done umount /dev/sda2 Happens automatically at reboot or shutdown 38

Automatic Mounting Filesystems in /etc/fstab are mounted on boot. Use mount to see current mounted filesystems. # /etc/fstab: static file system information. # proc /proc proc defaults 0 0 /dev/sda1 / ext3 defaults 0 1 /dev/sda2 none swap sw 0 0 /dev/sda3 /home ext3 defaults 0 1 /dev/sdb1 /backup ext3 defaults

Checking Filesystem Integrity fsck utility performs consistency checks – Are used blocks actually used? – Do inodes point to any unused blocks? – Are used inodes pointed to by directory entries? and repairs inconsistencies if – Sysadmin enters ‘y’ in interactive mode. – Sysadmin uses ‘-y’ argument to do all repairs. Run fsck with unmounted partition as arg: fsck –y /dev/sda2 40

Access Control: Permissions Read – You can read the file with cat, more, etc. Write – You can modify the file with vi, OpenOffice, etc. Execute – You can run the file if it’s a program. 41

Three Sets of Permissions 42

Access Control Commands Changing File Access Privileges chmod [options] octal-mode file chmod [options] symbolic file 43

POSIX ACLs Specify individual groups and users. Basic ACL user/group refers to owner. POSIX ACLs allow specifying users + groups. To add/modify permissions for a user: setfacl –m u:username:rw- filename To add/modify permissions for a group: setfacl –m g:groupname:rw- filename 44

ACL Examples $ getfacl acltest # file: acltest # owner: waldenj # group: waldenj user::rw- group::r-- other::r-- $ setfacl -m u:trutat:rw- acltest $ getfacl acltest # file: acltest # owner: waldenj # group: waldenj user::rw- user:trutat:rw- group::r-- mask::rw- other::r-- 45

File Attributes Attributes extend file permissions: a : append-only (only root can set) i : immutable (read-only, only root can set) s : safe-delete (overwrite, not supported yet) Use lsattr to view attributes. Most files do not have any attributes set. Use chattr to set attributes. chattr +i /boot/vmlinuz* 46

References 1.Syed Mansoor Sarwar, Robert Koretsky, Syed Ageel Sarwar, UNIX: The Textbook, 2 nd edition, Addison-Wesley, Nicholas Wells, The Complete Guide to Linux System Administration, Thomson Course Technology,