Sign In

    Enjoy FOSSwire's content? Have it delivered! Subscribe

    Find the package a file is from

    A quick tip today for all Debian (and derivative) users:

    Have a file on in your system that you just can’t figure out where it came from? Searching for the name in Synaptic doesn’t help? About ready to heave your weary keyboard out the window in an administrative rage? Fear not, dpkg to the rescue!

    Let’s say you are trying to find out where in the world /usr/share/epiphany-browser/glade/epiphany.glade came into existence. You’ve checked epiphany-browser, but it’s not there. Let’s ask dpkg-query:

    
    $ dpkg-query -S /usr/share/epiphany-browser/glade/epiphany.glade
    epiphany-browser-data: /usr/share/epiphany-browser/glade/epiphany.glade
    
    

    Okay, so it was in epiphany-browser-data. Let’s ask dpkg-query to do the reverse this time, and find all files included in that package:

    
    $ dpkg-query -L epiphany-browser-data
    /usr/share/epiphany-browser
    /usr/share/epiphany-browser/components
    /usr/share/epiphany-browser/components/epiphany.xpt
    /usr/share/epiphany-browser/art
    /usr/share/epiphany-browser/chrome
    # ...
    
    

    A good trick I use instead of remembering dpkg-query switches is to simply add aliases to my .bashrc:

    
    alias dpkgs="dpkg-query -S"
    alias dpkgl="dpkg-query -L"
    
    

    The above example could then be shortened to dpkgl epiphany-browser-data.

    Not all files are managed by packages, and so this may not always get you the results you wanted. Obviously, user-created files in /home will not be from any packages, nor will most files in /etc. But it’s still a handy way to figure out where a file came from.

    In one last example, you can take advantage of shell command nesting to figure out which package contains a binary:

    
    $ dpkg-query -S `which firefox`
    firefox-3.0: /usr/bin/firefox
    
    

    (Those are backticks, by the way, not regular quotes.)


    Quick Tip: Clear Out GNOME Tracker Indexes

    Tracker logo

    If you followed my recent video tutorial on enabling Ubuntu/GNOME’s Tracker search tool, you should now be enjoying the ability to search the files on your system.

    During a recent upgrade to Ubuntu 9.04, which was recently released, I found that the Tracker search tool index had become corrupted. I tried to tell Tracker to rebuild the index, but experienced some weird issues.

    In this quick tip, I’ll show you how to avoid this and other issues by deleting Tracker’s index and cache manually, so that it can start ‘from scratch’. Note that if you are having issues with tracker, it is worth trying to rebuild the index from the graphical interface first. This tip is a last resort if you need to clear everything out from scratch and start it again.

    Tracker’s Files

    According to the documentation, Tracker stores its files in the following locations:

    • Configuration Files – ~/.config/tracker/tracker.cfg
    • Data Files – ~/.local/share/tracker
    • Index Cache – ~/.cache/tracker

    If you’re happy with the settings you have, you may want to leave the configuration file intact, and just wipe out the data files and index cache.

    Quit Tracker and Delete the Files

    First of all, you need to go ahead and quit the Tracker application in the system tray.

    Quit the Tracker tray applet

    Next, you must quit all processes of both trackerd and tracker-indexer, so open up a terminal and run these commands:

    $ killall trackerd
    $ killall tracker-indexer

    And finally, carefully delete the files listed above (excluding the config file, if you don’t think you need to clear that out as well).

    So to recap, go ahead and delete the folders:

    • ~/.local/share/tracker
    • ~/.cache/tracker

    and if you wish, the config files:

    • ~/.config/tracker/tracker.cfg
    • ~/.config/tracker/tracker-applet.cfg

    To restart Tracker, I recommend that you log out and log back in so that trackerd and the system tray applet both restart properly. You should then be able to reconfigure it from the beginning as detailed in the original tutorial.

    And that should be it – Tracker should rebuild itself from scratch. Useful to know for if things go wrong!


    Install Ubuntu on your USB Drive

    Ubuntu logo

    Did you know that is ridiculously simple to install Ubuntu onto an external USB flash drive?

    If you have a copy of the latest version of Ubuntu (at the time of writing that is 8.10), there is a very simple program that does it all for you.

    You will need:

    • An Ubuntu 8.10 CD (or ISO image if already installed)
    • A USB drive with at least 700-800 MB free space

    While you are booted into Ubuntu, go to System > Administration > Create a USB startup disk.

    Make Bootable Ubuntu USB Drive

    You'll need to choose the source disc image for Ubuntu. If you have your Ubuntu CD in the drive, this should appear in the list, so make sure it is selected. Alternatively, you can click 'Other' and specify where the .iso image of the Ubuntu CD is.

    Next, plug in your drive and choose it as your destination drive (and double-check it's the right drive before going ahead).

    You can also choose how much space will be reserved for saving data on the new drive, or turn data storage off (it will act just like the Ubuntu live CD).

    That's it! Simply press Make Startup Disk and wait while the files are copied over.

    Installing Ubuntu on USB Disk

    On many modern PCs that are configured to allow USB boot, you should be able to just restart the machine with the USB drive plugged in and Ubuntu should boot straight from it!

    It's a nice simple way to have a copy of Ubuntu in your pocket, wherever you go.


    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6