19 July 2012

Ubuntu to Debian

It happened again today and I hate it when it happens:
Ubuntu on a server...sigh
"But Ubuntu is Debian and you love Debian, why do you hate Ubuntu so much then?"
No it's not Debian, it's Ubuntu. (Oh and btw: OSX isn't BSD, Darwin is BSD... sort of.)
"But Ubuntu is so much easier than Debian..."
Yeh well, Hitler thought exterminating an entire group of people was easier than just dealing with them.
"Ubuntu LTS has long time support and is commercially supported..."
Get away from me, suit, go hug an SLA or something.
Ubuntu is bloated and I don't want it anywhere near my servers... and upstart is evil.
Not the cool evil like Behemoth, more like the bad evil like Codemasters.
So I guess I overreacted a bit and converted the Crabuntu into Debian, I've done that a couple times before and it works fine but every time I do it something unexpected happens so don't take this guide too literal.


Disclaimer: but of course I am fully responsible for what you do to you system, this won't hurt your system at all and nothing stated in this disclaimer is a lie...

First I'm going to delete everything:


dpkg -l | awk '{print $2}' | xargs --replace dpkg --purge {}

We can totally do this as the most important stuff will refuse to purge. Next, let's make apt decide what the system can do without:


apt-get autoremove

Now purge every package which only has configuration files on the system:


dpkg -l | grep ^rc | awk '{print $2}' | xargs --replace dpkg --purge {}

Good, not too much is left on the system. Let's upgrade those packages to their Debian counterparts:

echo "deb ftp.de.debian.org/debian testing main contrib non-free" > /etc/apt/sources.list

apt-get update


Install the Debian version of apt-utils as we're going to need it:


apt-get install apt-utils

Upgrade everything:


dpkg -l | awk -F' ' '{print $2}' | xargs --replace apt-get install -y --force-yes {}

Remove those pieces of shit:



dpkg --purge --force-all upstart
dpkg --purge --force-all mountall
dpkg --purge --force-all plymouth

Install something decent:


apt-get install sysvinit

Reinstall grub (not so important I think)


apt-get install grub2

Reinstall a kernel, might be useful sometimes:


apt-get install linux-base  linux-image-amd64

Throw away everything else Ubuntu related:


dpkg -l | grep ubuntu | awk '{print $2}' | xargs --replace apt-get remove --purge {} -y

I like openssh:


apt-get install openssh-server

If it's good enough for Linus, it's good enough for me:

sync
sync
sync


Reboot right the fuck now:





reboot -fn

TADA.... and gone is the Ubuntu crap.