54
Package Managers What are they and why we use them

Package Managers

  • Upload
    mariel

  • View
    66

  • Download
    1

Embed Size (px)

DESCRIPTION

Package Managers. What are they and why we use them. Thoughts of an admin. Installing software is painful Installing a lot of software is extremely painful Installing a lot of software on a lot of machines is HELL. 舉例 - LOL. 天賦、符文 道具. Before Packages. Install from source - PowerPoint PPT Presentation

Citation preview

Package Managers

Package ManagersWhat are they and why we use themThoughts of an adminInstalling software is painfulInstalling a lot of software is extremely painfulInstalling a lot of software on a lot of machines is HELL - LOLBefore PackagesInstall from sourceTime consumingVarying configurationImprovement 1Copy the binariesSetup scripts?Version?Dependencies?Package - BasicArchiveBinariesSupporting filesSetup scriptPackage ImprovementVersioning1.0.x1.1.xUpgrades!Package - DependenciesProgram A requires library B to workIf library C is available, program A will work better/faster!Example Call of DutyRequires: DirectXWorks better with: PhysX

Package ManagersLow LevelUnpacking packagesRun configuration scriptsDependency checks

Package ManagersHigh LevelFetch from remote repositoriesSearchInstall additional packages to meet dependenciesHandle complex upgradesPackage RepositoryCollection of packagesMaintained by distributionMultiple versionsIndexPackage ManagersRPM BasedDEB BasedLow levelRPMDpkgHigh levelYUM, up2date, APTDebian DPKG & APTFocus onTypes of PackagesBinary PackageMeta PackageVirtual PackageBinary PackageNormal packageSource is availableArchitectureDependentCompiled binary filesIndependentScriptsDocumentsData filesMeta PackageDepends on other packages onlyRenamegit-core -> gitDefault versiongcc -> gcc-4.6Python -> python2.7Can be creative!Virtual PackageDoes not really existNames common functionalityOther binary packages provide a virtual packagec-compiler is provided bygccgcc-4.6clangCommonly Used Commandsapt-getapt-cacheaptitudeFrontend to the first 2 commandsSearch for a packageapt-cache search ^vim$

Search patternState flagsSearch PatternsPatterns are regular expressionsAptitude supports complex patternsSee referenceSearch requires guessingJust like GooglingDifferencesAptitude and apt-cache have slighty different behaviorAptitude looks at package name onlyApt-cache looks at description as wellState FlagsiInstalledcRemovedpPurgedvVirtual packageBBroken dependenciesuUnpackedCHalf-configuredHHalf-installedTry it!You want to install a web server. What do you look for?What should you actually install?Looking at a packageWeb interfacehttp://packages.debian.orgCLIapt-cache show XXXaptitude show XXXDebian Control FileTry it now!

Package InfoNameStateVersionPrioritySectionMaintainerArchitectureDependenciesDescription

Package Info - Stateinstallednot installedremoved

Package Info - VersionVim: 2:7.3.547-6

2: -> Epoch7.3.547 -> Upstream version-6 -> Debian package revisionPackage Info - PriorityRequiredImportantStandardOptionalExtraPackage Info - DependenciesDependsRecommendsSuggestsConflictsReplacesBreaksProvidesSyntax: http://www.debian.org/doc/debian-policy/ch-relationships.htmlConflicts is stronger than Breaks31Installing / Removingapt-get install XXXaptitude install XXX

remove/purgehold/unholdupgradedist-upgraderemove vs. purgeRemove keeps config files in systemPurge = Remove + delete config fileshold/unholdKeep a package at a specific state/version unless explicitly request otherwise

upgrade vs. dist-upgradeupgrade only updates currently installed packagesdist-upgrade will do anything to satisfy all new dependenciesTry it now!Install a web serverThen remove itSee that config files are still thereThen purge itMaking a PackageWhy?CustomizeSoftware not packaged yetBecome a maintainer?Build your ownMaking your first packageBasic structurepackage/XXXFiles you want to packagepackage/DEBIAN/controlDebian control filepackage/DEBIAN/xxxPackage scripts, other control filesdpkg-deb b packageHomework Build a meta package

Name: nasa-hwShould always installgcc no older than 4.7make newer than 3.80Should not install whenclang is installedMaintainer: Your ID Use your judgment for other fieldsRead the documents!Submit .deb file

Too simple?Debian related source codesource/debian/rulessource/debian/controlsource/debian/changelogsource/debian/

Guidelines for packagingDebian http://www.debian.org/doc/manuals/maint-guide/Get other package sources and see how other people do itapt-get source XXXPackages for packagingbuild-essentialdpkg-devdebhelperCDBSdh_makelintian

build-essentialMeta package that depends on essential tools for packagingYou need to install additional tools/librariesdebhelper, cdbs, lib*-dev

dpkg-devBasic tools for package developmentdpkg-buildpackageDebhelperCollection of commands to assist packagingWraps complex stepsSplitting files between different packagesGenerating shared library dependenciesGenerate and sign binary packagesCDBSCommon Debian Build SystemClass based systemSupports different build systemsmake, ant, cmake, http://www.slideshare.net/petereisentraut/the-common-debian-build-system-cdbsdh_makePrepare source code for packagingAlways uses debhelperSupports CDBS

lintianCheck packages for errorsSteps to packaginghttp://www.debian.org/doc/manuals/maint-guide/first.en.htmlGet source codeUnpackdh_makeInstall build dependenciesCheck control fileCheck installation pathsBuild packagedpkg-buildpackage -b

HomeworkBuild a package of Omnittyhttp://omnitty.sourceforge.net/You will also need to build a package for ROTEhttp://omnitty.sourceforge.net/Build it, install it, and try it outSubmit .deb for omnittyTipsPackages you can look atlibeventscreentmuxmake

Homework Recapnasa-hw meta packageomnitty binary packageLeave your packages on 217 workstationMail the path of your package to wens_at_csie.orgStart sooner! You need to do research to finish this assignment.