EU
  
You are currently viewing the European Union version of the site.
Would you like to switch to your local site?
15 MIN READ TIME

DEBREATE

How to roll your own Linux packages

Installing from existing repos is too easy for Aaron Peters, who’s decided to build his own native package. Here’s how you can follow in his footsteps.

OUR EXPERT

Aaron Peters has spent well over 20 years exploring the Linux ecosystem, yet still needed to dig into how this whole packaging thing works.

QUIK TIP

Assembling a .DEB file by hand isn’t that difficult, just a little finicky. They consist of a text file (debianbinary) and two archives (control.tar. xz and data. tar.xz). A post on the Ubuntu Forums (https:// ubuntuforums. org/show thread.php?t= 910717) gives a great stepthrough of assembling a binary Debian package.

The open source ecosystem provides us with such a bounty of great software. And while modern distributions have come a long way in collecting everything a typical user might want, you may still find something that’s “not in the repos.” And while you can just compile it and plonk it down on your system, in this article we’ll explore a couple of ways to make it fit in nicely with the rest of your software.

Distribution publishers also do a great job of collecting the best of open source software in their repos. Fedora contains an estimated 15,000 packages in its main repo alone, while Ubuntu boasts over 60,000. So why not use the ones they provide? There might be a couple of very good reasons you’d want to have software packaging in your pocket.

The most obvious reason to roll your Linux packages is for your own software. This needn’t be anything fancy... it could just be a useful script you created that you’d like to install to the system proper instead of just your ~/bin directory. Of course, you may also want to distribute it to a wider audience.

Furthermore, your distro’s repositories may not include the program you want. And while you could install it in the “old school” fashion (see boxout, right), installing a package gives you a clean way to manage it.

Finally, your distro may include the program in question, but at something less than the current version (especially if you’re running a Long Term Support version). You can always grab the most recent version of the binary and package it up to take advantage of the most recent features.

With these reasons in mind, we’ll look at a variety of easy-to-use-tools targeting major formats.

Anatomy of a package

There are a variety of package formats in the Linux world. And although they’re all unique, there are a number of properties common across them:

ᐳ Manifest/control file: this contains metadata about the package, such as name, version number, developer/ maintainer, and in the case of native packages, dependency information.

ᐳ Partial filesystem: packages contain only the portions of a directory structure that the program requires. In the simple example we’ll work with in the sections below, this consists of an executable (which will live in /usr/ bin), and two informational files that are distributed with the binary (which we’ll place in usr/share/doc/lazygit).

Unlock this article and much more with
You can enjoy:
Enjoy this edition in full
Instant access to 600+ titles
Thousands of back issues
No contract or commitment
Try for €1.09
SUBSCRIBE NOW
30 day trial, then just €11,99 / month. Cancel anytime. New subscribers only.


Learn more
Pocketmags Plus
Pocketmags Plus

This article is from...


View Issues
Linux Format
July 2022
VIEW IN STORE

Other Articles in this Issue


WELCOME
Open source security
Jonni’s playing with his little bag of open
REGULARS AT A GLANCE
Nvidia moves to open source kernel drivers
DRIVERS
LVFS hits 50 million updates
The Linux Vendor Firmware Service has now delivered a huge 50 million updates for computers around the world.
BLUETOOTH IN PIPEWIRE
Frederic Danis is a senior software engineer at
Razer releases stylish Linux laptop
Collaboration between the high-end laptop company and Lambda is powerful… and expensive.
GOING FOR GOLD!
Keith Edmunds is MD of Tiger Computing Ltd,
GNOME patent troll is finally stomped on
Rothschild Patent Imaging (RPI) forced to give up its patent rights.
GitLab moves to AlmaLinux
Development comes after CentOS 8 enters End of Life.
Firefox hits 100
Mozilla celebrates version 100.0 of its famed browser.
Distro watch
What’s down the side of the free software sofa?
PLAN FOR THE FUTURE
Matt Yonkovit is the head of open source
OPEN NVIDIA
Jon Masters has been involved with Linux for
KERNEL WATCH
Jon Masters summarises the latest happenings in the Linux kernel, because someone has to…
Answers
Got a burning question about open source or the kernel? Whatever your level, email it to lxf.answers@futurenet.com
Mailserver
WRITE TO US Do you have a burning
CherryTree
THE BEST NEW OPEN SOURCE SOF T WARE
Sherlock
Version: N/A Web: https://sherlock-project.github.io In addition
Simple Keylogger
Version: 2.7.1 Web: https://simplekeylogger.github.io The keylogger
Siren
Version: 0.10 Web: www.kariliq.nl/siren All operations
MediaInfo
Version: 22.03 Web: https://mediaarea . net/en/MediaInfo The project’s
Mechvibes
Version : 2.3.1 Web: https://mechvibes.com Mechvibes
yt-dlp
Version: 2022.04.08 Web: https://github.com/yt-dlp/yt-dlp Despite its
Eternal Lands
Version: 1.9.6 Web: www.eternal-lands.com If you
Speed Dreams
Version: 2.2.3 Web: www.speed-dreams.org Speed Dream developers
Snap Backup
Version: 6.4.0 Web: https://snapbackup.org Snap Backup
ugrep
Version: 3.7.9 Web: https://github.com/genivia/ugrep Ugrep includes built-in
REVIEWS
AMD Ryzen 7 5800X3D
Dave James contemplates what it is to be the fastest.
TurnKey Linux 17.0
Lethargy and laziness often get the best of him, but sometimes Mayank Sharma can turn the tables to his advantage.
Rolling Rhino Remix
A rolling Ubuntu release sounds so outrageous Mayank Sharma had to see for himself if it really delivers on its word and isn’t just a gimmick.
SysLinuxOS 11.3
Distros that take the kitchen sink approach don’t really appeal to Mayank Sharma… until, of course, he finds one that does.
Q4OS 4.8
Neither a big KDE user nor a fan of Windows, and yet Mayank Sharma can’t resist the charm of this KDE distro and its Windows installer.
Shattered Pixel Dungeon
The only certainties in life are death, taxes and middle management, and Neil Mohr knows which two are the least painful to deal with.
ROUNDUP
Full-featured CMS
Michael Reed takes a good look at five heavyweight professional content management systems that are all open source and completely free.
Get installed
Is the installation routine a helping hand or more of a slap in the face?
Support and community
Help for using the CMS and what to do when we hit difficulties.
The content editor
This is where you’ll be working in the CMS
Themes and customisation
How easy is it to change the look and layout of your site?
Suitability for beginners
You might be an expert, but the user of the system might not be.
Extra features
Does one CMS have any niceties that the other systems lack?
Extensions
Beyond the defaults, to what degree can you add features easily?
The verdict
Content management systems
HACKER’S TOOLKIT 2O22
Pretty boy and known pirate Jonni Bidwell shows how to tame your Parrot. Parrot Security OS, that is… 2022
Hack the planet/Parrot
Get started with a persistent USB install of Parrot Security OS
Hacking 101
Starting with the humble ping command and moving on to some stealthy network recon activities…
Nmap deep dive
Nmap, the stealthy port scanner, is a vital tool for any helpful hacker or nefarious network administrator’s arsenal.
Modern hacking, ethics and statistics
Read about the largest DDoS in history and how honing your hacking skills might help you prevent the next one…
Pi USER
CAUSING A PICO SCENE
Les Pounder works with groups such as the Raspberry Pi Foundation to help boost people’s maker skills
Rock Pi expands its range
Less appetising but just as filling, the China-based Rock Pi now delivers some SBC competition.
GPUs ARE GOish
External Pi ones.
299 winners!
Blasted into space.
Amiberry v5.0
Les Pounder loves the Amiga – he even started his journalism career with custom “disk magazines” on the school playground.
Pimoroni Servo 2040
Achieve precise motion control from Les Pounder’s tiny package.
Cheaper sense and sensor-abilities
The ever-frugal Les Pounder reveals how two of the cheapest sensors on the market can bring a wealth of data to your Raspberry Pi project.
Build your own smart home sensors
Discover how to install micro controllers and simple electronics to make our homes almost as smart as Matt Holder.
Set your Pi for mobile streaming video
Sean Conway helps you ride the rails with a Raspberry Pi and its camera, with a bit of streaming video trickery thrown in for good measure.
IN DEPTH
LINUX IN SPACE!
From a shaky start, Linux is becoming much more established in astronautics. Mike Bedford looks at its success to date and its future prospects.
TUTORIALS
Making presentations from the command line
Although renowned for concocting far better excuses than cocktails, Shashank Sharma is quite adept at making presentations.
How to control Docker over the internet
Nick Peers discovers a user-friendly, convenient and powerful way to administer your Docker containers from wherever you happen to be.
Emulate the classic 8-bit Commodore 16
Les Pounder revisits Commodore’s low-cost computer from the mid-80s and finds out how it compares to its more illustrious stablemate.
Design 3D parts with computer aided design
Make a 3D part in FreeCAD’s Sketcher workbench with Michael Reed, even if you think an orthographic view is the inside of someone’s mouth.
Set up picture-perfect online photo storage
In a flurry of paranoia, David Rutland expels Google Photos from his life and sets up self-hosted photo storage on the semi-official Linux Format VPS.
TOP OF THE FOSS!
TOP OF THE POP! _OS
System76 developer Michael Murphy shares his Pop!_OS insights with Linux Format’s self-proclaimed top Pop fan Jonni Bidwell.
CODING ACADEMY
Code read/write system file tools
So, you woke up today wanting to know how to use file input and output calls to code system tools in Rust? Then Mihalis Tsoukalos can help.
Use Home Assistant NodeRED devices
NodeRED is a graphical programming language that’s ideally suited to IoT, electronics and home automations, reveals Matt Holder.
Chat
X
Pocketmags Support