1

Given a situation where a software package was installed with aptitude or apt-get, and then needs to be upgraded to a version not available in the package manager. What is the correct procedure for doing this? Should the package be completely uninstalled via the package manager first?

cas
  • 78,579
UpTheCreek
  • 848
  • 3
  • 11
  • 17
  • See backports. As cas says, you can also use the Debian packaging from the available version with a new version, though you may run into issues. I address that case at the end of my answer: – Faheem Mitha Oct 22 '15 at 07:54
  • "In many cases, one can reuse the packaging from earlier versions of the software in conjunction with newer sources. This approach can run into problems, notably patches that applied to earlier versions of the software may not apply here, so one may need to resync them with the sources. The 3.0 (quilt) source format which is now becoming standard uses quilt, and patches are located in the debian/patches directory." – Faheem Mitha Oct 22 '15 at 07:57

1 Answers1

3
  1. If at all possible, don't. Wait for an updated package to be made available.

  2. If you have to, then yes. Uninstall the package first. Use remove rather than purge if you want to re-use any conf files from the package.

  3. A better option, although more work is involved, is to build your own local package of the newer version. Quite often, this is no more difficult than unpacking the .tar.gz, copying the debian/ subdirectory from the debian source package, updating the debian/changelog file and then running dpkg-buildpackage

  4. Otherwise, look into tools like stow - it can provide some of the benefits of a package (like easy uninstall) for locally compiled software.

In the long run, sticking with packages will cause you the least hassle. Running unpackaged software is a short-term fix that seems like a good idea right now but will likely cause you trouble in the future. A packaging system is a fantastic tool - use it, don't treat it as an obstacle to be worked around.

cas
  • 78,579