If the running kernel of the system building the image matches the kernel that is to be removed dnf will fail. Repalce use use of dnf with rpm -e. Closes-Bug: #1623409 Change-Id: Ie2481ea8a02b7b0720e46fa179f24badf4aa25c5