Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: HOWTO: GNOME - Install .DEBs with right click !

  1. #1
    Join Date
    Nov 2004
    Beans
    489

    HOWTO: GNOME - Install .DEBs with right click !

    Edit: It's now confirmed working. I fixed a filename issue (nautilus returns the filename with file:// on the front, so I stripped it off) and made it execute in a new terminal window so I could use sudo because dpkg doesn't work with gksudo. Serves me right for posting an untested script

    Second edit: Thanks to Gandalf for pointing out the chmod error. It is fixed.

    Ever wanted to install debs without opening a terminal? How about doing it by right-clicking on the file just like those fancy KDE people?

    Try this:

    Code:
    $ gedit ~/.gnome2/nautilus-scripts/Install\ Deb
    Now add the following code and save the file.

    Code:
    #!/bin/bash
    for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do
    	gnome-terminal -x sudo dpkg -i ${uri:7}
    done
    Make the script executable:
    Code:
    $ chmod +x  ~/.gnome2/nautilus-scripts/Install\ Deb
    This script will be in your right-click menu under Scripts. It will show up for all files, but obviously will only install Debs and dpkg will give an error for other file types. It should work if you select multiple debs.

    (Uninstaller removed because it won't work until the script can hook into the apt database to search for the real package name that was installed)
    Last edited by shakin; May 12th, 2005 at 01:52 PM.

  2. #2
    Join Date
    May 2005
    Location
    United Kingdom
    Beans
    3

    Re: HOWTO: GNOME - Install .DEBs with right click !

    Quote Originally Posted by shakin
    Ever wanted to install debs without opening a terminal? How about by right-clicking on the file just like those fancy KDE people?

    Try this:

    Code:
    $ gedit ~/.gnome2/nautilus-scripts/Install\ Deb
    Now add the following code and save the file.

    Code:
    #!/bin/bash
    
    for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do
    	gksudo dpkg -i $uri
    done
    This script will be in your right-click menu under Scripts. It will show up for all files, but obviously will only install Debs and dpkg will give an error for other file types. It should work if you select multiple debs.

    Now let's create a deb uninstaller...

    Code:
    $ gedit ~/.gnome2/nautilus-scripts/Uninstall\ Deb
    Now add the following code to the file and save it.

    Code:
    #!/bin/bash
    
    for uri in $NAUTILUS_SCRIPT_SELECTED_URIS; do
    	gksudo dpkg -r $uri
    done
    I am not currently running Gnome. Somebody let me know if it works or not and I'll fix it if it doesn't.
    Hmm, well it doesn't seem to appear, in my right click menu. I don't have any "scripts" bit there either.

  3. #3
    Join Date
    Nov 2004
    Beans
    489

    Re: HOWTO: GNOME - Install .DEBs with right click !

    Quote Originally Posted by mattgirv
    Hmm, well it doesn't seem to appear, in my right click menu. I don't have any "scripts" bit there either.
    No? Not when you right-click on a file? Can you cd to ~/.gnome2/nautilus-scripts? Everything in that directory should be listed under Scripts when you right click on a file or folder.

    I checked my original source for nautilus scripting (http://www.ubuntuforums.org/showthread.php?t=26668) and there are no additional steps needed to make it work.

  4. #4
    Join Date
    Apr 2005
    Beans
    77

    Re: HOWTO: GNOME - Install .DEBs with right click !

    You need to make the script executeable before it shows up in the menu.
    Right-click your script-file and change the properties.

    edit: And it doesn't work
    Last edited by ildfroe; May 11th, 2005 at 08:04 PM.

  5. #5
    Join Date
    Nov 2004
    Beans
    489

    Re: HOWTO: GNOME - Install .DEBs with right click !

    Quote Originally Posted by ildfroe
    You need to make the script executeable before it shows up in the menu. Right-click your script-file and change the properties.
    Thank you. I have added that step to the how-to. I had originally copied another script and didn't need to do this step.

    Quote Originally Posted by ildfroe
    edit: And it doesn't work
    I fixed the two problems that were preventing it from working. I started Gnome and actually tested it this time and it does work. I removed the uninstall script because it would never have worked.

  6. #6
    Join Date
    Apr 2005
    Beans
    77

    Re: HOWTO: GNOME - Install .DEBs with right click !

    Yep. It works fine now

  7. #7
    Join Date
    Oct 2004
    Location
    33.4N -112.1W
    Beans
    2,396
    Distro
    Ubuntu Budgie

    Re: HOWTO: GNOME - Install .DEBs with right click !

    This is very nice! Makes using Ubuntu even easier.
    /path/to/Truth

  8. #8
    Join Date
    Apr 2005
    Beans
    645
    Distro
    Dapper Drake Testing/

    Re: HOWTO: GNOME - Install .DEBs with right click !

    great HOWTO thx man
    BTW replace
    Code:
    chmod +x Install\ Deb
    with
    Code:
    chmod +x  ~/.gnome2/nautilus-scripts/Install\ Deb
    because following your first command we aren't in ~/.gnome2/nautilus-scripts/ and will confuse some about it,
    anyway great work, keep it up ubuntu addicted guys
    [My Blog] | [My Sites] | [My Ubuntu Guides]

    doc.gwos.org, the real successor of Ubuntu Guide

  9. #9
    Join Date
    Apr 2005
    Location
    Not-So-Sunny Hawaii
    Beans
    Hidden!

    Re: HOWTO: GNOME - Install .DEBs with right click !

    Quote Originally Posted by Gandalf
    great HOWTO thx man
    BTW replace
    Code:
    chmod +x Install\ Deb
    with
    Code:
    chmod +x  ~/.gnome2/nautilus-scripts/Install\ Deb
    because following your first command we aren't in ~/.gnome2/nautilus-scripts/ and will confuse some about it,
    anyway great work, keep it up ubuntu addicted guys
    why didn't i just read the thread instead of spending precious time finding the file in Nautilus to make it executible



  10. #10
    Join Date
    Nov 2004
    Location
    Anywhere
    Beans
    Hidden!

    Re: HOWTO: GNOME - Install .DEBs with right click !

    Thks for this one.

    Will save me a lot of time.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •