miércoles, 4 de marzo de 2009

From intrepid to jaunty.... with no room left


Today I decided to move my desktop to jaunty. It's still an alpha but I'm not afraid of having to face a non-working Xorg once in a while and having to use the VTs instead. Given the speed improvements I've read about... the time is now... there's just a tiny little problem. I have no room left to do the dist-upgrade:

$ df
S.ficheros Bloques de 1K Usado Dispon Uso% Montado en
/dev/sda5 5162796 4783244 117296 98% /
tmpfs 508248 0 508248 0% /lib/init/rw
varrun 508248 228 508020 1% /var/run
varlock 508248 4 508244 1% /var/lock
udev 508248 2824 505424 1% /dev
tmpfs 508248 12 508236 1% /dev/shm
lrm 508248 2004 506244 1% /lib/modules/2.6.27-11-generic/volatile
/dev/sda8 6190664 5793332 82864 99% /home

Anyway... let's just try, ok? This is the second time i have to do this process. Why? Cause it's my wife's computer and I have a little space set up for GNU/Linux on it (and if people don't start using www.cdfleamarket.com, I'll have to repeat the process for Kinky Kangaroo... I mean, Karmic Koala as well.... so why don't you give me a hand and use the site? It's free anyway!).

First, let's set up apt to use the jaunty repositories instead:
$ sudo su
# cd /etc/apt
# sed 's/intrepid/jaunty/' sources.list > sources.list.jaunty
# rm sources.list
# ln -s sources.list.jaunty sources.list
# exit

I like to keep the different versions of sources.list so I have a version of each ubuntu release sin edgy.

Now, let's try to dist-upgrade to see what happens:

$ sudo apt-get update
$ sudo apt-get dist-upgrade
1010 upgraded, 98 newly installed, 7 to remove and 1 not upgraded.
Need to get 1073MB of archives.
After this operation, 639MB of additional disk space will be used.
E: You don't have enough free space in /var/cache/apt/archives/

Well.... that's a long no.

Ok... here's the deal: As long as you keep the package ubuntu-standard installed, you can remove basically everything else and the system will keep on working. So let's remove all this desktop packages (a lot of them at least) so that we have a system basic enough that we could dist-upgrade.

You have to know how to use a VT before you proceed, cause you won't be able to use the graphical environment for a while.

If you are ready, just close your graphical session and head to one of the VTs.

I use kubuntu, so the first thing is to remove the kubuntu-desktop package so that I get "permission" to automagically remove all the other packages that depend on it (if you use Ubuntu instead, then it's ubuntu-desktop):

$ sudo apt-get remove --purge kubuntu-desktop
roughly 50 Ks freed. :-S
$ sudo apt-get autoremove --purge
Nothing :'(

Oh well.... I didn't expect that. Seems like kubuntu-desktop has no dependencies... that could be because I use the repositories for KDE 4.2. So let's try with something a little more straight-forward:

$ sudo apt-get remove --purge kde'*' openoffice'*' xfce'*' firefox'*'
168 packages to be removed
771 MBs to be freed
3 Mbs of data to install right away

Much better now.

$ sudo apt-get autoremove --purge
another 153 packages to eliminate
235 Mbs to be freed

Now I have about 1Gb of space, but apt-get update still needs to download
718 MBs of data plus take another 530 MBs. I have to keep on cutting stuff out.

Let's go with some other things that take a lot of room till I get enough free space:
$sudo apt-get autoremove texlive'*' lilypond'*' --purge
I didn't know I could ask autoremove directly to remove packages and their unnecessary dependencies. You never know when knowledge will hit at your screen.
200+ MBs freed
Now the dist-upgrade would barely fit in there, but let's make a little more room just in case:

$ sudo apt-get autoremove xorg --purge
About 1.4 GBs are free by now.

There are still a lot of packages that are not basic still installed... but I won't care about them now.

Let's try to dist-upgrade to see how it goes now.
sudo apt-get dist-upgrade

Now it's a 500 MBs download plus 357 Mbs to take for installation. I'll let it do it like that, then I'll clean and then I will install kubuntu-desktop so I get the environment back.

I'll use lynx to read the latest news on another VT while the download takes place to see what I'll do next.

After a text round of www.linuxtoday.com, www.osnews.com, www.eltiempo.com, www.noticias24.com, www.talcualdigital.com, prelude of the Suite Antillaise of Francis Kleynjans (that'd be me playing guitar), Aire de Zamba and a little more guitar fiddling, it's downloaded. Now I have to see if the upgrading process asks me something (some more guitar fiddling).

dist-upgrade is done. Let's run it one more time just in case. Ran it. Nothing is left to do. So let's reboot so I can uninstall this kernel I'm running from intrepid and continue the upgrading process.

sudo reboot

Now... booting was FAST! At least to the console login. Let's see if this wonder can keep that way after I install the desktop ;-).

Let's remove the old kernel then:

ls /boot/vmlinuz*
There I see that I have a 2.6.27-x kernel.

Let's remove the 2.6.27-whatever:

sudo apt-get autoremove --purge linux-image-2.6.27'*'

Some more packages went away along with it. A total of over 280 Mbs are freed.

Sidenote: I just discovered (next morning) that the new kernel went away with it, so perhaps it's a good idea to remove the linux-image-2.6.27-x-generic instead (providing the exact number in x instead... so watch out!). Now... how do I install a new kernel on a non booting system? I'll be back!

Now, let's remove all the .deb files I've downloaded so far that are already installed so I free up that space as well (that won't uninstall the packages... just remove the .deb files that were used to install those packages). Before I clean, I have about 800 Mbs free.

sudo apt-get clean

Now, I have about 1.3 GBs free.

Next step? Let's bring back the desktop, shall we?

sudo apt-get install kubuntu-desktop

257 Mbs to be downloaded, 825 MBs to be used on top of that. So be it.

Here, I just hit my first problem. The network is down. Why? I just don't know right now. ifconfig -a shows me eth1 instead of the usual eth0, tried reconfiguring the interface using /etc/network/interfaces but still won't come up. So I take it to the next lower level:

sudo dhclient eth1

I get the configuration from my ISP. So let's go on installing so I can focus on this problem later (and I won't publish the solution in this post.. perhaps in another post tomorrow or so).

sudo apt-get install kubuntu-desktop

It does work now. Install finishes and now let's go back to graphics mode.

sudo /etc/init.d/kdm restart

And we're back in track. Now I have to install the packages that I use that were uninstalled in the process... but I'll do it as I need them.

Now, see if you can do that from Vista to 7. :-)

PS: I was able to reinstall the new kernel after having removed it. The keywords to fix it are: LiveCD + chroot.

3 comentarios:

  1. The key to the 'eth1' problem is in
    most likely you've swapped network cards sometime since installing? If you only have one network card just delete that file and it will get recreated with your network card being eth0 again.

  2. I'll try that, minime... but first I have to solve another thing. When I removed the old kernel, the new one wnt away with it. :-S

    I have to find a way to install the new one back.

  3. Minime, it did work... I didn't delete the file. I just edited it, removed the rule that was set for eth0 and changed the one for eth1 and set it to eth0. :-)

    Thank you!