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-old(5)                                                          dpkg suite                                                          deb-old(5)

NAME
deb-old - old style Debian binary package format SYNOPSIS
filename.deb DESCRIPTION
The .deb format is the Debian binary package file format. This manual page describes the old format, used before Debian 0.93. Please see deb(5) for details of the new format. FORMAT
The file is two lines of format information as ASCII text, followed by two concatenated gzipped ustar files. The first line is the format version number padded to 8 digits, and is 0.939000 for all old-format archives. The second line is a decimal string (without leading zeroes) giving the length of the first gzipped tarfile. Each of these lines is terminated with a single newline character. The first tarfile contains the control information, as a series of ordinary files. The file control must be present, as it contains the core control information. In some very old archives, the files in the control tarfile may optionally be in a DEBIAN subdirectory. In that case, the DEBIAN subdirectory will be in the control tarfile too, and the control tarfile will have only files in that directory. Optionally the control tarfile may contain an entry for '.', that is, the current directory. The second gzipped tarfile is the filesystem archive, containing pathnames relative to the root directory of the system to be installed on. The pathnames do not have leading slashes. SEE ALSO
deb(5), dpkg-deb(1), deb-control(5). 1.19.0.5 2018-04-16 deb-old(5)
All times are GMT -4. The time now is 11:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy