Monday, October 22, 2007

Updated Aptitude in Gutsy Gibbon (Ubuntu 7.10)

I use aptitude from the command line to update my system and to install packages. I have been running Ubuntu 7.10 throughout the beta-testing. I have noticed an error message every time I used "sudo aptitude update":

W: The "upgrade" command is deprecated; use "safe-upgrade" instead

I finally discovered that this is due to some changes made to the new version of Aptitude shipped with Ubuntu 7.10. The change is described in the man-pages for aptitude in Ubuntu 7.10.

The "upgrade" action/option is now called "safe-upgrade", and the old "dist-upgrade" is now "full-upgrade". Something to keep in mind if you encounter the error message.

Monday, October 15, 2007

Cron-job to delete unused thumbnails

I found that the hidden folder .Thumbnails (under /home/adder1972/) can grow very large after e.g. looking through a few years of pictures in my Pictures-folder. In Gnome (Nautilus) you can view hidden files and folders by pressing Ctrl + H. Here is a tip on how to delete unused thumbnails automatically.

Cron-job is a tool for running repetitive tasks in Linux. I made a cron-job for deleting the content of .Thumbnails if the file hasn't been accessed for a while. It provides a nice balance between conserving drive space and having thumbnails quickly available for the system.

I made a plain text document in the /etc/cron.d folder. I called the file "thumb", but that doesn't really matter. The file contains just one line:

0 21 * * * root find /home/*/.thumbnails/ -type f -atime +6 -exec rm '{}' \;

The format for the cron-commands are explained in detail in "man cron" and the find-commands in "man find".

The command tells the Linux-box to find all the thumbnail-files in all the home-folders (if you have several users) and delete the ones that has not been accessed during that last 7 days (today +6 days). The command is performed as root.

As long as the Linux-box is up and running at 9PM (21h), the cron-job is running.

Wednesday, October 10, 2007

Ubuntu backup and partitioning

In order to be a bit more robust and prepared for disaster, I have put my /home folder in a separate partition. This is easy to do during install. I allocated about 10BG to the main system and made the /home folder the same size. As described earlier, I have several other disks mounted into my /home folder, giving me plenty of storage-space.

The /home folder is home to many user-settings for most programs. I discovered this recently, when Windows XP decided to delete my root-partition. Suddenly, my Ubuntu-install was gone. I had to reinstall Ubuntu 7.04. During install I chose manual setup under the partition step. I just pointed my surviving partition containing my old /home to a new /home (this is easy to see when you install). I made a new partition for the rest (i.e the root) and reinstalled 7.04 on that one. When I booted into my system for the first time after reinstall, allmost everything was back to the way it was earlier (see note). My desktop pictures was there, my bookmarks in Firefox and my folder-structure in the home-folder. As I reinstalled programs, e.g the Liferea feed reader, my old settings returned. Great!

However, there were a few problems. My fstab containing information about my mounted disks was gone. I had to rewrite that one. Also, my screen settings were back to default, so I had to edit xorg.conf again. Both files are kept under the /etc folder, and they died along with the fatal XP-partition wipe I refered to above.

In order not to have to repeat that in the future, I installed sbackup (sudo aptitude install sbackup). The program integrates nicely under System > Administration > Simple Backup Config and Simple Backup Restore. This is a really neat and easy program to use. I just decided which files and folders to include (a suggestion was made). I did not include my home folder, since I have that on a separate partition. I might set up a separate backup for that at some later time. I save the backup-files on a separate drive. You may also save via your network if you wish.

Now, my fstab and xorg.conf and all the other config-files are safer, bith from "accidental" deletion by Win XP and also from my own editing!


Note: Actually, when I tried to log in to my session, X wouldn't start properly, probably since I had been using the nvidia-drivers for my graphics card. The drivers are not a part of the fresh install. In order to fix this, I started a terminal session and installed the graphics driver via the command line:

sudo aptitude install nvidia-glx

Feisty Fawn - cube effects suddenly missing

I run Feisty Fawn (Ubuntu 7.04) on one of my Linux boxes. I have enabled desktop effects (System > Preferences > Desktop effects). A few times I have had problems with the rotating cube, i.e. I am not able to rotate the cube. The wobbly windows are working fine.

In order to fix this issue, start gconf-editor (e.g by pressing Alt+F2 and writing gconf-editor or running it from the terminal). Go to "apps" > "compiz" > "general" > "screen0" > "options" and make sure that "hsize" is set to 4 (mine is usually set to 1 when the cube isn't working). Now, the rotating cube should work fine again.