In Ubuntu, KDE should upgrade cleanly. If you really want not to do that, you could pare down your system, upgrade, and then install KDE, with aptitude, as follows (yes, this may be possible with apt, but I don't know how):
for pkg in $(aptitude search ~i | grep -v "i A" | cut -d\ -f4); do
echo "-- markauto $pkg --"
sudo aptitude markauto $pkg
done
This will prompt you several times to confirm whether sets of stuff ought be removed. Take care not to agree to remove any cluster that includes either aptitude or ubuntu-standard.
Now, confirm you really want some packages, just to make sure things keep working, with:
sudo aptitude install ubuntu-standard aptitude
Next, clean up any leftover configuration files with:
sudo aptitude purge ~c
Now, upgrade the system to the new release:
sudo do-release-upgrade
Finally, install the packages you want from the new release
sudo aptitude install kubuntu-desktop^