Package Managers What are they and why we use them.

  • Published on
    24-Dec-2015

  • View
    212

  • Download
    0

Embed Size (px)

Transcript

<ul><li> Slide 1 </li> <li> Package Managers What are they and why we use them </li> <li> Slide 2 </li> <li> 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 </li> <li> Slide 3 </li> <li> - LOL </li> <li> Slide 4 </li> <li> Before Packages Install from source Time consuming Varying configuration </li> <li> Slide 5 </li> <li> Improvement 1 Copy the binaries Setup scripts? Version? Dependencies? </li> <li> Slide 6 </li> <li> Package - Basic Archive Binaries Supporting files Setup script </li> <li> Slide 7 </li> <li> Package Improvement Versioning 1.0.x 1.1.x Upgrades! </li> <li> Slide 8 </li> <li> Package - Dependencies Program A requires library B to work If library C is available, program A will work better/faster! </li> <li> Slide 9 </li> <li> Example Call of Duty Requires: DirectX Works better with: PhysX </li> <li> Slide 10 </li> <li> Package Managers Low Level Unpacking packages Run configuration scripts Dependency checks </li> <li> Slide 11 </li> <li> Package Managers High Level Fetch from remote repositories Search Install additional packages to meet dependencies Handle complex upgrades </li> <li> Slide 12 </li> <li> Package Repository Collection of packages Maintained by distribution Multiple versions Index </li> <li> Slide 13 </li> <li> Package Managers RPM BasedDEB Based Low levelRPMDpkg High levelYUM, up2date, APT </li> <li> Slide 14 </li> <li> DEBIAN DPKG &amp; APT Focus on </li> <li> Slide 15 </li> <li> Types of Packages Binary Package Meta Package Virtual Package </li> <li> Slide 16 </li> <li> Binary Package Normal package Source is available Architecture Dependent Compiled binary files Independent Scripts Documents Data files </li> <li> Slide 17 </li> <li> Meta Package Depends on other packages only Rename git-core -&gt; git Default version gcc -&gt; gcc-4.6 Python -&gt; python2.7 Can be creative! </li> <li> Slide 18 </li> <li> Virtual Package Does not really exist Names common functionality Other binary packages provide a virtual package c-compiler is provided by gcc gcc-4.6 clang </li> <li> Slide 19 </li> <li> Commonly Used Commands apt-get apt-cache aptitude Frontend to the first 2 commands </li> <li> Slide 20 </li> <li> Search for a package apt-cache search ^vim$ Search pattern State flags </li> <li> Slide 21 </li> <li> Search Patterns Patterns are regular expressions Aptitude supports complex patterns See referencereference Search requires guessing Just like Googling </li> <li> Slide 22 </li> <li> Differences Aptitude and apt-cache have slighty different behavior Aptitude looks at package name only Apt-cache looks at description as well </li> <li> Slide 23 </li> <li> State Flags </li> <li> Slide 24 </li> <li> Try it! You want to install a web server. What do you look for? What should you actually install? </li> <li> Slide 25 </li> <li> Looking at a package Web interface http://packages.debian.orghttp://packages.debian.org CLI apt-cache show XXX aptitude show XXX Debian Control File Try it now! </li> <li> Slide 26 </li> <li> Slide 27 </li> <li> Package Info Name State Version Priority Section Maintainer Architecture Dependencies Description </li> <li> Slide 28 </li> <li> Package Info - State installed not installed removed </li> <li> Slide 29 </li> <li> Package Info - Version Vim: 2:7.3.547-6 2: -&gt; Epoch 7.3.547 -&gt; Upstream version -6 -&gt; Debian package revision </li> <li> Slide 30 </li> <li> Package Info - Priority Required Important Standard Optional Extra </li> <li> Slide 31 </li> <li> Package Info - Dependencies Depends Recommends Suggests Conflicts Replaces Breaks Provides Syntax: http://www.debian.org/doc/debian- policy/ch-relationships.html http://www.debian.org/doc/debian- policy/ch-relationships.html </li> <li> Slide 32 </li> <li> Installing / Removing apt-get install XXX aptitude install XXX remove/purge hold/unhold upgrade dist-upgrade </li> <li> Slide 33 </li> <li> remove vs. purge Remove keeps config files in system Purge = Remove + delete config files </li> <li> Slide 34 </li> <li> hold/unhold Keep a package at a specific state/version unless explicitly request otherwise </li> <li> Slide 35 </li> <li> upgrade vs. dist-upgrade upgrade only updates currently installed packages dist-upgrade will do anything to satisfy all new dependencies </li> <li> Slide 36 </li> <li> Try it now! Install a web server Then remove it See that config files are still there Then purge it </li> <li> Slide 37 </li> <li> MAKING A PACKAGE </li> <li> Slide 38 </li> <li> Why? Customize Software not packaged yet Become a maintainer? Build your own </li> <li> Slide 39 </li> <li> Making your first package Basic structure package/XXX Files you want to package package/DEBIAN/control Debian control file package/DEBIAN/xxx Package scripts, other control files dpkg-deb b package </li> <li> Slide 40 </li> <li> Homework Build a meta package Name: nasa-hw Should always install gcc no older than 4.7 make newer than 3.80 Should not install when clang is installed Maintainer: Your ID Use your judgment for other fields Read the documents! Submit.deb file </li> <li> Slide 41 </li> <li> Too simple? Debian related source code source/debian/rules source/debian/control source/debian/changelog source/debian/ </li> <li> Slide 42 </li> <li> Guidelines for packaging Debian http://www.debian.org/doc/manuals /maint-guide/http://www.debian.org/doc/manuals /maint-guide/ Get other package sources and see how other people do it apt-get source XXX </li> <li> Slide 43 </li> <li> Packages for packaging build-essential dpkg-dev debhelper CDBS dh_make lintian </li> <li> Slide 44 </li> <li> build-essential Meta package that depends on essential tools for packaging You need to install additional tools/libraries debhelper, cdbs, lib*-dev </li> <li> Slide 45 </li> <li> dpkg-dev Basic tools for package development dpkg-buildpackage </li> <li> Slide 46 </li> <li> Debhelper Collection of commands to assist packaging Wraps complex steps Splitting files between different packages Generating shared library dependencies Generate and sign binary packages </li> <li> Slide 47 </li> <li> CDBS Common Debian Build System Class based system Supports different build systems make, ant, cmake, http://www.slideshare.net/petere isentraut/the-common-debian- build-system-cdbs http://www.slideshare.net/petere isentraut/the-common-debian- build-system-cdbs </li> <li> Slide 48 </li> <li> dh_make Prepare source code for packaging Always uses debhelper Supports CDBS </li> <li> Slide 49 </li> <li> lintian Check packages for errors </li> <li> Slide 50 </li> <li> Steps to packaging http://www.debian.org/doc/manual s/maint-guide/first.en.html http://www.debian.org/doc/manual s/maint-guide/first.en.html 1. Get source code 2. Unpack 3. dh_make 4. Install build dependencies 5. Check control file 6. Check installation paths 7. Build package dpkg-buildpackage -b </li> <li> Slide 51 </li> <li> Homework Build a package of Omnitty http://omnitty.sourceforge.net/http://omnitty.sourceforge.net/ You will also need to build a package for ROTE http://omnitty.sourceforge.net/http://omnitty.sourceforge.net/ Build it, install it, and try it out Submit.deb for omnitty </li> <li> Slide 52 </li> <li> Tips Packages you can look at libevent screen tmux make </li> <li> Slide 53 </li> <li> HOMEWORK RECAP </li> <li> Slide 54 </li> <li> nasa-hw meta package omnitty binary package Leave your packages on 217 workstation Mail the path of your package to wens_at_csie.org Start sooner! You need to do research to finish this assignment. </li> </ul>

Recommended

View more >