i think the best way is to reflash ur devise and next time u wanna upgrade dont use dist-upgrade unless u know what ur doing instead of that just apt-get upgrade.