Table of Content
Table of Content
There are few sections here.
- Preface: Postpone, Reading, Test Bed
- Getting Started With Docker
- No Package Management
- Requirement Check
- No Dependency Resolver
- Example 1: less: Detail
- Example 2: man-db: Dependency, Detail
- Resolving Dependency: cheat
Goal: Examine Package Manager, Focus on Command Line Interface
You jump, I jump !
LFS (Linux From Scratch) is once scary for me when I was a beginner, but do not let the fear intimidate you. Once you jump to LFS and swim, you will know that the myth is not true at all.
This LFS is even easier with docker container, avoid daunting task such as setting up system. Therefore we can dive right away to compilation.
Here is I share my LFS experience. Of course this won’t we a full blown experience, since I have decided to postpone LFS learning.
Unfortunately, I failed in some process, and I do not even know, whether it is my stupidity as usual, or by lack of docker limitation knowledge I have rarely give up, but I must admit I’m running out of time.
All I can say is, I have to pending this LFS experience, and continue LFS in chroot environment. I will write article later about this LFS.
Operating System: Artix (OpenRC )
Window Manager: Herbstluftwm
Since we are going to use docker again, you can read a common overview here.
Of course you can use virtualization, the issue is distraction. We need to avoid tendency to focus on GUI tools. At the same time, limiting the scope to CLI tools. Most of the time, CLI tools is considered lower level than the GUI one.
Getting Started With Docker
As usual, first, we do attach docker process.
No Package Management
LFS use no Package Manager. You have to download manually and compile by yourself, sometimes with feeling of being stupid in the corner. But hey… you are going to feel closer to each package, and feel the intimacy too, which is good for learning
Using guidance from LFS chapter 2.
No Dependency Resolver
The fact that LFS has no package management, means you need to compile all the packages directly from source. Most compilation error that I experience comes from dependency issue. Most compilation works well after I address the dependency issue.
I was once trying to compile
on my first jump to LFS in docker, and failed miserably.
Then I realize
My second attempt is
less, as I predict,
less does not need any dependency.
My third attempt is compile
man-db required a few package as dependency.
But after all, the process has been completely done.
Here is the steps, by trial and error.
install ncurses: succeed
install less: succeed
configure depend on pkg-config
configure depend on libpipeline
configure depend on gdbm
make depend on groff
make using groff A4 failed
make using groff letter succeed
install pkg-config: succeed
install libpipeline: succeed
install gdbm: succeed
install groff: succeed
install man: succeed
Nomore fear now. I realized that I can do it by examining each error. In fact, I can cheat, by using other distro to identify the dependency.
Example 1: less
less is my first successful install.
less is also an easy example.
Just follow the procedure, and you are done.
Commonly the steps are
./configure, mostly with a few parameter.
make, sometimes with parameter.
Example 2: man-db
man-db depend on a few packages.
This package should be installed first:
Basic package dependency can be found here.
This is what it looks like, for beginer who never compile anything.
Since I use Docker in not an official way to practice LFS,
I also cheat using the host. I find a way to resolve dependency.
You can use
pactree using arch based distribution (ALPM).
Your package manager, might have similar tool.
Here is my screenshot using Artix Linux, the host of my docker.
slpkg deps-status --tree
dnf repoquery --requires man-db
zypper info --requires man
pacman -[S|Q]i man-db
xbps-query -R -x man-db
emerge -ep man-db
apt-cache showpkg man-db
Next time, I’ll check the dependency first before building my LFS package.
It has been an honour, being (almost) a LFS user.
This is just building LFS at a glance. Of course there are more than my limited knowledge. There is also more advance topic such as BLFS, ALFS, and CLFS.
Thank you for reading