Created
June 28, 2024 19:20
-
-
Save kforeverisback/a881b82a572b36813ddb62bf6a4935cf to your computer and use it in GitHub Desktop.
Extract and repackage deb (Debian) file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Extract the data files to `repack` directory | |
dpkg -x some-package_amd64.deb repack | |
# Extract the control files to repack/DEBIAN directory | |
# using DEBIAN as control file output is important to repacakge | |
dpkg -e some-package_amd64.deb repack/DEBIAN | |
# Make some modification as necessary | |
# Repackage | |
# It will generate repack.deb file | |
dpkg-deb --build -Zgzip repack/ | |
mv repack.deb package-name-version-arch.deb | |
# Compressions supported are: gzip, xz, zstd | |
# I've used -Zgzip, this will make sure the deb file have maximum backward compatibility |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment