Installing a new kernel built from source takes too much time

Solution 1:

From the output you show, it looks like your machine is recompiling all of the kernel modules you have, to work with the new kernel. That's what dkms (Dynamic Kernel Module Support) does. Since this is compilation, it is expected to take quite a long time.

As long as you keep seeing output there (there should be various compilation messages), there should be no problem and it will finish. Eventually.