This article will tell Ubuntu, Linux Mint and Debian GUN/Linux users how to easily decompress and repackage .deb files on their Debian-based Linux operating system.
Sometimes you will encounter such a problem in your life, you want to modify part of the .deb file and then repackage it. The following example is a real experience that just happened to me. A Linux developer built a Debian package (.deb) for a piece of software, and I successfully installed it on my Ubuntu computer.
When I try to retrieve some files from a Git repository, it always freezes. Obviously, the software is not working properly. I know where the installed files are (/opt directory), so I searched the code and fixed some of the problems appropriately. After that, when the program tries to retrieve the required package, it no longer freezes.
So to make a long story short, I will unpack the .deb file, replace it with my patch file, and then repackage it back. In this way, I can install it on other computers, or send the revised package file to my friends. What should I do?
Searching for the answer to the question on the Internet, I found a small blog named ailo.net, which gave an explanation like this:
( adsbygoogle = window.adsbygoogle || []).push({});
mkdir -p extract/DEBIAN
dpkg-deb -x package.deb extract/
dpkg-deb -e package.deb extract/DEBIAN [...do something, e.g. edit the control file...]
mkdir build
dpkg-deb -b extract/ build/
These five commands will do the job miraculously. Let me explain it for you:
This is this tutorial! Remember the above command firmly, after you execute the third command, you can use your default file manager to visually modify the file with a graphical text editor. If you encounter problems while studying this tutorial, don't hesitate to leave us a comment below.
Recommended Posts