I'm trying to understand, in pacman/libalpm code how the transactions work.
Are they atomic? If so, the transactions are only atomic for the local database or they are also atomic for the instalation/upgrade/removal of the packages in the system?
You are right!
Doing it now.