Skip to content

Guide to contributing, Linux packages

Nguyễn Phước Thành Lâm edited this page Sep 23, 2026 · 10 revisions

Introduction

ciya-logo-wiki

Welcome to Ciya Wiki. Today, we'll learn how to turn the binary into packages. Many people think turning it into a package takes a really long time, but it's only true if you're doing it the manual way. But if you need to ship it in as little time as possible. You need a tool, or what I use: FPM (aka. Effing Package Management). It's a tool to easily create packages more easily and faster.

But to get the packages, you first need curl (or wget) to access the file and to install it, depending on the distro that you're using, you may need to change the package name here or the way you install it, but here's the Ubuntu one:

sudo apt update && sudo apt install curl

RHEL one:

sudo dnf install curl # On morden RHEL version
sudo yum install curl # On older RHEL version

Guide for making packages using FPM:

If you already have fpm, then congrats! But before that, double-check everything first by typing this command:

fpm --version

If it prints out a version like my current one, 1.17.0 then you're good to go. Otherwise, if it doesn't have it or gives you an error, then type:

gem install fpm

Or go to the website here: https://fpm.readthedocs.io/en/latest/installation.html

If you already have fpm, then here's the command to use it:

fpm -s dir -t <package name> -n ciya-linux -v <version> /path/to/local/file=/usr/bin/file

If the package name is not supported. You may need to find it from the official website of the distro or just fact-check it yourself.

But if you want to support all distros, this is the way to make a tarball:

tar -czvf archive_name.tar.gz /path/to/file_or_directory

Note:

  • When making the package, use usr/bin, not your personal one; or stuff will happen
  • I recommend using a Dockerfile to test it; otherwise, if it fails, please check for bugs and report to us

That's all for the guide to making a package!

Guide for making packages using nFPM:

If you don't want to be in the gem ecosystem, or may have opted out for some reason, you can use nFPM. nFPM is an alternative to FPM, and first install and use brew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # If you don't have brew yet
brew install nfpm

Secondly, check if installed:

nfpm --version

If it has an output like v2.47.0, then you can proceed; otherwise, you can't and may need to check brew or redo the installation.

Write a YAML script, but we had already written it, so you don't have to.

And lastly, create a package out of it, for example using Debian packages:

nfpm package --config config/nfpm.yaml --target ciya.deb 

Note:

  • It'll be much harder to use nFPM, so I recommend using FPM to save time
  • Instead of using brew, you can actually use go (go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest) and more ways, but I think brew is the most time-saving
  • Test the file using Docker or a spare VM; it may fail

Guide for getting the packages:

Now, you know how to make a Linux package. This is an introduction to obtaining the files. I recommend you
use a tarball (tar.gz) as it's more supported and universal across Linux distros. You can read the README for an introduction. But here's how. You don't have to use wget or curl, and you can just manually download it. Here's the command to extract the file:

First, get the file:

curl -o ciya.tar.gz -L https://github.com/Ciya-VM/Ciya/archive/refs/tags/v0.0.3.tar.gz # This is to grab the file

Then, extract it:

tar -xvzf tar_file.tar.gz /path/to/destination # An old way of extracting files

Then, if you try to run the binary, it might not work, so we have to run the command:

chmod +x <binary file>

And, lastly, run it; you're done. But to run it, it's simple; here's the command:

./<binary file>

But you can do lots of ways, actually, and well, I don't blame you, and here's an example (on Debian):

curl -o ciya.deb -L https://github.com/Ciya-VM/Ciya/releases/download/v0.0.3/ciya-linux_0.0.3_amd64.deb
sudo apt install ciya.deb
ciya

Q&A

I hope the guide helps, but if you have any problems or questions, I'll reply in a few hours to a few days. But, hope you have a good day =).

The original creator, Johnryzon Z. Abejero

Contributor:

  • Nguyễn Phước Thành Lâm