Lesson 6: Packages, Software, Libraries

Homepage Content Slides Video

Warning

This lesson is under construction. Learn from it at your own risk. If you have any feedback, please fill out our General Feedback Survey.

Software

Everything that isn’t hardware.

  • Code that is run on a Computer.
  • Binaries.
  • Scripts.

Libraries

  • Often used to make development easier.
  • Rarely run on it’s own.
  • Shared code.

Package Management

  • Automagically manage software and libraries on your system.
  • Examples:
    • Android Play Store
    • Apple App store
    • Steam

Core Package Management Functionality

TLDR: To take care of installation, removal, and updates of software.

Programming Langauge Package Managers

Examples:

  • Python: pip
  • Ruby: gem, rubygems
  • Haskell: cabal
  • NodeJS: npm
  • ... and so on forever ...

Other Package Managers

Portage
The Source-based package manager for Gentoo.
Yaourt
An Arch User Repository wrapper for Pacman, the Arch Linux Package manager.
Nix
A ‘Fully Functional/Transactional’ package manager.
Brew
An Open Soruce package manager for OSX.
Chocolatey
A package manager for Windows.

Installation from Soruce

How to install a package from source:

Using grep as an example:

$ wget http://mirrors.kernel.org/gnu/grep/grep-2.25.tar.xz
$ tar -Jxvf grep-2.25.tar.xz
$ cd grep-2.25
$ ./configure --prefix=$HOME/bin/
$ make
$ make install

TODO: Install sl

  • Install the git, gcc, make, ncurses-bin, ncurses-base, libncurses5-dev, and libncurses5-dev packages via package manager.
$ sudo apt install git gcc make ncurses-bin ncurses-base libncurses5-dev libncurses5-dev
[...]
  • Install sl from source into the directory ~/bin/.
$ git clone https://github.com/mtoyoda/sl.git
[...]
$ cd sl
$ make
gcc -O -o sl sl.c -lncurses
$ mkdir ~/bin
$ ln sl ~/bin/
$ echo "export PATH=$PATH:$HOME/bin" >> ~/.bashrc
$ source ~/.bashrc
$ whereis sl
sl: /home/username/bin/sl
$ sl

Further Reading