Ah, Debian. The king of stability. It’s like the tortoise in the race, always slow and steady, never rushing to update to the latest shiny software versions. That’s great for most things, but sometimes, you need the latest features and improvements - especially when you’re working with software that’s always evolving.
Take Ceph, for example. It’s a massively scalable, distributed storage system, and it moves fast. While Debian Buster (the stable release) only has Ceph 12.2.11 (Luminous), the upstream team is already rolling out newer versions — like Nautilus. Of course, the official Ceph binary packages are mostly targeted at RedHat, CentOS, SUSE, and Ubuntu. But what about Debian? A Debian-based distribution (Ubuntu) gets all the love, but Debian itself? Nope, it’s often left in the cold.
So, what do you do when you need Ceph Nautilus on Debian Buster? Well, you get your hands dirty and build it yourself!
Here’s a fun, step-by-step guide on how I built Ceph Nautilus for Debian 10 Buster. Let’s get into it.
First things first, let’s fire up a Docker container. We’ll be using it as our clean build environment. This keeps things tidy and ensures that the build process doesn’t interfere with your host machine.
$ docker run -ti --name dbuild --hostname dbuild debian:10-slim /bin/bash
(dbuild)$ apt-get --no-install-recommends install wget vim-minimal build-essential fakeroot
We’ve got the essentials: wget for fetching files, vim for editing, build-essential for compiling, and fakeroot to simulate root privileges (without actually being root).
To build Ceph, you need the source files. Fortunately, the Ceph Nautilus source for Ubuntu Xenial is available. We’re going to grab those files so we can build our Debian package.
(dbuild)$ mkdir ceph && cd ceph
(dbuild:~/ceph)$ wget https://download.ceph.com/debian-nautilus/pool/main/c/ceph/ceph_14.2.2.orig.tar.gz
(dbuild:~/ceph)$ wget https://download.ceph.com/debian-nautilus/pool/main/c/ceph/ceph_14.2.2-1xenial.dsc
(dbuild:~/ceph)$ wget https://download.ceph.com/debian-nautilus/pool/main/c/ceph/ceph_14.2.2-1xenial.diff.gz
(dbuild:~/ceph)$ ls -l
total 114796
-rw-r--r-- 1 root root 218 Jul 18 00:06 ceph_14.2.2-1xenial.diff.gz
-rw-r--r-- 1 root root 6121 Jul 18 00:06 ceph_14.2.2-1xenial.dsc
-rw-r--r-- 1 root root 117536881 Jul 17 23:57 ceph_14.2.2.orig.tar.gz
These three files are all we need:
.orig.tar.gz
Upstream original tarball file, pure tarball source file taken from the upstream without modification.
.dsc file
Description file contains a series of fields, identified and separated just like the fields in the control file of a binary package.
.debian.tar.gz or .diff.tar.gz file
Tarbal file contained any changes made to upstream source, plus all the files created for the Debian package.
Once they’re downloaded, let’s check them out.
(dbuild:~/ceph)$ ls -l
total 114796
-rw-r--r-- 1 root root 218 Jul 18 00:06 ceph_14.2.2-1xenial.diff.gz
-rw-r--r-- 1 root root 6121 Jul 18 00:06 ceph_14.2.2-1xenial.dsc
-rw-r--r-- 1 root root 117536881 Jul 17 23:57 ceph_14.2.2.orig.tar.gz
Next, we need to install all the dependencies for building Ceph. How do you know which ones to install? Easy. The .dsc file tells us. We just need to extract the list of required packages:
(dbuild:~/ceph)$ cat ceph_14.2.2-1xenial.dsc | grep ^Build-Depends:
Build-Depends: cmake (>= 3.5), cpio, cryptsetup-bin | cryptsetup, cython, cython3, debhelper (>= 9), default-jdk, dh-exec, dh-python, dh-systemd, git, gperf, javahelper, junit4, libaio-dev, libbabeltrace-ctf-dev, libbabeltrace-dev, libblkid-dev (>= 2.17), libcunit1-dev, libcurl4-openssl-dev, libexpat1-dev, libfuse-dev, libgoogle-perftools-dev [i386 amd64 arm64], libibverbs-dev, librdmacm-dev, libkeyutils-dev, libldap2-dev, libleveldb-dev, liblttng-ust-dev, liblz4-dev (>= 0.0~r131), libncurses-dev, libnss3-dev, liboath-dev, libsnappy-dev, libssl-dev, libtool, libudev-dev, libxml2-dev, librabbitmq-dev, lsb-release, parted, pkg-config, python (>= 2.7), python-all-dev, python-cherrypy3, python-setuptools, python-sphinx, python3-all-dev, python3-setuptools, uuid-dev, uuid-runtime, valgrind, virtualenv | python-virtualenv, xfslibs-dev, yasm [amd64], zlib1g-dev
Then, install all of those packages:
(dbuild:~/ceph)$ apt-get --no-install-recommends install cmake cpio cryptsetup-bin cython cython3 debhelper default-jdk dh-exec dh-python dh-systemd git gperf javahelper junit4 libaio-dev libbabeltrace-ctf-dev libbabeltrace-dev libblkid-dev libcunit1-dev libcurl4-openssl-dev libexpat1-dev libfuse-dev libgoogle-perftools-dev libibverbs-dev librdmacm-dev libkeyutils-dev libldap2-dev libleveldb-dev liblttng-ust-dev liblz4-dev libncurses-dev libnss3-dev liboath-dev libsnappy-dev libssl-dev libtool libudev-dev libxml2-dev librabbitmq-dev lsb-release parted pkg-config python python-all-dev python-cherrypy3 python-setuptools python-sphinx python3-all-dev python3-setuptools uuid-dev uuid-runtime valgrind python-virtualenv xfslibs-dev yasm zlib1g-dev
Now, let’s extract the source code and apply any Debian-specific patches. We’ll use the dpkg-source command to do this.
(dbuild:~/ceph)$ dpkg-source -x ceph_14.2.2-1xenial.dsc
dpkg-source -x ceph_14.2.2-1xenial.dsc
dpkg-source: warning: extracting unsigned source package (ceph_14.2.2-1xenial.dsc)
dpkg-source: info: extracting ceph in ceph-14.2.2
dpkg-source: info: unpacking ceph_14.2.2.orig.tar.gz
dpkg-source: info: applying ceph_14.2.2-1xenial.diff.gz
(dbuild:~/ceph)$ cd ceph-14.2.2/
Now, we need to tell Debian that we’re building a package for Debian Buster, not Xenial. To do this, we’ll edit the changelog file.
(dbuild:~/ceph-14.2.2)$ vi debian/changelog
ceph (14.2.2-1+1) unstable; urgency=medium
* Rebuild for Debian Buster
-- Superman <[email protected]> Wed, 17 Jul 2019 15:25:44 +0700
ceph (14.2.2-1) stable; urgency=medium
* New upstream release
-- Ceph Release Team <[email protected]> Wed, 17 Jul 2019 15:12:34 +0000
…
Now comes the exciting part: building the package! Run the following command:
(dbuild:~/ceph-14.2.2)$ dpkg-buildpackage -rfakeroot -us -uc
…
This will build all the .deb packages you need. It’ll take a while, but once it’s done, you’ll find the packages in the parent directory.
Once the build is complete, check the parent directory for the .deb files.
(dbuild:~/ceph-14.2.2)$ ls -l ../
…
total 3648428
-rw-r--r-- 1 root root 3796 Jul 31 21:47 ceph_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 227 Aug 1 11:20 ceph_14.2.2-1+1.diff.gz
-rw-r--r-- 1 root root 6105 Aug 1 11:20 ceph_14.2.2-1+1.dsc
-rw-r--r-- 1 root root 117536881 Aug 1 11:20 ceph_14.2.2.orig.tar.gz
-rw-r--r-- 1 root root 4307812 Jul 31 21:47 ceph-base_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 139592328 Jul 31 21:47 ceph-base-dbg_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 15386304 Jul 31 21:47 ceph-common_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 764596084 Jul 31 21:47 ceph-common-dbg_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 13648 Jul 31 21:47 cephfs-shell_14.2.2-1+1_all.deb
-rw-r--r-- 1 root root 526880 Jul 31 21:47 ceph-fuse_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 16778156 Jul 31 21:47 ceph-fuse-dbg_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 1803340 Jul 31 21:47 ceph-mds_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 92941300 Jul 31 21:47 ceph-mds-dbg_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 1307428 Jul 31 21:47 ceph-mgr_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 3044156 Jul 31 21:47 ceph-mgr-dashboard_14.2.2-1+1_all.deb
-rw-r--r-- 1 root root 44793180 Jul 31 21:47 ceph-mgr-dbg_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 34384 Jul 31 21:47 ceph-mgr-diskprediction-cloud_14.2.2-1+1_all.deb
-rw-r--r-- 1 root root 1091336 Jul 31 21:47 ceph-mgr-diskprediction-local_14.2.2-1+1_all.deb
-rw-r--r-- 1 root root 12364 Jul 31 21:47 ceph-mgr-rook_14.2.2-1+1_all.deb
-rw-r--r-- 1 root root 12872 Jul 31 21:47 ceph-mgr-ssh_14.2.2-1+1_all.deb
-rw-r--r-- 1 root root 3617888 Jul 31 21:47 ceph-mon_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 137428912 Jul 31 21:47 ceph-mon-dbg_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 19105644 Jul 31 21:47 ceph-osd_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 533638424 Jul 31 21:47 ceph-osd-dbg_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 6672 Jul 31 21:47 ceph-resource-agents_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 26997968 Jul 31 21:47 ceph-test_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 1006893728 Jul 31 21:49 ceph-test-dbg_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 445528 Jul 31 21:49 libcephfs2_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 15140648 Jul 31 21:49 libcephfs2-dbg_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 17148 Jul 31 21:49 libcephfs-dev_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 13492 Jul 31 21:49 libcephfs-java_14.2.2-1+1_all.deb
-rw-r--r-- 1 root root 554224 Jul 31 21:49 libcephfs-jni_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 3016060 Jul 31 21:49 librados2_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 96278648 Jul 31 21:49 librados2-dbg_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 1272940 Jul 31 21:49 librados-dev_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 26260 Jul 31 21:49 libradospp-dev_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 334192 Jul 31 21:49 libradosstriper1_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 10523264 Jul 31 21:49 libradosstriper1-dbg_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 8876 Jul 31 21:49 libradosstriper-dev_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 1461316 Jul 31 21:49 librbd1_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 85691456 Jul 31 21:49 librbd1-dbg_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 17192 Jul 31 21:49 librbd-dev_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 4062616 Jul 31 21:49 librgw2_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 215782076 Jul 31 21:49 librgw2-dbg_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 6984 Jul 31 21:49 librgw-dev_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 20272 Jul 31 21:49 python3-ceph-argparse_14.2.2-1+1_all.deb
-rw-r--r-- 1 root root 107520 Jul 31 21:49 python3-cephfs_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 370032 Jul 31 21:49 python3-cephfs-dbg_14.2.2-1+1_amd64.deb
-rw-r--r-- 1 root root 276040 Jul 31 21:49 python3-rados_14.2.2-1+1_amd64.deb
…
That’s it! We’ve successfully built Ceph Nautilus for Debian 10 Buster. It wasn’t too bad, right? By using Docker and following the steps above, you’ve managed to grab the latest Ceph release and compile it for your system.
Now, you’re all set to deploy Ceph with all its latest features and improvements — on Debian! Enjoy!