20
Package Management Tim Liou (@lyt) 5/07 5/03 (Thu) 11:00 ~ 12:00 @ 217 5/10 (Thu) 11:00 ~ 12:00 @ 217

Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

Package ManagementTim Liou (@lyt)

5/075/03 (Thu) 11:00 ~ 12:00 @ 2175/10 (Thu) 11:00 ~ 12:00 @ 217

Page 2: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

Overview● Motivation● Package manager● Quick overview of Arch Build System (ABS)● In-Class Lab

Page 3: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

Motivation

Page 4: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

Manual Installation

http://kb.mozillazine.org/Installing_Firefox_on_Windows

Installation wizards are not scalable. (Do you remember last time you reinstall softwares of your choice while reinstalling your Windows box?)

Page 5: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

Manual Installationwget https://iperf.fr/download/source/iperf-3.1.3-source.tar.gztar zxf iperf-3.1.3-source.tar.gzcd iperf && ./configure && make && sudo make install

git clone https://github.com/django/django.gitcd djangosudo python setup.py install

● What if they have dependencies?● What if someday you want to remove

them safely?● What if they conflict with installed files?● What if you can’t afford compiling them?● What if the install scripts are malicious?● What if you want to upgrade them?

Page 6: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

Oops… I just ran Bumblebee’s install script with root

https://github.com/MrMEEE/bumblebee-Old-and-abbandoned/issues/123

rm -rf /usr /lib/nvidia-current/xorg/xorg

Page 7: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

Oops… I just ran Bumblebee’s install script with root

https://github.com/MrMEEE/bumblebee-Old-and-abbandoned/issues/123

Page 8: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

Oops… I just ran Steam’s install script with root

https://github.com/ValveSoftware/steam-for-linux/issues/3671

rm -rf “$STEAMROOT/”*

Page 9: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

Oops… I just ran Steam’s install script with root

https://github.com/ValveSoftware/steam-for-linux/issues/3671

Page 10: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

Package Manager

Page 11: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

The goal of package managerEnable the user do the following things with ease:

● Search & install new software● Upgrade software● Safely remove software● Verify the downloaded software content

Page 12: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

Language package manager

Page 13: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

System package manager

dpkg/aptpacman

rpm/yum/dnf

rpm/zypper

nix

Page 14: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

LPM vs SPM● Language package managers are good for quickly sharing code written

purely in that language with other developers.● Some Language package repository allows arbitrary developers to upload

packages. Hard to enforce package signing.● Most system package managers won't let you have multiple versions of a

library installed at all● System package, compare to Language package, usually have to be

checked more carefully to make sure it is acceptable

Page 15: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

How are you involved in?

Icons made by Freepik from www.flaticon.com is licensed by CC 3.0 BY

Developer Maintainer User

Work on upstream project

* Every distribution has their own maintainers* Create the distribution-specific experience* Package stability, default options, usability

Enjoy & give feedback

Page 16: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

Workflow

Icons made by SimpleIcon from https://www.flaticon.com is licensed by CC 3.0 BY

new release

report bugs,contribute code

patch, review, build

Download

report bugs

feature request

Page 17: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

Quick overview of Arch Build System (ABS)

Page 18: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

ABS● Official repository

○ core, extra, community, multilib, testing

● PKGBUILD○ a Bash script that contains the compilation and packaging instructions

● makepkg○ shell command tool which reads the PKGBUILDs, automatically downloads and compiles the

sources and creates a package tarball

● pacman○ install and remove the built packages and for fetching dependencies

● AUR○ a community-driven repository for Arch users

Page 19: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

In-Class Labhttps://tinyurl.com/y9azpp75

Page 20: Package Management - 國立臺灣大學Language package managers are good for quickly sharing code written purely in that language with other developers. Some Language package repository

References● https://www.csie.ntu.edu.tw/~hsinmu/courses/_media/nasa_17spring/slides/p

ackage_management.pdf● https://lwn.net/Articles/712318/● https://medium.com/@sdboyer/so-you-want-to-write-a-package-manager-4ae

9c17d9527● https://wiki.archlinux.org/index.php/Arch_Build_System● https://news.ycombinator.com/item?id=11096368