It is important to have a valid and updated sources.list
to be able to search in the repos.
Category: ubuntu
remove old kernels
find kernels
dpkg -l | awk '{print $2}' | grep linux | grep -e headers -e image -e modules
aptitude purge
every one having version number lower than the highest.
EDIT: Is it really safe to remove modules?
See also cleaning after package managers.
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.
pulseaudio switch default sound card
$ pacmd >> list-sinks >> set-default-sink 1
djb stuff on newer ubuntu
Since maybe 9.04 (for sure on 10.4), djb stuff (daemontools, ptyget, …) does not compile out of the box. The only change needed is to replace, in errno.h,
extern int errno;
with
#include <errno.h>
dbus and X forwarding
Under Ubuntu 10.4
It seems some files under ~/.dbus are set to owner root, which causes problems when starting an X application over SSH.
chowning -R ~/.dbus to user seems to fix the problem.
Under Windows 7
PuTTY often crashes when forwarding an X application. Could this be related?
using jflex
(on Ubuntu 10.4, tcsh):
jflex lexer.jflex setenv CLASSPATH '.:/usr/share/java/JFlex.jar' javac lexer.java tester.java java tester source.txt
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.