Today's article is for those folks who have ever wondered what's inside a .deb package...

KGIII

Super Moderator
Staff member
Gold Supporter
Joined
Jul 23, 2020
Messages
11,839
Reaction score
10,415
Credits
97,923
The title sums it up nicely...

Have you ever wanted to know what's inside of a .deb package? Well, you can extract the files and take a peek. This isn't something you'll probably ever need to do, but you can do it. You can even do it with a GUI, though the article focuses on doing so in the terminal...


This is mostly for the curious folks and the folks who like to tinker. As a general rule, there's no reason to do this, but you can do this and that's the important thing. Also, it's there as an option should you ever actually need to do this. (I can count the number of times I've had to do this on no hands, 'cause that number is zero.)
 


I've done it a couple of times in the past to extract some firmware drivers I required, Knoppix had them, but my present distro, at that time, hadn't......so it was handy to know how to in that instance.

P.S. This was when I didn't have good internet access, I was using cover discs from magazines. ;)
 
Tried once to make my own deb packages but found it was too much effort for the benefits. What is inside a deb package? Other people's problem to deal with.

Love each and every one of you making modern Linux possible.
 
I've done it a couple of times in the past to extract some firmware drivers I required,

That's an interesting use case. I've never needed to do that. I do not think I've ever had a need to do this and have only done so because I was curious. I'm not even sure why it was in my notes, but it was and that's how it ended up being an article.

Love each and every one of you making modern Linux possible.

As someone that's on the Lubuntu team, it's a labor of love. My role is in testing, bug hunting, and properly reporting bugs. It's not a glamorous role, but it's a necessary role. The more and better I do it, the easier it is for those doing the coding, package managing, etc...

It takes a lot of work and a lot of time, almost all of it done by unpaid volunteers, to keep the Linux ecosystem healthy. There are ways for you to get involved. There's the following link - a bit long - that expresses some of my thoughts (and suggestions) on the matter:

 
I think this is useful advice...

I find it most useful when I want to look at the wallpapers a release comes with, particularly if I don't want to try the OS & thus don't want the download the whole ISO.

eg. I haven't tried Linux Mint in years, but when they have a release, as I've always been impressed with their wallpaper/backgrounds, thus I usually grab the deb package in which they're contained, and have a peek.

I had a smaller download, it cost the Linux Mint team less bandwidth costs too (contrasted with a whole ISO), and I haven't installed or changed anything locally.

I'm using Linux Mint only as example; if you look - most GNU/Linux distributions come with some terrific wallpapers/backgrounds; thus you can read whatever distro you prefer instead of my references of Linux Mint.
 
I must have learnt how to do this the best part of a decade ago.

Although you CAN install .debs into Puppy, because of the slightly unique lay-out & different way in which Puppy handles some stuff, certain parts of the 'standard' file-system structure - designed to work across as broad a range of mainstream distros as possible - frequently doesn't function correctly for us. Thus, the most efficient way round this is to open up the "offending" package, copy the contents across into a suitably-named working directory, re-build things so that they DO work as intended.....and re-pack it into Puppy's native format, the .pet package (Puppy Enhanced Tarball). And this then lets it works better with Puppy's native package-management record-keeping, too.

~~~~~~~~~~~~~~~~~~~~​

Or it might get re-built into Puppy's 'load-on-the-fly' package format, the SFS package (Squash File System, designed to 'layer' into the Puppy file-system via AUFS).....although AUFS is becoming problematic with recent kernels, and is slowly being replaced with the in-kernel overlayfs.....which does the same kind of thing.

Or it may get re-built into our increasingly used 'portable' format.......which yours truly mostly pioneered in its current layout.

~~~~~~~~~~~~~~~~~~~~~​

The contents of most packages - whether .deb OR .rpm - tend to be pretty much the same. The biggest differences are in how the different package management systems are set-up to handle everything. I've lost track of the number of times I've opened packages up to obtain specific components - frequently combined with certain components from other packages, either .deb OR .rpm - which then get strung-together via custom scripts/wrappers/launchers & re-packed into Puppy-specific formats.

"Tinkering" is an integral part of the Puppy way of life.....and is why it appeals more to those with a certain type of mind-set.

Aye; archive handling is a very useful tool to have in your skill-set. It's immensely rewarding to see something that was not working correctly become functional again.....entirely due to your own efforts.


Mike. ;)
 
Last edited:
LOL See? It's useful for the curious and the tinkerers!
 
Just a heads up, though, David - ar is not installed by default on all Debian-based and Ubuntu-based distros.

Why not?

It is part of a package suite known as

binutils

and GNU ar itself goes back to Unix days.

binutils, in turn, is not installed on Zorin and Freespire, but in their repos it is available. I haven't gone trawling through my stable of distros any further to see if there are others, but as a covering exercise, you might just add to the article that if users cannot find it, they should

Code:
sudo apt -y install binutils

and then go from there.

Cheers :)

Wiz
 
Just a heads up, though, David - ar is not installed by default on all Debian-based and Ubuntu-based distros.

Hmm... That's worth adding to the article itself.

When I ran the command on a couple of computers, I didn't have to install anything. I'm sure you're correct. That seems like something I'd have installed without thinking about it all that much.

I'll toss it up into the article sometime today. Thanks!
 
@wizardfromoz / @KGIII :-

Binutils is not something most folks would ever install. It's typically needed when compiling, or building from source.

For us, the contents of the binutils package is contained within the Puppy DevX SFS package, which can be loaded/unloaded, "on-the-fly", as & when it's required....

