You need to compile and install software from source on a server that also uses packages. How do you avoid making a mess?
IntermediateScenarioPackages, kernel and boot
Answer
Situation read → Keep source builds separate from package-managed paths.
What I'd do →
- Build in a separate directory and install to
/opt/<name>-<version>with./configure --prefix=/opt/tool-2.1. - Symlink
/opt/tool -> /opt/tool-2.1for easy upgrades. - Better: package it (
fpm,rpmbuild) so it can be removed cleanly and deployed via repo. - Don't install compilers on production; build in CI or a build container.
Why → make install into /usr collides with package files and can't be cleanly uninstalled.
Interview tip → Mention checkinstall or fpm for quick packaging.
More on Packages, kernel and boot
You must upgrade the kernel on 50 production servers and be able to roll back if the new kernel misbehaves. Plan it.AdvancedYou need to pin a package version so routine updates don't upgrade it (e.g. Docker or PostgreSQL). How?BeginnerA package update broke an application. How do you roll it back?IntermediateYour servers can't reach the internet but need packages. How do you provide repositories?IntermediateYou need to change kernel boot parameters (e.g. add `transparent_hugepage=never`) persistently. How?IntermediateA server must apply kernel security patches without rebooting. What are your options?Advanced