Is there any transactional installation process like Windows installer in Unix/Linux?
Installation scripts like Makefile or package manager (such as deb) usually simply copy files directly to overwrite existing files.
Is there any transactional installation process like Windows installer in Unix/Linux?
Installation scripts like Makefile or package manager (such as deb) usually simply copy files directly to overwrite existing files.
I don't at all know about the properties of the Windows installer tools, but have a look at the Nix package manager (and the NixOS GNU/Linux distribution built around it). It features atomic updates, since it doesn't at all overwrite anything old.
Another way to go is using filesystem snapshot support, for example like yum
with btrfs
snapshots (also snapper
on OpenSUSE; dpkg
can have pre-/post-actions, too, so this could be done with it as well, I suppose).
Edit Using filesystem snapshots, ./configure && make && make install
is kind of transactional, too...
Typical package managers do take care to ensure that a package is either installed or not installed. There is generally a transition period during which the old version is still installed and the new files are already unpacked, but under different names. If the system crashes during the transition period, it is very likely that the software remains usable; the installation command needs to be resumed to complete the installation. There is a time window during which some of the new files are already in place and some of the old files are still in place, but it is very small.
On the other hand, if there is an installation error, depending on when the error is caught, the program may have switched to the new version even though the new version is unusable. This is unavoidable to some extent: maybe you'll only discover that the new version is unusable because you start the program and it opens your existing files but doesn't interpret them correctly. What most Linux package managers don't have is an easy way to revert an upgrade: typically, you need to manually download the old version of the package and force its installation.
When you install software that's compiled from source, with a makefile or equivalent, you should install the software in its own directory. Install each version in its own directory, and test the new version before removing the old one. The program is immediately usable from its installation directory, so there is no switch to pull between the old version and the new version: just run the new version. Use Stow or XStow to create symbolic links in a common hierarchy, so you can have executables in your PATH
and so on; see Keeping track of programs.