This is typically created as part of the Woof-CE build process hosted on Github whenever new "official" Puppies are created......and the kernel_sources SFS can be created at any time by running the kernel_kit build process, since it's a by-product of the build-script.


Mike. ;)
 
It's typically needed when compiling, or building from source.

That's a good clue. That's probably why it appears to be installed on everything around me.

I can now confirm (I had network issues earlier, and probably still do) that it's not in the live instances, which means it's probably not installed by default - which I trusted Wiz when he said so.

But, I wonder if it's something drawn in when you install 'build-essential'? I'd dig into it, but I'm just going to edit the article when my connection is more stable.
 
KGIII wrote:
I wonder if it's something drawn in when you install 'build-essential'?

Here's a list of build-essential packages from debian trixie ... it doesn't include binutils here, though the file itself reports it was generated in 2021 though this system was upgraded last night.

Code:
[flip@flop /usr/share/doc/build-essential]$ cat essential-packages-list
This list was generated on Sun 03 Jan 2021 11:30:56 AM CET for amd64
It contains a list of essential packages (which are also build-essential).

base-files
base-passwd
bash
bsdutils
coreutils
dash
debianutils
diffutils
dpkg
findutils
grep
gzip
hostname
init-system-helpers
libc-bin
login
ncurses-base
ncurses-bin
perl-base
sed
sysvinit-utils
tar
util-linux
 
Here's a list of build-essential packages from debian trixie ...

I can now confirm that it's installed on three of my devices.

I have zero recollection of installing it, not even once. I have no clue how it ended up installed, other than being quite certain that it was done by me.

But, what are the odds of doing so at least three times and not remembering?

I wonder if I installed it for another article or if maybe wine (not the program for using Windows software) might be to blame. Though, I usually try to stop computing at that point.

No, no... I checked my site and it's not mentioned in any other articles.

I suspect it's going to remain a mystery. I literally have no clue when or why I installed binutils. Additionally, I have absolutely no recollection of doing so three times.

(I don't have any real fresh installs anywhere. I do have one computer that's booting poorly and I'm not going to troubleshoot it.)

We need Agatha Christie to come to solve the mystery.
 
Update: The article has now been edited. Thanks again, @wizardfromoz!
 
I have zero recollection of installing it, not even once. I have no clue how it ended up installed, other than being quite certain that it was done by me.

I have it installed on this Lubuntu lunar system, having no idea how it got installed here either, as yeah I too don't see in on the manifest for the released ISO.

I too expect it on my systems, don't recall every needing to manually install it; no need its always been there whenever I wanted it.. and though I don't see the reason, it probably gets pulled in via packages i normally add.
 
I have it installed on this Lubuntu lunar system, having no idea how it got installed here either, as yeah I too don't see in on the manifest for the released ISO.

Of the devices, two are on 22.04 (Lubuntu, of course) and another is some Mint that needs to be updated to whatever is current. They all have ar installed on them.

I just edited the article. I figured that'd be the best idea.
 
on both a mint 20.3 xfce install that has been around a while and a mint 21.2 xfce install that is only a couple of months old:
Code:
aptitude why binutils
i   lintian Depends binutils
aptitude why lintian
i   gdebi Recommends lintian
aptitude why gdebi
Manually installed, current version 0.9.5.7xmint10, priority optional
No dependencies require to install gdebi
 
... it doesn't include binutils here,

It is its own package. Contents (my highlighting)

GNU Binutils​




The GNU Binutils are a collection of binary tools. The main ones are:


  • ld - the GNU linker.
  • as - the GNU assembler.
  • gold - a new, faster, ELF only linker.

But they also include:


  • addr2line - Converts addresses into filenames and line numbers.
  • ar - A utility for creating, modifying and extracting from archives.
  • c++filt - Filter to demangle encoded C++ symbols.
  • dlltool - Creates files for building and using DLLs.
  • elfedit - Allows alteration of ELF format files.
  • gprof - Displays profiling information.
  • gprofng - Collects and displays application performance data.
  • nlmconv - Converts object code into an NLM.
  • nm - Lists symbols from object files.
  • objcopy - Copies and translates object files.
  • objdump - Displays information from object files.
  • ranlib - Generates an index to the contents of an archive.
  • readelf - Displays information from any ELF format object file.
  • size - Lists the section sizes of an object or archive file.
  • strings - Lists printable strings from files.
  • strip - Discards symbols.
  • windmc - A Windows compatible message compiler.
  • windres - A compiler for Windows resource files.

I undertook a little further investigation with a search of package lists as provided by distrowatch, searching under Ubuntu-based and Debian-based.

All of the Debian-based (even antiX) have it installed by default.

With the Ubuntu-based, as well as the Zorin and Freespire mentioned above, it is not installed on
  • KDE Neon
  • Elementary OS
  • Trisquel
  • may be more
So it seems very much a developers choice.

Glad you edited the article, David, and happy to help.

Chris
 
on both a mint 20.3 xfce install that has been around a while and a mint 21.2 xfce install that is only a couple of months old:
Code:
aptitude why binutils
i   lintian Depends binutils
aptitude why lintian
i   gdebi Recommends lintian
aptitude why gdebi
Manually installed, current version 0.9.5.7xmint10, priority optional
No dependencies require to install gdebi

aptitude says it exists on my current lunar box for two reasons, the first is devscripts which I'll add pretty soon on my boxes (after install), as those scripts are very useful for support, and looking up issues/packages etc.

I actually mentioned devcripts in my reply, but dropped it before I clicked POST as it wasn't the only reason.
 

Members online


Latest posts

Top