Using Pbuilder to (Cross-)Build Debian Packages

One day I wanted to build a program for a 64-bit ARM OS with basic dpkg support. Since its binaries for x86 and the corresponding source code had been adapted and maintained as Debian packages by several distros, an easy way for me would be to grab the source code of one package, cross-build it for ARM 64 architecture, …

Install & Explain SSL Certificates

This is a repost of this answer on Ask Ubuntu, which, primarily showing how to install SSL certificates on CLI, explains as well what happens behind the scene when a certificate verification error occurs1. This work is licensed under the Creative Common Attribute-SharedAlike 3.0 Unported License , as the original post …

Create a Minimalist `Chroot` Environment

Learnt from this article by Dave McKay . Create the root directory of the chroot environment if it doesn’t exist. 1chr=/home/ricky/testroot 2mkdir -p $chr Create necessary directories and then get into the environment. 1mkdir -p $chr/{bin,lib,lib64} 2cd $chr Copy the binaries we need for surviving on this …

Linux 中查看某程序的路径

查看一个程序的完整路径,除了可以了解其是否存在及所处的位置,还有更重要的作用:当系统中有多个同名程序安装在不同目录下时,检查程序的完整路径可以帮助我们确认其是否为我们想要执行的那个。在 Linux 系统中,我习惯使用 which 或 whereis 来查看一个命令的完整路径。 1$ which gcc 2/usr/bin/gcc 但有一天,我遇到了一个情况:程序明明可以在 Bash 里执行,但 which 就是找不到它。后来搜索到这条回答 才了解到,对路径中可能带有的一些特殊符号(如常用的 ~)而言,Bash 会在执行前解析并替换它们;而 which 却不会。因此,若是在 .bashrc 中写入 1export …

About Initramfs

1. What is initramfs? It is ramfs that serves as an initial rootfs. It contains a complete set of directories that you would find on a normal root filesystem. It is bundled into a single cpio archive and (optionally) further compressed by one of the common compression algorithms like gzip or xz. 2. What is it used for? …