Author Topic: SOLVED: Question about Upgrading from Source  (Read 1149 times)

Offline GreggB

  • Jr. Member
  • **
  • Posts: 45
SOLVED: Question about Upgrading from Source
« on: October 31, 2012, 03:32:51 PM »
Hi,
    I need to upgrade a few applications from source to get the latest version. (e.g. SANE).

I have gone through the install process and it seemed to work, but... Because it installed to the usr/local/ directories and they come  after the usr/ directories in the PATH, I'm still getting the old version.

So my question is, what's the best way to remedy this? Just modify the PATH to put usr/local first? Or un-install the older version (and should I have done that before installing the new)?

Un-installing makes me a bit nervous because I'm afraid I'll loose something. But I don't know the consequences of fooling with the path.

Thanks,
           Gregg.
« Last Edit: November 05, 2012, 12:48:19 PM by GreggB »

Offline johnmart

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 1105
  • Make Love Not War
Re: Question about Upgrading from Source
« Reply #1 on: October 31, 2012, 11:03:43 PM »
Hi GreggB - Welcome to the forum.

Maybe the main goal of PClinuxOS is stability. One of the main means of keeping stable is to guard the integrity of installed apps. So installing from PClinuxOS repositories which have certified OK apps is the suggested practice. If a new version of an app comes out, but isn't updated in the repo, you can file an update request here; http://www.pclinuxos.com/forum/index.php/board,81.0.html (check the rules)

Also there is no guarantee of forum support if apps are installed outside of the repo.
I notice that the latest sane is an incremental upgrade.
The repo version is 1.0.22_3 & the new one is 1.0.23.
Acer Aspire, Intel core2 2.20GHz, ‎Graphics nVidia ‎G98M [GeForce G 105M], 2gb ram, Wireless Intel Link 5100

Why, any 5 year old child could understand this.
Somebody bring me a 5 year old.
Groucho

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6252
Re: Question about Upgrading from Source
« Reply #2 on: November 01, 2012, 08:22:56 AM »

programs in "/usr/local/bin" should take precedent over those in "/usr/bin".

what does these command give you?

echo $PATH

which XYZ

"XYZ" being the name of the program thats in "/usr/local/bin"
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline GreggB

  • Jr. Member
  • **
  • Posts: 45
Re: Question about Upgrading from Source
« Reply #3 on: November 01, 2012, 08:46:10 AM »
Thanks for the relies (even though I didn't get the answer I was looking for  :) )

I don't take installing from source lightly - that's why I'm not doing it on my live system. I don't necessarily want the "latest and greatest" but there are certain things I "need" to install. i.e. SANE to support my scanner and the latest Brother drivers for my printer.

I can't post a package request yet since this is my first post. (Been using PCLOS since June and this is the first thing I've considered worthy of a post). Besides, since package requests are handled on a priority basis, I might have to wait a while before enough people want the latest version.

So anyway... I know installing from source has its risks, and to be honest, I'm not totally comfortable with it, but needs must...

Given the emphasis on stability, it's sounding like re-arranging the PATH is a really bad idea. So I should uninstall the SANE from the repository so that only my new version is picked up?

Thanks,
           Gregg.

BTW - PATH is /usr/bin:/bin:/usr/local/bin: - WHICH sane-find-scanner returns: /usr/bin/sane-find-scanner

Offline muungwana

  • Hero Member
  • *****
  • Posts: 6252
Re: Question about Upgrading from Source
« Reply #4 on: November 01, 2012, 08:57:12 AM »

you could uninstall the one in the repository

you could also use the one you want using its full path.

you could also change the $PATH variable to have "/usr/local/bin" infront of "/usr/bin".This not being so as it appears in your PATH breaks what is to be expected in a linux distro.

Leaving everything in place, second option seem most easy.

just use full path line "/usr/local/bin/sane-find-scanner" and you will always get the binary you want.

.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline GreggB

  • Jr. Member
  • **
  • Posts: 45
Re: Question about Upgrading from Source
« Reply #5 on: November 01, 2012, 01:51:54 PM »
I see why Neal ManBear moved this to the advanced user section... but I've only been using Linux for a few months, chance to become an intermediate user first would have been nice :)

It seems uninstalling the current version of SANE is not a good option. Synaptic wants to uninstall a slew of other things too. It looks like I'm left with changing the order of the PATH as my only option (if I want to use my scanner).

