SlideShare uma empresa Scribd logo
1 de 39
Baixar para ler offline
Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
Management
                Sysadmins’ Rosetta Stone
Files

Services
                     Mackenzie Morgan

                      Ohio LinuxFest 2009


                    26 September 2009
Outline

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction    1   Introduction
Package
Management

Files           2   Package Management
Services



                3   Files


                4   Services
Me

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
                     Mackenzie Morgan
Management
                     Computer Science student
Files

Services             *buntu contributor
                     At home: Kubuntu
                     At work: Red Hat (. . . and SUSE. . . and Solaris. . . and
                     AIX. . . )
This Talk

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
Management          You: “Red Hat, Red Hat, Red Hat, I sure love Red Hat!”
Files
                    Pointy-Haired Boss: We’re switching to Debian
Services
                    You: But they don’t even use RPM!
                (Swap “Debian” for “Red Hat” and vice-versa as necessary)
Outline

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction    1   Introduction
Package
Management

Files           2   Package Management
Services



                3   Files


                4   Services
Why Package Management First?

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
Management

Files
                    Lots of commands
Services
                    Use it the most
Apt and Yum and Bears, Oh my!

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan
                Common Debian tools:
Introduction        apt-cache
Package
Management          apt-get
Files
                    aptitude
Services
                    dpkg
                    tasksel
                Common Red Hat & Fedora tools:
                    rpm
                    yum
Package Naming Conventions: Red Hat

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
                python 2.6-1.i386.rpm
Management      Parts:
Files
                    Software name
Services
                    Software version
                    Package version
                    Architecture
Package Naming Conventions: Debian

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan       python2.6 2.6.2-3 amd64.deb
Introduction    python2.6 2.6.2-3ubuntu1 amd64.deb
Package         Parts:
Management

Files
                    Software name
Services            Library version (optional)
                    Software version
                    Debian package version
                    Ubuntu package version (only if Ubuntu modifications
                    exist)
                    Architecture
Installing and Removing a Local Package

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction
                Install:
Package
Management           dpkg -i python2.6 2.6.2-3 amd64.deb
Files
                     rpm -Uvh python 2.6-1.i386.rpm
Services
                Remove:
                     dpkg -r python2.6
                     rpm -e python
Installing and Removing Packages with Repositories

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan
                Install:
Introduction
                     apt-get install python2.6
Package
Management           aptitude install python2.6
Files
                     yum install python
Services
                Remove:
                     apt-get remove python2.6
                     aptitude remove python2.6
                     yum remove python
                Great! Not much to learn there!
Wait. . . Apt-get? Aptitude?

 Sysadmins’
Rosetta Stone

  Mackenzie
                Aptitude:
   Morgan
                    Always installs “Recommends:” packages
Introduction
                    Tracks “manual” versus “automatically” installed packages
Package
Management          Removes “orphaned” packages
Files
                Apt-get:
Services
                    Can be configured to automatically install “Recommends:”
                    packages or not (current default: install them)
                    Will prompt about orphaned packages
                    apt-get autoremove will remove orphaned packages
                Convergence!
                Aptitude’s main use? Avoiding remembering apt-get and
                apt-cache
How do I find a package?

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction
                Debian:
Package
Management
                    apt-cache search text editor
Files

Services
                    aptitude search text editor
                Diff? Aptitude alphabetizes and lists install status
                Red Hat:
                    yum search text editor
What if I want lots of packages?

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
Management      List them all! Or. . .
Files
                     Metapackages
Services
                     Tasksel
                     Groupinstall
Metapackages

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
Management
                Dummy package, depends on lots of other packages
Files
                Ex:
Services
                apt-get install build-essential
                installs development tools (gcc, kernel headers, etc.)
Tasksel

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
Management

Files
                TUI to select and install a certain task, ex: LAMP server
Services
                Just run tasksel
Groupinstall

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
Management
                Feature of Yum
Files
                Ex:
Services
                yum groupinstall ‘‘Development Tools’’ is roughly
                equivalent to the earlier “build-essential” example
Speaking of Development Packages. . .

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
Management

Files           Debian: -dev packages for headers
Services
                Red Hat: -devel packages for headers
Staying up to date

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan
                Get updated list of available packages:
Introduction        apt-get update or aptitude update
Package
Management          yum check-update
Files           Install software updates
Services
                    apt-get upgrade or aptitude safe-upgrade
                    yum update (does the above and installs in tandem)
                Install all software updates and remove obsolete packages
                    apt-get dist-upgrade or aptitude full-upgrade
                    yum upgrade
