Shotwell – unable to upgrade library.

Yesterday I wrote a post about a permissions error I came across when when trying to move items to the trash in Linux Mint. Today I’d like to do a follow-up post on a very similar issue I came across when I fired up Shotwell the other day.

As the last post was fairly involved I’ll keep this one brief, however, do check that post if you need a little more detail as it covers very similar ground.

Problem: When attempting to start Shotwell the application gives the following error:

“Shotwell was unable to upgrade your photo library from version 0.9.3 (schema 12) to 0.11.6 (schema 14). “

Solution: Ensure that the user has read/write permissions to Shotwell’s configuration directory.

Procedure:

Open a terminal, and check the permissions to ~/.shotwell

ls -al ~/.shotwell

If you find, like I did, that Shotwell’s data and thumbs directories are owned by root rather than your user then:

sudo chown -R $USER:$USER .shotwell/

It may also be a permissions error where your user doesn’t have the correct permissions to read/write to these directories. In this case then the following should fix it:

sudo chmod -R 755 .shotwell/

Fire up Shotwell and all should be dandy.

Linux Mint – Unable to Send Items to Trash

Some time ago I noticed that whenever I attempted to move a file (or group of files) to the Trash (or the Rubbish Bin as we in the southern hemisphere – and by extension Mint – like to call it) I received the following error:

“Cannot move file to the rubbish bin, do you want to delete immediately? The file foo.bar cannot be moved to rubbish bin.”

While in many situations permanently deleting a file isn’t such a big deal I do, however,  sometimes find that I’ve accidentally deleted the wrong file or a file that I’ve not quite finished working with. In these situations it can be handy to retrieve the file from the Trash.

Also, when using a graphical file manager I’ve got into the habit of sending most of what I delete to the Trash for a while before I later delete them permanently. And, to tell you the truth, constantly dealing with error messages was just plain painful.

As the error message sounded to me like the problem was something to do with ownership or permissions I had a bit of a poke around in ~/.local and found that, the solution to this little problem was as simple as fixing a partitions problem in my home folder.

Problem: When attempting to delete files using Nautilus the following error “Cannot move file to the trash, do you want to delete immediately? The file foo.bar cannot be moved to trash” is displayed.

Solution: Ensure user has correct ownership and permissions of directories and subdirectories required for Trash to operate correctly.

Procedure: Open a terminal to check ownership and permissions of trash directories.

ls -al ~/.local/share/Trash/

You should see an output something like this:

d---------  2 pseudomorph pseudomorph  4096 2012-03-07 15:07 expunged
d---------  5 pseudomorph pseudomorph 16384 2012-03-12 22:03 files
d---------  2 root        root        20480 2012-03-12 22:03 info

Here you can see that not only does my user (pseudomorph) not have permissions to read/write to the expunged, files or info directories, it also doesn’t have ownership of the info directory.

First, let’s give ownership of the info directory to user pseudomorph. This command will change both the ownership and group of the Trash directory and all its subdirectories to that of the current user.

sudo chown -R $USER:$USER ~/.local/share/Trash/

The output of your ls on the Trash directory should now show something like this:

d---------  2 pseudomorph pseudomorph  4096 2012-03-07 15:07 expunged
d---------  5 pseudomorph pseudomorph 16384 2012-03-12 22:03 files
d---------  2 pseudomorph pseudomorph 20480 2012-03-12 22:03 info

Now lets fix the permissions error with a similar command.

chmod -R 770 ~/.local/share/Trash/

This command will give read/write/execute permissions to both root and the owner of the directories while giving no permissions to others.

The result of your ls command should now show something like this:

drwxrwx---  2 pseudomorph pseudomorph  4096 2012-03-07 15:07 expunged
drwxrwx---  5 pseudomorph pseudomorph 16384 2012-03-12 22:03 files
drwxrwx---  2 pseudomorph pseudomorph 20480 2012-03-12 22:03 info

Your Trash, Rubbish Bin or whatever you call it where ever you live should now work just fine.