Thursday 3 January 2013

Install package trash-cli in Ubuntu hardy

I like being able to do on the command line what I have only done with the Desktop Environment.  One of the things which I thought was un-doable was to use the Desktop Trash can from the command line.  There are two reasons why I wanted to do this: first, so I can undo mistakes.  Second, so I can empty my trash without having to be in a Desktop session.

The package trash-cli is available as far back as Intrepid (Ubuntu 8.10) but was not released for Hardy.  I checked the dependencies listed on the page at
https://launchpad.net/ubuntu/intrepid/i386/trash-cli/0.10.r55-0ubuntu1:

Depends on:

    python (>= 2.3)
    python-support (>= 0.7.1)

Then I compared with my install of hardy on a test machine.  After all updates were applied, the version of python was 2.5 and the package python-support was 0.7.5.

adam@hardy:~$ apt-cache policy python
python:
  Installed: 2.5.2-0ubuntu1
  Candidate: 2.5.2-0ubuntu1
  Version table:
 *** 2.5.2-0ubuntu1 0
        500 http://us.archive.ubuntu.com hardy/main Packages
        100 /var/lib/dpkg/status
adam@hardy:~$ apt-cache policy python-support
python-support:
  Installed: 0.7.5ubuntu1
  Candidate: 0.7.5ubuntu1
  Version table:
 *** 0.7.5ubuntu1 0
        500 http://us.archive.ubuntu.com hardy/main Packages
        100 /var/lib/dpkg/status

So I downloaded the package from the Intrepid page above, and it installed perfectly ok.  I used the command line to install it, but I suppose it would work with the Graphical installer, possibly with a warning message about it not being in the hardy repository.

adam@hardy:~$ sudo dpkg -i  trash-cli_0.10.r55-0ubuntu1_all.deb
...

Looking further, the same version is used across Intrepid, Jaunty, Karmic and Lucid, so it isn't tied to a specific set of dependencies, unlike some other packages.  I'd like to have found it in the hardy-backports repository, but at this point hardy is reaching the end of its support cycle, and only a few people like me are still messing around with it, I think.