0

I know how to extract a package, make some minor changes, and repackage it. I wanted to know if there was anything special you'd have to do if you were to repackage a deb package so it was compatible with an older OS version.

For example, I want to upgrade xyz package on Ubuntu 12 but xyz package is only available on Ubuntu 14. Can I just modify the control file to change Utopic Unicorn to Precise Pangolin?

1

You'll get unmet dependencies if you want to take package from newer system and install on older one. You can check dependencies in the control file in Depends: section. You can try to resolve dependencies by upgrading them, but by doing so you can break other applications which depend on old versions. If you'll manage to get them, you can just rebuild package or try to install this package from source.

1

If it has compiled code in the package, you need to rebuild it in most cases.

Short summary on how to do that:

To do that, download the source package on Ubuntu 14.04 or 14.10 (whichever you meant by "Ubuntu 14") with apt-get source -d packagename and copy the downloaded files, one .dsc and usually one .debian.tar.xz or .debian.tar.gz (sometimes still a .diff.gz) and usually one .orig.tar.gz onto the machine with the older Ubuntu release (I assume Ubuntu 12.04 since 12.10 is no more supported).

There, unpack the source package with dpkg-source -x file.dsc (as the following tools from the dpkg-dev package) on the copied .dsc file and change to the created directory.

Then check if you have all build dependencies installed with dpkg-checkbuilddeps, install the missing ones if necessary.

Optionally run dch --bpo to add a proper changelog entry and version number depending on how proper the backport should be.

Then run dpkg-buildpackage -b to rebuild the package.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.