Ubuntu – way to transition from Linux Mint with Mate desktop to Ubuntu MATE without re-install


Brief history: For variety of reasons, I had transitioned back then from Ubuntu desktop with Gnome 2.0 to Ubuntu XFCE (got sick from Gnome 3), then to Cinnamon desktop environment, which somehow pushed me into Linux Mint world. And then I got Mate desktop which seems to be what I needed for time being. Only Linux Mint turns out to be rather what I'd like to get rid off.

Now the challenge is I have a dev environment. And while I do keep backups, I'd like to transition to Ubuntu back without full re-install and restore.

The switch between stock Ubuntu and e.g. Xubuntu looks simple – just switch apt sources set and let apt do the business. But Linux Mint has some more hooks for "calculations" of URLs and paths. So the darn thing does not let me go back, or at least I perceive it so. I tried to find existing howto to no avail.

Any personal experience would be great, but what I need is a set of steps which describes what to do, at least minimal guidance about pitfalls and (optionally) some hints more about apt under-the-hood changes which do not let me go off now.

Best Answer

Assuming that the development environment is somewhere in your home directory, here is what I would try. Please note, I haven't tried this myself so this comes with absolutely no warranty. In short, I would install Ubuntu with MATE in another partition, then install any packages that you have installed in Mint, and reuse your current home directory in the new system.

More in detail:

  1. in your current system, get the list of installed packages in a form usable by dpkg --set-selections:

    apt-mark showmanual | sed -e 's/$/ install/' > pkgs.txt

    (this gets you only the list of packages that you manually installed; I believe that this should be good enough, or you can get the list of every installed package with dpkg --get-selections '*' > pkgs.txt).

  2. Install Ubuntu on a new partition.

  3. Install MATE:

    sudo apt-get install mate-core

    for a minimal MATE desktop or

    sudo apt-get install mate-desktop-environment

    for the complete MATE desktop.

  4. Reuse your home from Mint. You can do this by just copying it all over, or (with a minimal risk of having it somehow altered by the new system) mount it directly into the new system by editing the /etc/fstab in Ubuntu and adding this lines:

    /dev/disk/by-uuid/<uuid-of-mint-part> /mnt/mint auto nosuid,nodev,nofail,user,exec 0 0
    /mnt/mint/home/<user>   /home/<user> none bind

    where you can use the blkid /dev/<mint-partition> command to find out should find out the UUID of the mint partition. Also remember to create the /mnt/mint directory because I believe that it must exist in order for the mount to succeed.

  5. Reboot (into Ubuntu again); when the system comes up, your home directory should be the one you have in Mint.

  6. Install the extra packages you had installed in Mint: copy the pkgs.txt file you created in step 1 into the new system, and from there issue the commands:

    sudo dpkg --set-selections < selection.txt
    sudo apt-get -u dselect-upgrade

If everything works out as expected, and you used the "bind mount" trick for your home, you could move it for good into the new location, and then delete your Mint partition.

Related Question