How to repackage Deb files in Debian and Ubuntu

Source: Internet
Author: User
Tags linux mint
The following tutorials will show you how to easily decompress and repackage the. deb files on the Debian-based Linux operating systems for Ubuntu, LinuxMint, and DebianGUN/Linux users. Sometimes you may encounter this problem in your life. You want to modify part of the. deb file and re-package it. However, only you have a deep understanding of computers can complete such hacking techniques. The following example shows my real experiences. A Linux developer builds

The following tutorials will show you how to easily decompress and repackage the. deb files on the Debian-based Linux operating systems for Ubuntu, Linux Mint, and Debian GUN/Linux users.

Sometimes you may encounter this problem in your life. You want to modify part of the. deb file and re-package it. However, only you have a deep understanding of computers can complete such hacking techniques.

The following example shows my real experiences. A Linux developer built a Debian package (. deb) for a software, and I successfully installed it on my Ubuntu-mounted computer.

When I try to retrieve some files from a Git library, it is always stuck and obviously the software is not working properly. I know where the installed files are (/opt directory), so I searched the code and fixed some problems as appropriate. Then, the program no longer gets stuck when trying to retrieve the desired package.

So, in short, I want to unpack the. deb file, replace it with my patch file, and then package it back. In this way, I can install it on another computer or send the corrected package file to my friends. What should I do?

Search for the answer to the question on the Internet. I found a small blog named ailoo.net, which provides an explanation similar to this:

mkdir -p extract/DEBIANdpkg-deb -x package.deb extract/dpkg-deb -e package.deb extract/DEBIAN [...do something, e.g. edit the control file...]mkdir builddpkg-deb -b extract/ build/

These five commands will miraculously complete the work. Let me explain for you:

  • The first command creates a folder named "extract" and a subfolders named "DEBIAN;
  • The second command will extract some files from your. deb package to the "extract" folder;
  • The third command will decompress the. deb Package content to the "DEBIAN" sub-folder, where you can modify/patch the files you want;
  • Article 4 Create a folder named "build;
  • The Fifth Command will re-build the modified file into a new. deb package and generate it in the "build" folder.

This is the tutorial! Remember the command above. 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 have any questions during this tutorial, do not hesitate to write a comment below.

Reading:

Package existing files into a deb package http://www.linuxidc.com/Linux/2008-04/12297.htm under Ubuntu

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.