Preface

Goal: Examine Package Manager, Focus on Command Line Interface

Heaven does exist !

I have been dreaming of having my own lab, examining variety of package manager, using my own notebook. Five years has past, yet still broken dreams I have. I cannot afford high end machine with virtual machine performance. Like a dream come true, docker allow me to install, other distribution without CPU burden. I finally fulfill my destiny.

I can use Docker to learn package management such as, Crux’s Ports, Gentoo’s Portage, Slackware’s Package, Void Linux’s XBPS, Fedora’s DNF, openSUSE’s Zypper, Debian’s APT, and LFS’s Build. Of course they are all interesting.

Diversity

People see Diversity in Linux, as Distribution. Beginner can see how a system can use many Desktop Environment. And coder can see that they can rewrite from one scripting language to another. This is true, but inaccurate. There are other frontier, that is actually fundamental, from the perspective of Operating System.

I do think that we need more focus on other main diversity as well such as

  • Package Manager

  • Init

  • File system

This will encourage beginner to go deeper, than just mainstream blogger topic, such as apt, systemd-based, and ext4-only. Enable broader range of discussion. Gain more diverse knowledge. Thus empower our beloved community.

But I could be wrong about that.

As a result, beginner should narrow how to choose their OS, from choosing distro to choosing package manager.

An enthusiast user should experience package management diversity in linux. And try each. Otherwise, most beginner would stuck, in the mainstream APT-based distribution, as you can see the fact in distrowatch top list.

Testing Tools

The issue with package management learning is, you have to live with it.

The downside of learning package manager is, the need of good internet connection.

There are a few methods.

  • Multiboot. But install so distribution many would be exhausted.

  • Virtualization such as Virtual Box. I only have dual core.

  • Docker or LXC. I actually use docker to learn other Portage and Slackpkg. This is suitable for my resource limitation. As an alternative, there is this LXC. I do not use LXC anymore.

  • Live OS (not recommended). You cannot just use flash disk, trying some command line, and pretend you understand package manager.

Persistence Docker Process

Anyone new with Docker should differ between LXC and Docker. With LXC, the state changed as we exit each image. With Docker, each time we run image, docker spawn a new process.

We need a persistence state that our distro
keep the change we made after exiting the session.

This is why we should beware of the flow. Docker is different with LXC. Docker has image, and process. Each image an be spawn into several container process.

I wish you luck

Package Manager

Genre

This is some mainstream Package Management in Linux.

APT: Advanced Package Tool

ALPM: Arch Linux Package Management

RPM: RPM Package Manager

Portage:

XBPS: X Binary Package System

As for enthusiast user I give link for each source code. I am sure you all love manual.

	Do not forget to read the manual first.

Why don’t we go further to read the source code ?

Approximate Timeline for Linux Package Manager Frontend

Data taken from NEWS, wikipedia, Github First Commit, and Change Log. This may not be accurate.

Approximate Timeline for Linux Package Manager Frontend

  • maybe 1993: pkgtools/slackpkg

  • 1994: dpkg

  • 1997: rpm

  • 1998: apt-get

  • 1999: aptitude

  • 2000: portage/emerge

  • 2000: ports/prt-get

  • 2002: pacman/makepkg

  • 2003: yum

  • 2003: slapt-get

  • 2006: zypper

  • 2008: yaourt

  • 2010: xbps

  • 2010: package-query

  • 2010: cower

  • 2010: packer

  • 2011: pacaur

  • 2012: aura

  • 2013: apt

  • 2014: slpkg

  • 2014: asp

  • 2015: dnf

  • 2016: eopkg


Flow for Learning Linux Distribution

Since we want a persistence distro, we only need one process. So here the step.

(1) Terminal 1: List all images.

If this is empty, you can pull for docker hub.

$ sudo watch docker image list

Terminal 1

(2) Terminal 2: List all processes.

This list could be emptyor has several processess. You can delete all unnecessary processes, and start with a clean process.

Note that you can show based on docker id, or docker names.

$ sudo watch docker  ps -as

or

$ sudo docker ps -a --format 'table {{.Image}}\t{{.Names}}\t{{.Status}}'

or

$ sudo watch "docker ps -a --format 'table {{.Image}}\t{{.Names}}\t{{.Status}}\t{{.Size}}'"

Terminal 2

You can add the size, so you can monitor how the process grow as you work with your container. But size take a longer calculation as a drawback.

(3) Terminal 3: Run an image to create process

Do use interactive.

$ sudo docker run -it vbatts/slackware

And exit from process. You can start later.

sh-4.3# exit

Terminal 3

A new process will be shown in process list such as inspiring_davinci. Docker give random name automatically.

(4) Terminal 4: Attach process to your favorite terminal

$ sudo docker start inspiring_davinci
$ sudo docker attach inspiring_davinci

Terminal 1

Do not forget to press any character. The docker wait for your response.

After you exit, you need to start the process again.

(5) Open New Terminal

sudo docker exec -it inspiring_davinci bash

Tips: Without sudo

To avoid typing sudo all the time, add user in /etc/group.

