cleaning after package managers

Once in a while, it may be a good idea to remove unneeded files generated by package managers. Downloaded package updates are not deleted after use, so we may end up with a lot of wasted space after several weeks.

On Ubuntu (10.04), those files are located under /var/cache/apt/archives and can be removed by doing:

aptitude clean

See also remove old kernels.

jabber (gtalk) client

Google Talk client from Google sucks. I didn’t find any way to disable pop-ups so it keeps switching to desktop whenever I receive a new message, which is horribly annoying when playing games.

Pidgin sucks, as it does the same thing. I also heard that it takes huge amount of RAM after several days of use under Ubuntu (mem leak?).

I’m now using Psi and so far like it.

login to unix remote with rsa key pair from windows

On Windows client, we need:

  • PuTTY
  • PuTTYgen
  • Pageant

Use PuTTYgen to make key pair, save private key to file and copy public key to clipboard. Add key to Pageant.

On Unix remote, edit ~/.ssh/authorized_keys and add public key from Windows clipboard (one-line).

Use PuTTY to login to remote. WinSCP also uses Pageant when possible.

remotely moving /usr

Moving /home or /usr (or /var?)

This can be done in multi-user mode. Be VERY careful NOT to use sudo (like I did). After moving /usr to /ousr, you will be doomed (I realized it the instant I pushed Enter). Instead, su. Because of this mistake I had to get off my chair to fix it locally.

mkdir /mnt/nusr
mount /dev/sdb1 /mnt/nusr
cp -a /usr/* /mnt/nusr
umount /mnt/nusr
mv /usr /ousr
mkdir /usr
mount /dev/sdb1 /usr

Edit /etc/fstab, mount -a, reboot to make sure it survives it OK.

Tested remotely from putty.