What if I only want to update one package?

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
Management

Files               apt-get install python2.6
Services
                    yum update python
When I remove a package, what happens to config
                files?
 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
Management

Files
                Debian: They’re retained. . . unless apt-get purge
Services        python2.6
                Red Hat: They’re removed
Which package is this file in?

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package         Debian:
Management

Files
                    If file exists dpkg -S $FILENAME
Services            If not apt-file search $FILENAME
                Red Hat:
                    rpm -qf $FILENAME
What version of a package is installed?

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package         Debian:
Management

Files
                    dpkg -l $PACKAGE
Services            apt-cache policy $PACKAGE
                Red Hat:
                    rpm -qi $PACKAGE | awk ‘/Version/{ print $3 }’
Outline

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction    1   Introduction
Package
Management

Files           2   Package Management
Services



                3   Files


                4   Services
Speaking of Packages. . .

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction
                Where are repositories configured?
Package
Management          Debian: /etc/apt/sources.list
Files
                    Red Hat: /etc/yum.repos.d/*.repo
Services
                Where do downloaded packages go?
                    Debian: /var/cache/apt/archives/
                    Red Hat: /var/cache/yum/
Interface configuration files

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
Management

Files
                    Debian: /etc/network/interfaces
Services            Red Hat: /etc/sysconfig/network-scripts/ifcfg-* (ex:
                    ifcfg-eth0)
Timezones

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
Management

Files              Debian: /etc/timezone
Services
                   Red Hat: /etc/sysconfig/clock
Modules to load

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
Management

Files               Debian: /etc/modules
Services
                    Red Hat: /etc/sysconfig/udev-stw
For the OpenAFS users. . .

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package         krb5-config has no standard place
Management

Files
                    Debian: /usr/bin/krb5-config
Services            Red Hat: /usr/kerberos/bin/krb5-config
                    SUSE: /usr/mit/bin/krb5-config
                    Solaris: /opt/csw/bin/krb5-config
Webserver

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
Management

Files               Debian: /etc/apache2/
Services
                    Red Hat: /etc/httpd/
Firewall configuration

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
Management

Files               Debian: /var/lib/iptables
Services
                    Red Hat: /etc/sysconfig/iptables
IDs

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction          UIDs and GIDs vary
Package
Management            Debian starts at 1000
Files                 Red Hat starts at 500
Services
                      Filesystem permissions become sad
                Change here:
                      Debian: /etc/adduser.conf
                      Red Hat: /etc/login.defs
Outline

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction    1   Introduction
Package
Management

Files           2   Package Management
Services



                3   Files


                4   Services
What’s a Runlevel?

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
Management

Files
                Pre-defined sets of scripts and programs to start in a specific
Services
                state
What does each runlevel do?

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package         That depends. Are you asking:
Management

Files
                  1   Someone who read a book on “Linux” once
Services          2   Someone who’s poked at their system’s runlevels
                  3   Someone who’s used many distros
                  4   Wikipedia
Runlevels By Distro

 Sysadmins’
Rosetta Stone    Distro/Runlevel   2   3   4   5
  Mackenzie
   Morgan        By the book       ♠   ♣   ♦
                 Debian
Introduction
                 Gentoo            ♠           ♦
Package
Management       Red Hat               ♣   ♦
Files            SUSE              ♠   ♣   ♦
Services        Key:
                    ♦ = Undefined
                       = Multi-user with display manager
                    ♣ = Multi-user without display manager
                    ♠ = Multi-user without networking or display manager
                       = Multi-user with networking but without most
                    network services
How do I change runlevels’ services?

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction
                Old Answer:
Package
Management          Debian: manually create/rm symlinks (or
Files               update-rc.d. . . if you’re a script)
Services
                    Red Hat: use chkconfig
                New Answer:
                Use chkconfig
                Yay! Convergence!
How do I start/stop/restart a service?

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
                Old Answer:
Management
                    Debian: /etc/init.d/$SERVICE start
Files

Services            Red Hat: service $SERVICE start or that
                New Answer:
                service $SERVICE start
                Yay! Convergence!
References

 Sysadmins’
Rosetta Stone

  Mackenzie
   Morgan


Introduction

Package
Management

Files

Services
                    http://en.wikipedia.org/wiki/Runlevel

Mais conteúdo relacionado

Mais procurados

CASPUR Staging System II
CASPUR Staging System IICASPUR Staging System II
CASPUR Staging System II
Andrea PETRUCCI
 
101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management
Acácio Oliveira
 

Mais procurados (13)

Monitoring MySQL with DTrace/SystemTap
Monitoring MySQL with DTrace/SystemTapMonitoring MySQL with DTrace/SystemTap
Monitoring MySQL with DTrace/SystemTap
 
RPM (Red Hat Package Manager)
RPM (Red Hat Package Manager)RPM (Red Hat Package Manager)
RPM (Red Hat Package Manager)
 
HA Clustering of PostgreSQL(replication)@2012.9.29 PG Study.
HA Clustering of PostgreSQL(replication)@2012.9.29 PG Study.HA Clustering of PostgreSQL(replication)@2012.9.29 PG Study.
HA Clustering of PostgreSQL(replication)@2012.9.29 PG Study.
 
Software Packaging with RPM
Software Packaging with RPMSoftware Packaging with RPM
Software Packaging with RPM
 
Bundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPMBundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPM
 
Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)Advanced Level Training on Koha / TLS (ToT)
Advanced Level Training on Koha / TLS (ToT)
 
CASPUR Staging System II
CASPUR Staging System IICASPUR Staging System II
CASPUR Staging System II
 
101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management
 
Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1 Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1
 
RPM (LINUX)
RPM (LINUX)RPM (LINUX)
RPM (LINUX)
 
packaging
packagingpackaging
packaging
 
Tungsten University: Setup and Operate Tungsten Replicators
Tungsten University: Setup and Operate Tungsten ReplicatorsTungsten University: Setup and Operate Tungsten Replicators
Tungsten University: Setup and Operate Tungsten Replicators
 
RPM: Speed up your deploy
RPM: Speed up your deployRPM: Speed up your deploy
RPM: Speed up your deploy
 

Semelhante a Sysadmins' Rosetta Stone

101 2.4 use debian package management
101 2.4 use debian package management101 2.4 use debian package management
101 2.4 use debian package management
Acácio Oliveira
 
Deploying and maintaining your software with RPM/APT
Deploying and maintaining your software with RPM/APTDeploying and maintaining your software with RPM/APT
Deploying and maintaining your software with RPM/APT
Joshua Thijssen
 
9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linux9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linux
chinkshady
 
Software management in linux
Software management in linuxSoftware management in linux
Software management in linux
nejadmand
 

Semelhante a Sysadmins' Rosetta Stone (20)

FPM at the Ruby Drink-up of Sophia, September 2011
FPM at the Ruby Drink-up of Sophia, September 2011FPM at the Ruby Drink-up of Sophia, September 2011
FPM at the Ruby Drink-up of Sophia, September 2011
 
Linux Troubleshooting
Linux TroubleshootingLinux Troubleshooting
Linux Troubleshooting
 
How to Build Package in Linux Based Systems.
How to Build Package in Linux Based Systems.How to Build Package in Linux Based Systems.
How to Build Package in Linux Based Systems.
 
101 2.4 use debian package management
101 2.4 use debian package management101 2.4 use debian package management
101 2.4 use debian package management
 
Deploying and maintaining your software with RPM/APT
Deploying and maintaining your software with RPM/APTDeploying and maintaining your software with RPM/APT
Deploying and maintaining your software with RPM/APT
 
Debian Package Management Simplified
Debian Package Management SimplifiedDebian Package Management Simplified
Debian Package Management Simplified
 
Packaging for the Maemo Platform
Packaging for the Maemo PlatformPackaging for the Maemo Platform
Packaging for the Maemo Platform
 
Rpm Introduction
Rpm IntroductionRpm Introduction
Rpm Introduction
 
Approaching package manager
Approaching package managerApproaching package manager
Approaching package manager
 
RPM Packaging 101 (Old)
RPM Packaging 101 (Old)RPM Packaging 101 (Old)
RPM Packaging 101 (Old)
 
Security Considerations on Linux Package Management
Security Considerations on Linux Package ManagementSecurity Considerations on Linux Package Management
Security Considerations on Linux Package Management
 
$ make install
$ make install$ make install
$ make install
 
Debian packaging
Debian packagingDebian packaging
Debian packaging
 
Debian Packaging tutorial
Debian Packaging tutorialDebian Packaging tutorial
Debian Packaging tutorial
 
9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linux9 steps to install and configure postgre sql from source on linux
9 steps to install and configure postgre sql from source on linux
 
Software management in linux
Software management in linuxSoftware management in linux
Software management in linux
 
Install Archlinux in 10 Steps (Sort of) :)
Install Archlinux in 10 Steps (Sort of) :)Install Archlinux in 10 Steps (Sort of) :)
Install Archlinux in 10 Steps (Sort of) :)
 
grate techniques
grate techniquesgrate techniques
grate techniques
 
Workshop 3: JavaScript build tools
Workshop 3: JavaScript build toolsWorkshop 3: JavaScript build tools
Workshop 3: JavaScript build tools
 
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
도커 없이 컨테이너 만들기 5편 마운트 네임스페이스와 오버레이 파일시스템
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Sysadmins' Rosetta Stone

  • 1. Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Management Sysadmins’ Rosetta Stone Files Services Mackenzie Morgan Ohio LinuxFest 2009 26 September 2009
  • 2. Outline Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction 1 Introduction Package Management Files 2 Package Management Services 3 Files 4 Services
  • 3. Me Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Mackenzie Morgan Management Computer Science student Files Services *buntu contributor At home: Kubuntu At work: Red Hat (. . . and SUSE. . . and Solaris. . . and AIX. . . )
  • 4. This Talk Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Management You: “Red Hat, Red Hat, Red Hat, I sure love Red Hat!” Files Pointy-Haired Boss: We’re switching to Debian Services You: But they don’t even use RPM! (Swap “Debian” for “Red Hat” and vice-versa as necessary)
  • 5. Outline Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction 1 Introduction Package Management Files 2 Package Management Services 3 Files 4 Services
  • 6. Why Package Management First? Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Management Files Lots of commands Services Use it the most
  • 7. Apt and Yum and Bears, Oh my! Sysadmins’ Rosetta Stone Mackenzie Morgan Common Debian tools: Introduction apt-cache Package Management apt-get Files aptitude Services dpkg tasksel Common Red Hat & Fedora tools: rpm yum
  • 8. Package Naming Conventions: Red Hat Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package python 2.6-1.i386.rpm Management Parts: Files Software name Services Software version Package version Architecture
  • 9. Package Naming Conventions: Debian Sysadmins’ Rosetta Stone Mackenzie Morgan python2.6 2.6.2-3 amd64.deb Introduction python2.6 2.6.2-3ubuntu1 amd64.deb Package Parts: Management Files Software name Services Library version (optional) Software version Debian package version Ubuntu package version (only if Ubuntu modifications exist) Architecture
  • 10. Installing and Removing a Local Package Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Install: Package Management dpkg -i python2.6 2.6.2-3 amd64.deb Files rpm -Uvh python 2.6-1.i386.rpm Services Remove: dpkg -r python2.6 rpm -e python
  • 11. Installing and Removing Packages with Repositories Sysadmins’ Rosetta Stone Mackenzie Morgan Install: Introduction apt-get install python2.6 Package Management aptitude install python2.6 Files yum install python Services Remove: apt-get remove python2.6 aptitude remove python2.6 yum remove python Great! Not much to learn there!
  • 12. Wait. . . Apt-get? Aptitude? Sysadmins’ Rosetta Stone Mackenzie Aptitude: Morgan Always installs “Recommends:” packages Introduction Tracks “manual” versus “automatically” installed packages Package Management Removes “orphaned” packages Files Apt-get: Services Can be configured to automatically install “Recommends:” packages or not (current default: install them) Will prompt about orphaned packages apt-get autoremove will remove orphaned packages Convergence! Aptitude’s main use? Avoiding remembering apt-get and apt-cache
  • 13. How do I find a package? Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Debian: Package Management apt-cache search text editor Files Services aptitude search text editor Diff? Aptitude alphabetizes and lists install status Red Hat: yum search text editor
  • 14. What if I want lots of packages? Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Management List them all! Or. . . Files Metapackages Services Tasksel Groupinstall
  • 15. Metapackages Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Management Dummy package, depends on lots of other packages Files Ex: Services apt-get install build-essential installs development tools (gcc, kernel headers, etc.)
  • 16. Tasksel Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Management Files TUI to select and install a certain task, ex: LAMP server Services Just run tasksel
  • 17. Groupinstall Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Management Feature of Yum Files Ex: Services yum groupinstall ‘‘Development Tools’’ is roughly equivalent to the earlier “build-essential” example
  • 18. Speaking of Development Packages. . . Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Management Files Debian: -dev packages for headers Services Red Hat: -devel packages for headers
  • 19. Staying up to date Sysadmins’ Rosetta Stone Mackenzie Morgan Get updated list of available packages: Introduction apt-get update or aptitude update Package Management yum check-update Files Install software updates Services apt-get upgrade or aptitude safe-upgrade yum update (does the above and installs in tandem) Install all software updates and remove obsolete packages apt-get dist-upgrade or aptitude full-upgrade yum upgrade
  • 20. What if I only want to update one package? Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Management Files apt-get install python2.6 Services yum update python
  • 21. When I remove a package, what happens to config files? Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Management Files Debian: They’re retained. . . unless apt-get purge Services python2.6 Red Hat: They’re removed
  • 22. Which package is this file in? Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Debian: Management Files If file exists dpkg -S $FILENAME Services If not apt-file search $FILENAME Red Hat: rpm -qf $FILENAME
  • 23. What version of a package is installed? Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Debian: Management Files dpkg -l $PACKAGE Services apt-cache policy $PACKAGE Red Hat: rpm -qi $PACKAGE | awk ‘/Version/{ print $3 }’
  • 24. Outline Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction 1 Introduction Package Management Files 2 Package Management Services 3 Files 4 Services
  • 25. Speaking of Packages. . . Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Where are repositories configured? Package Management Debian: /etc/apt/sources.list Files Red Hat: /etc/yum.repos.d/*.repo Services Where do downloaded packages go? Debian: /var/cache/apt/archives/ Red Hat: /var/cache/yum/
  • 26. Interface configuration files Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Management Files Debian: /etc/network/interfaces Services Red Hat: /etc/sysconfig/network-scripts/ifcfg-* (ex: ifcfg-eth0)
  • 27. Timezones Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Management Files Debian: /etc/timezone Services Red Hat: /etc/sysconfig/clock
  • 28. Modules to load Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Management Files Debian: /etc/modules Services Red Hat: /etc/sysconfig/udev-stw
  • 29. For the OpenAFS users. . . Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package krb5-config has no standard place Management Files Debian: /usr/bin/krb5-config Services Red Hat: /usr/kerberos/bin/krb5-config SUSE: /usr/mit/bin/krb5-config Solaris: /opt/csw/bin/krb5-config
  • 30. Webserver Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Management Files Debian: /etc/apache2/ Services Red Hat: /etc/httpd/
  • 31. Firewall configuration Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Management Files Debian: /var/lib/iptables Services Red Hat: /etc/sysconfig/iptables
  • 32. IDs Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction UIDs and GIDs vary Package Management Debian starts at 1000 Files Red Hat starts at 500 Services Filesystem permissions become sad Change here: Debian: /etc/adduser.conf Red Hat: /etc/login.defs
  • 33. Outline Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction 1 Introduction Package Management Files 2 Package Management Services 3 Files 4 Services
  • 34. What’s a Runlevel? Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Management Files Pre-defined sets of scripts and programs to start in a specific Services state
  • 35. What does each runlevel do? Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package That depends. Are you asking: Management Files 1 Someone who read a book on “Linux” once Services 2 Someone who’s poked at their system’s runlevels 3 Someone who’s used many distros 4 Wikipedia
  • 36. Runlevels By Distro Sysadmins’ Rosetta Stone Distro/Runlevel 2 3 4 5 Mackenzie Morgan By the book ♠ ♣ ♦ Debian Introduction Gentoo ♠ ♦ Package Management Red Hat ♣ ♦ Files SUSE ♠ ♣ ♦ Services Key: ♦ = Undefined = Multi-user with display manager ♣ = Multi-user without display manager ♠ = Multi-user without networking or display manager = Multi-user with networking but without most network services
  • 37. How do I change runlevels’ services? Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Old Answer: Package Management Debian: manually create/rm symlinks (or Files update-rc.d. . . if you’re a script) Services Red Hat: use chkconfig New Answer: Use chkconfig Yay! Convergence!
  • 38. How do I start/stop/restart a service? Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Old Answer: Management Debian: /etc/init.d/$SERVICE start Files Services Red Hat: service $SERVICE start or that New Answer: service $SERVICE start Yay! Convergence!
  • 39. References Sysadmins’ Rosetta Stone Mackenzie Morgan Introduction Package Management Files Services http://en.wikipedia.org/wiki/Runlevel