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.)


    Simplify GRUB tweaks with Startup Manager

    Tired of manually tweaking your GRUB menu.lst to add a new system, or even just change the theme, only to have your system not boot because you made a typo? Well, those days are over, or they can be, with Startup Manager.

    Startup Manager, for Debian or a derivative (such as Ubuntu), allows you to load your GRUB menu into a simplified interface to edit, and then save it back when you are done.

    Every option known to GRUB (and update-grub) appears to be available in this application. That includes everything from passwords, timeouts, and kernel limits, to colors, themes, and boot resolutions. As an added bonus, the bootup usplash theme can be edited.

    That's all there is to it. The advantage of using a graphical interface for tasks such as this means that it impossible (hopefully!) to make a typo or syntax error in the file and have to boot into a CD to rescue the system. However, in the event that you do mess something up, Startup Manager also offers an option to create a rescue floppy. Sorry, no rescue CD, but for something like that you might try out the Ultimate Boot CD.

    Just another application to make your life easier.


    Exclude Packages from being Installed and Upgraded in Debian/Ubuntu

    Package - http://www.sxc.hu/photo/918252

    Package managers make life on Linux a whole lot easier. Instead of managing bits of software by yourself and sorting out the inevitable dependency hell, where one package depends upon another and that depends upon yet another and so on, you can have a clever bit of software do all the work.

    Debian, Ubuntu and other derivatives use the .deb package format and Aptitude (Apt for short) as the package manager.

    However, there are some occasions when your package manager can hinder, rather than help. It may end up insisting on installing or upgrading something you don't want, or upgrading something you want left alone at its current version. Its persistence could extend to your update manager on your desktop nagging you every five minutes - wouldn't it be nice to shut it up?

    To avoid this problem, Apt users can specify to put specific packages on hold, preventing them from being upgraded or installed. Of course, you can easily remove this restriction later.

    To do this, first install the Wajig program, which offers a simple command line interface to Dpkg and Apt.

    $ sudo apt-get install wajig

    Once the program is installed, you can put a package on hold, so it will be ignored by Apt, like so:

    $ sudo wajig hold package

    When you now go to upgrade or install new packages, you will not be pestered to update that package.

    Naturally, when you want to remove this restriction, simply run the command again with 'unhold':

    $ sudo wajig unhold package

    Also, if at any time you want to see the list of packages that are on hold, run:

    $ sudo wajig list-hold

    A simple solution to what can be a rather irritating problem.

    [image source]


    1. 1
    2. 2