So in PCLOS, where is the "correct" place to make a permanent change to the PATH?

Thanks,
            Gregg.

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8590
  • Aurum nostrum non est aurum vulgi.
Re: Question about Upgrading from Source
« Reply #6 on: November 01, 2012, 05:27:08 PM »
If you take notes of the install path of xsane from our repository, my suggestion would be:

... uninstall the repository version
... run your compile modifying the ./configure --prefix=/usr

The command option changes the install path from /usr/local to /usr

There no need to change your $PATH and risk a higher chance of borking your install.  8)
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline muungwana

  • Hero Member
  • *****
  • Posts: 6252
Re: Question about Upgrading from Source
« Reply #7 on: November 01, 2012, 06:08:14 PM »
I see why Neal ManBear moved this to the advanced user section... but I've only been using Linux for a few months, chance to become an intermediate user first would have been nice :)

It seems uninstalling the current version of SANE is not a good option. Synaptic wants to uninstall a slew of other things too. It looks like I'm left with changing the order of the PATH as my only option (if I want to use my scanner).

So in PCLOS, where is the "correct" place to make a permanent change to the PATH?

Thanks,
            Gregg.

One of the ways of changing your path is to include the following line in your ".bashrc" hidden file in your home directory,log out and then log back in.

export PATH=/path/to/where/you/want/to/go:$PATH

Its not the only option, there is the option of using full path to the binary,in your case,use "/usr/local/bin/sane-find-scanner".

How do you start this program?
Changing the PATH variable would not help if the way you start it up involves clicking an icon and the icon has a full path to the binary in "/usr/bin"
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8590
  • Aurum nostrum non est aurum vulgi.
Re: Question about Upgrading from Source
« Reply #8 on: November 01, 2012, 06:12:57 PM »
I see why Neal ManBear moved this to the advanced user section... but I've only been using Linux for a few months, chance to become an intermediate user first would have been nice :)

It seems uninstalling the current version of SANE is not a good option. Synaptic wants to uninstall a slew of other things too. It looks like I'm left with changing the order of the PATH as my only option (if I want to use my scanner).

So in PCLOS, where is the "correct" place to make a permanent change to the PATH?

Thanks,
            Gregg.

One of the ways of changing your path is to include the following line in your ".bashrc" hidden file in your home directory,log out and then log back in.

export PATH=/path/to/where/you/want/to/go:$PATH

Its not the only option, there is the option of using full path to the binary,in your case,use "/usr/local/bin/sane-find-scanner".

How do you start this program?
Changing the PATH variable would not help if the way you start it up involves clicking an icon and the icon has a full path to the binary in "/usr/bin"

If my guess is correct, GreggB compiles the source with the default parameters. Therefor the exec will be in /usr/local/bin
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline GreggB

  • Jr. Member
  • **
  • Posts: 45
Re: Question about Upgrading from Source
« Reply #9 on: November 02, 2012, 10:32:22 AM »
Quote
How do you start this program?
SANE is driver/libraries for accessing scanners. The only way to control which version is called would be through changing the PATH.

Yes - I used the default parameters - I could re-install to /usr, but that leaves me no easy back-out.

I think I'm just going to change the PATH and see what happens.

Thanks to everyone for their suggestions.

Gregg.

Offline Neal ManBear

  • Administrator
  • Super Villain
  • *****
  • Posts: 15847
  • LXDE! Coffee, Bacon and Cheesecake!
Re: Question about Upgrading from Source
« Reply #10 on: November 03, 2012, 11:39:08 PM »
Another way would be to write a new .desktop file for it. (/usr/share/applications) You would want the Exec= line to use the full path to the executable.     

Offline GreggB

  • Jr. Member
  • **
  • Posts: 45
Re: Question about Upgrading from Source
« Reply #11 on: November 05, 2012, 12:46:14 PM »
Thanks again for all of the suggestions. They solve the problem with the command line utilities, but what I was struggling with was the libraries. As it turned out, the answer was buried in on of the SANE readme files. What worked was to create links to the new libraries:

    $ cd /usr/lib
    $ sudo ln -sf /usr/local/lib/libsane.so.1.0.23 libsane.so.1
    $ sudo ln -sf /usr/local/lib/sane/libsane.la libsane.la