0

I was using wget in Ubuntu from /usr/bin/wget (i.e. that's what appeared when I ran which wget.) Now, I just downloaded wget from http://ftp.gnu.org/gnu/wget/, and installed it using ./configure; make; sudo make install.

Now when I ran which wget, the output is /usr/local/bin/wget. What should I do if I want to change it back to the old one?

Mika H.
  • 1,809
  • 2
  • 12
  • 9
  • Which one it gets is determined by which one it finds first, which is determined by the PATH environment variable. – Keith Nov 19 '12 at 05:07

1 Answers1

1

Depending on if you want to keep the new version or not, what you want to do is as simple as either deleting or renaming the new version

rm /usr/local/bin/wget
mv /usr/local/bin/wget /usr/local/bin/wget_new

The new version got replaced because of the way the terminal determines which version to use. There is an environment variable called PATH. You can see its value with echo $PATH. Basically its a list of paths(folders), and when you try to run wget, it will run through that list and try to find the first one that has a exe by that name, and thats the one that gets run.

In your case I'm guessing PATH is something like ...:/usr/local/bin/:...:/usr/bin. Because of this, your new version is effectively hiding the old version of wget

Karthik T
  • 2,734
  • 1
  • 15
  • 26