Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've run into this a few times when installing apps from source, and during the occasional hack with update-alternatives. So far, it's only been a minor annoyance (ie, not got in the way of the end-goal) but it's now a frustration as it's pointing to a hole in my knowledge-base... so when I get a message that 'foo' is "not a registered application" (or I can't use foo's default icon cuz Ubuntu has no knowledge of 'foo'):

  1. What defines a "registered application"?

  2. How can I define an application installed from source (and likely residing in $HOME/bin/app-name) such that it packs the same functionality as a package installed from a .deb? (if the solution is not self-evident from answer 1)

Example:

I download and unpack daily dev builds of sublime-text-2 to /home/tom/bin/sublime-text-2. I've created a *.desktop file with appropriate shortcuts, etc. But the icon for sublime cannot be display in any launcher even if I provide a full pathname to the option. The solution is to install a 2nd instance of sublime from a deb package.

When I install sublime-text-2 from a .deb package, it installs under /usr/bin && /usr/lib, the installed .desktop file is stored under /usr/share/applications, and the relevant line reads: icon=sublime_text.

Where's the linkage I'm missing? Somehow Ubuntu knows how to exact the icon from sublime_text in the latter, but not in the former (again, even with a full path provided).

share|improve this question
    
Where in your home folder are you putting this launcher? –  Alvin Row Jun 25 '11 at 22:22
    
Also, when do you get the message: "foo is not a registered application"? –  Alvin Row Jun 25 '11 at 22:28
    
@DoR: my sublime*.desktop is under /.local/share/applications. The most notable place I can remember the "registered app" message was when trying to wedge a compiled-from-source version of vim into the update-alternatives list so it would come up instead of the 'default' install. Helpful? Guess what I'm looking for is the mechanism that provides Ubuntu with knowledge of where to find (for example) the correct icon for app A -- as it does with *.desktop files under /usr/share/applications/. –  Tom Jun 28 '11 at 19:02
    
If you set the the value of "icon" in your ~/.local/share/applications launcher to just sublime_text (not the full path, does that work? –  Alvin Row Jun 28 '11 at 20:56
add comment

1 Answer

up vote 3 down vote accepted

I think you are running into several problems at once with source installations.

update-alternatives will not allow you to set just any program as a preferred application for a given name. The program will have to be registered first with the --install option. For example:

sudo update-alternatives --set editor /home/peter/bin/foo
update-alternatives: error: alternative /home/peter/bin/foo for editor not registered, not setting.

If you want to see how the registration is done, check for example /var/lib/dpkg/info/nano.postinst.

Note, however, that it would be quite bogus to define a system-wide alternative that points to some user's home directory. There are usually environment variables or other settings to set a preference for one user only.

The issue with the desktop file is probably completely separate, but you will need to provide more details about exactly which paths you used.

In general, installing an application from source can be quite difficult to get well integrated with the rest of the system, depending on the particular application.

share|improve this answer
    
Peter: Yes, I think you hit the nail... and on reflection correcting my thinking is the answer. I'm using the system on a laptop -- a laptop only I use, login to, etc. And of course, UNIX is a multi-user OS, and defines program installation as such. The icon thing is trivial and I believe a quirk. I found a separate icon file in my sublime-text postinst checks as you suggested, so I can now point the alternate install (within my $HOME) to a specific file rather than let it 'auto-magically' seek from the executable. I'm marking this closed/solved as I believe I have what I need now. –  Tom Jun 29 '11 at 12:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.