Sponsored Content
Top Forums Shell Programming and Scripting Extracting/RePackaging Deb Package Post 302928283 by metallica1973 on Wednesday 10th of December 2014 12:32:16 PM
Old 12-10-2014
I was able to resolve it using another method:

2 - Extract the deb package:
Code:
ac -x blah-amd64.deb

ls -ltr

-rw-r--r-- 1 root root        4 Dec  3 15:53 debian-binary
-rw-r--r-- 1 root root 92233080 Dec  3 15:58 data.tar.gz
-rw-r--r-- 1 root root      684 Dec  3 16:36 control.tar.gz

3 - Create a DEBIAN directory and extract the control file there because it is need for the rebuild:
Code:
mkdir DEBIAN
cp control.tar.gz DEBIAN
tar zcvf control.tar.gz
ls -ltr

-rwxr-xr-x 1 root root 210 Dec  2 09:49 prerm
-rwxr-xr-x 1 root root 255 Dec  2 09:49 postrm
-rwxr-xr-x 1 root root 193 Dec  2 09:49 postinst
-rw-r--r-- 1 root root 296 Dec  3 16:34 control
-rw-rw-r-- 1 root root 684 Dec  3 16:36 control.tar.gz

4 - Retar up the control file without the control.tar.gz in it:
Code:
tar cvzf data.tar.gz --exclude=control.tar.gz ./

5 - Extract your the data.tar.gz, make your changes and retar it up:
Code:
tar zxvf data.tar.gz 

ls -ltr 

usr/

vi ./usr/share/blah/blah.1
wq

tar zcvf data.tar.gz --exclude=control.tar.gz ./usr

6 - create the simple debian-binary
Code:
cat > debian-binary <<EOF
2.0\n
EOF

to repackage deb file:
Code:
ar rc blah-amd64.deb debian-binary control.tar.gz data.tar.gz

optional use
Code:
dpkg-deb -b directory blah-amd64.deb

To view contents of deb file:
Code:
ar tv blah-amd64.deb
or dpkg-deb -c blah-amd64.deb

 

7 More Discussions You Might Find Interesting

1. Linux

Can I let apt-get use prozilla to download deb

:thank (0 Replies)
Discussion started by: f33k4
0 Replies

2. UNIX for Advanced & Expert Users

binutills_2.15-4_i386.deb

Hai Friends I am using debian 2.2.19. The gcc version installed in my os is 2.95.2. I tried to update the gcc to 3.2.2. It asked me to update some packages and all the updations was success. But when i tried to update the binutills_2.15-4_i386.deb packes i encountered some error that it asked me... (3 Replies)
Discussion started by: collins
3 Replies

3. UNIX for Dummies Questions & Answers

Installing deb packages from Ubuntu Server CD

Hi, I have mounted the Ubuntu server edition 10.10 ISO on my server under a directory media/servercd. I would like to install some services from this. I edited the sources.list file to say: deb file:/media/servercd maverick main restricted and it's properly mounted but when I try... (1 Reply)
Discussion started by: shadowcat
1 Replies

4. UNIX for Advanced & Expert Users

How to find dependancies of .dstream package (Solaris) & .rpm package( linux)

Friends, Please let meknow, How we can find the dependancies of .dstream package & .rpm package before installation ? For AIX, We can use the inutoc . command to create the .toc file for the bff package, What about Solaris & Linux ? (0 Replies)
Discussion started by: yb4779
0 Replies

5. Shell Programming and Scripting

Script to extract all deb files in a fldr to respective folderstructures

Hi, since half an hour I currently try to write a script that will: 1) Extract every debian file in a directory 2) Extracts it to a folder that matches the debians filename 3) Extracts it so the structure looks like that: DEBIANFILENAME | -------------- DEBIAN ... (9 Replies)
Discussion started by: pasc
9 Replies

6. Ubuntu

Install deb from alternate usb

I installed a command-line system ubuntu 12.04 from usb and that's work. I don't have a internet connection so what I have to install must come from the alternate usb until I can let work my wireless. I mount the usb to /media/cdrom but when I do sudo apt-get install xorg , then he ask me for the... (3 Replies)
Discussion started by: thailand
3 Replies

7. Shell Programming and Scripting

> dpkg-deb to Extract and Reconstruct a Multipart Archive???

Greetings! Here's one which has been bugging me for a bit ;) As might be known, LibreOffice is available to some of us Linux folk as a large set of debs. Of course, being a curious sort, I'd like to dig in and recreate the original tree which is composed of these assorted archives. So, I... (1 Reply)
Discussion started by: LinQ
1 Replies
deb(5)                                                              dpkg suite                                                              deb(5)

NAME
deb - Debian binary package format SYNOPSIS
filename.deb DESCRIPTION
The .deb format is the Debian binary package file format. It is understood since dpkg 0.93.76, and is generated by default since dpkg 1.2.0 and 1.1.1elf (i386/ELF builds). The format described here is used since Debian 0.93; details of the old format are described in deb-old(5). FORMAT
The file is an ar archive with a magic value of !<arch>. Only the common ar archive format is supported, with no long file name extensions, but with file names containing an optional trailing slash, which limits their length to 15 characters (from the 16 allowed). File sizes are limited to 10 ASCII decimal digits, allowing for up to approximately 9536.74 MiB member files. The tar archives currently allowed are, the old-style (v7) format, the pre-POSIX ustar format, a subset of the GNU format (new style long pathnames and long linknames, supported since dpkg 1.4.1.17; large file metadata since dpkg 1.18.24), and the POSIX ustar format (long names supported since dpkg 1.15.0). Unrecognized tar typeflags are considered an error. Each tar entry size inside a tar archive is limited to 11 ASCII octal digits, allowing for up to 8 GiB tar entries. The GNU large file metadata support permits 95-bit tar entry sizes and negative timestamps, and 63-bit UID, GID and device numbers. The first member is named debian-binary and contains a series of lines, separated by newlines. Currently only one line is present, the format version number, 2.0 at the time this manual page was written. Programs which read new-format archives should be prepared for the minor number to be increased and new lines to be present, and should ignore these if this is the case. If the major number has changed, an incompatible change has been made and the program should stop. If it has not, then the program should be able to safely continue, unless it encounters an unexpected member in the archive (except at the end), as described below. The second required member is named control.tar. It is a tar archive containing the package control information, either not compressed (supported since dpkg 1.17.6), or compressed with gzip (with .gz extension), xz (with .xz extension, supported since 1.17.6) or zstd (with .zst extension, supported since 1.19.0.5ubuntu2), as a series of plain files, of which the file control is mandatory and contains the core control information, the conffiles, triggers, shlibs and symbols files contain optional control information, and the preinst, postinst, prerm and postrm files are optional maintainer scripts. The control tarball may optionally contain an entry for '.', the current directory. The third, last required member is named data.tar. It contains the filesystem as a tar archive, either not compressed (supported since dpkg 1.10.24), or compressed with gzip (with .gz extension), xz (with .xz extension, supported since dpkg 1.15.6), zstd (with .zst extension, supported since 1.19.0.5ubuntu2), bzip2 (with .bz2 extension, supported since dpkg 1.10.24) or lzma (with .lzma extension, supported since dpkg 1.13.25). These members must occur in this exact order. Current implementations should ignore any additional members after data.tar. Further members may be defined in the future, and (if possible) will be placed after these three. Any additional members that may need to be inserted after debian-binary and before control.tar or data.tar and which should be safely ignored by older programs, will have names starting with an underscore, '_'. Those new members which won't be able to be safely ignored will be inserted before data.tar with names starting with something other than underscores, or will (more likely) cause the major version number to be increased. MEDIA TYPE
Current application/vnd.debian.binary-package Deprecated application/x-debian-package application/x-deb SEE ALSO
deb-old(5), dpkg-deb(1), deb-control(5), deb-conffiles(5) deb-triggers(5), deb-shlibs(5), deb-symbols(5), deb-preinst(5), deb-postinst(5), deb-prerm(5), deb-postrm(5). 1.19.0.5 2018-04-16 deb(5)
All times are GMT -4. The time now is 10:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy