When in doubt, read the error message carefully. Often, Linux tells you how to fix the problem.
If an installation seems "stuck" at 99%, give it a few minutes. Some packages (like kernel updates) take a long time to build in the background. When in doubt, read the error message carefully