docker:x:1000:epsi

Do not forget to logout, and relogin.

Tips: Alias

For convenience you may put aliases to ~/.bashrc.

alias docker-ps="docker ps -a --format 'table {{.Image}}\t{{.Names}}\t{{.Status}}'"
alias docker-ls="docker image list --format 'table {{.Repository}}\t{{.Size}}'"

Alias


Screenshot:

  • OS: Artix Linux

  • WM: Herbstluftwm

Docker All Screenshot:

Alternative: Artix LXC

OS: Artix Linux (formerly Manjaro-OpenRC)

  • Window Manager: HerbstluftWM

  • Panel: Lemonbar

  • Wallpaper: Original Wallpaper

Container: LXC

  • Client: Gentoo

  • Running: emerge

Artix LXC: Gentoo Emerge

Alternative: Manjaro LXC

OS: Manjaro-OpenRC

  • Window Manager: Awesome (floating mode)

  • Running: pacman, emerge, yum, apt

Manjaro LXC


Docker Collection

These are some docker containers, that I utilize in this blog. For each I provide the command. In addition the default latest tag, you can use other tag such as tumbleweed, rawhide, stretch.

There are [ links ] for each docker topic, each article has deeper package management discussion.

SlackPkg

Article: [ Slackware - Package ]

$ docker pull vbatts/slackware
$ docker run -it vbatts/slackware

: Slackware: C

  • Package Cache (slackpkg)

slapt-get

slpkg

Portage Frontend

Article: [ Gentoo - Portage ]

$ docker pull gentoo/stage3-amd64
$ docker run -it gentoo/stage3-amd64

Emerge

Gentoo: NCDU

XBPS

Article: [ Void - XBPS ]

$ docker pull voidlinux/voidlinux
$ docker run -it voidlinux/voidlinux bash

XBPS: C

Crux Ports

Article: [ Crux - Ports ]

$ docker pull crux
$ docker run -it crux

Pkgutils: Crux: C

Frontend

Docker Pull Crux Linux

ALPM Frontend, ASP and AUR Helper”

Article: [ Arch - ALPM ]

$ docker pull dock0/arch
$ docker run -it dock0/arch

Docker Pull Arch Linux

ALPM = “Arch Linux Package Management”

Note that ABS tools is deprecated.

Pacman: C

ASP: BASH

Cower: C

Package Query: C

AURA: Haskell

Pacaur: BASH/C

Packer: BASH

Yaourt: BASH/C

Arch: NCDU

RPM Frontend

I do not cover RPM here.

Format

RPM: C

RPM is special in a way that RPM has many front end implementation.

Frontend

URPMI: Mageia: Perl

YUM: Python

DNF Frontend

Article: [ Fedora - DNF ]

$ docker pull fedora:rawhide
$ docker run -it fedora:rawhide bash

Docker Pull Fedora Rawhide

DNF (Dandified YUM): Fedora: Python

ZYpp Frontend

Article: [ openSUSE - Zypper ]

$ docker pull opensuse/amd64:tumbleweed
$ docker run -it opensuse/amd64:tumbleweed bash

Docker Pull openSUSE Tumbleweed

Zypper: openSUSE

APT Frontend

Article: [ Debian - APT ]

$ docker pull debian:stretch
$ docker run -it debian:stretch

Docker Pull Debian Stretch

APT: Python

DPKG: C: Eight Years Ago

apt-src

  • No github yet

apt-get

  • No github yet

aptitude

  • No github yet

LFS Build

Article: [ LFS - Build ]

$ docker pull kevinleptons/lfs-auto
$ docker run -it voidlinux/voidlinux bash

Miscellanous Docker

$ docker pull busybox
$ docker run -it busybox

Docker Pull BusyBox

Other Frontend

Sol (eopkg replacement in Solus): C


Thank You

#respect

My intention is to give appreciation to the community, because I have many riddled that, I can’t solve without help from the Community. I hope this people do not mind that I put their name here.

  • Arch Linux: “Dean Wallace”:

  • Fedora: “Станислав Нижниченко:, “s10e G” , “Flavio R. Cavalcanti”

  • openSUSE: “Tim Baker”:

  • Slackware: “Roberto Val”, “Flavio R. Cavalcanti”

  • Gentoo: “Darko Luketic”

  • Void Linux: “cintrikz”:

  • Crux Linux: “pitillo”

  • LFS: “Michał Radwański”

Also “Michael Boyle” for EIX advice, and “Linux Lady05 Winter” for giving support, and “Pașca Alexandru” for BTRFS issue for my First openSUSE install.

Thank you so much for being helpful. You are all great sweet people.


Conclusion

This is just a summary, we have not finished yet. There are links for each docker topic on top of this page. Consider reading each topic.

[ Debian - APT ] [ openSUSE - Zypper ] [ Fedora - DNF ] [ Arch - ALPM ] [ Crux - Ports ] [ Void - XBPS ] [ Slackware - Package ] [ Gentoo - Portage ] [ LFS - Build ]

Dream come true

Thank you for reading