Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I don't want to install multiple instances of perl.
How can I upgrade my Perl to latest version or delete existing Perl installation and install a new version of Perl in Ubuntu 14.04.
After new installation, will it conflict with older installation files.
I'd do it like this:
wget http://www.cpan.org/src/5.0/perl-5.22.1.tar.gz
tar xvfz perl-5.22.1.tar.gz
cd perl-5.22.1 && ./Configure -Duseithreads -des && make && make test && make install
/usr/local/bin/cpan -u
This puts a source build of perl in /usr/local/bin
Then check your path has /usr/local/bin in it, and if you want typing perl to run your new perl, ensure it's in front of /usr/bin (this is a fairly common scenario, but I can't say for sure if that applies.
Whilst you say you don't want to install multiple perl versions - this is a bad idea.
perl is distributed as part of your operating system. Packages depend upon it, and the particular version. You cannot tell what you might break by altering versions - not least because the way perl handles certain things does change between versions (like hashes).
Messing around with /usr/bin/perl is a road to some future pain (not least - it makes an 'update' of your OS annoyingly difficult, because you can no longer use the package manager without a bit of hackery)
If you REALLY REALLY want to do that you can set -Dprefix= in your Configure options. But as a sysadmin of 15 years experience, I can tell you - no good will come of it, you will break your OS in a variety of minor, but cumulatively really annoying ways. (And maybe some bigger ways)
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
This is more of a curiosity question, but I feel it's worth asking.
Frequently when downloading software on Linux, I'm used to using sudo apt-get install [package] or whatever package manager is available, but for some projects like sbt, they don't have a repository (so I can't just type sudo apt-get install sbt and use it out of the box). I have to download the binaries and add them to PATH.
What I like to do is create a directory specific to programs like sbt, specifically ~/Programs. I move the unpacked directory into it, and add it to PATH. However, I'm always a little wary about moving the binary out of the directory it came in, so I don't want to remove it.
Is there such a thing as a recursive PATH variable, so that not only ~/Programs is added but also ~/Programs/sbt, ~/Programs/other_program, etc.? And if not, is it a good idea to make it recursive? I've tinkered with the Linux kernel before as part of a university class, I wonder if it's worth experimenting with.
Add something like this to ~/.bashrc or ~/.bash_profile:
for each in ~/Programs/*
do
PATH+=:"$each"
done
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I recently switched from Linux to OSX. I use console heavily, and previously I was able to do things like
ls ./dir -sgh
cp ./file ./dir -Rf
and so on. If I missed an option, it was enough to press up and just add it. OSX forces me to put options before arguments, like this:
ls -sgh ./dir
cp -Rf ./file ./dir
This behavior is frustrating, it is easy to forget about an option and you have to navigate to the beggining of a line just to add it. It is also hard to add another option if you forget about one.
Is there an easy way to fix this behavior and make it work the linux way? I guess it involves replacing default programs like ls with some counterparts.
OS X's userland is a mash of BSD, (outdated) GNU, and Apple utilities.
If want your utilities to behave like their Linux counterparts, you should probably install the entire GNU coreutils suite with something like
Homebrew.
Once Homebrew is installed, just use it to install the coreutils:
$ brew install coreutils
Edit: I didn't have to update my $PATH personally, but YMMV.
If your shell isn't finding the Homebrew-installed coreutils, make sure /usr/local/bin (or your custom path, if Homebrew was configured as such) is before /usr/bin and /bin on $PATH.
In the best-case scenario, all programs dynamically link the system libc and use getopt to process their arguments. getopt only looks at arguments until it finds the first non-option argument, then stops. You cannot change this behavior of getopt. You would have to replace the system libc with one having a different implementation of getopt.
However, there is no guaranteed that all programs load libc dynamically; some might link statically, in which case replacing the system libc would have no effect. Others may not even use getopt. In either case, the only option is to replace the program with one that behaves the way you want.
Option processing is not a feature of the shell. You'd need to patch the argument processing logic in each individual utility.
Alternatively, you could install e.g. the corresponding GNU utilities. They are not completely option-compatible with the default *BSD utilities, so you can't replace the system binaries; but you can arrange your PATH so that the locally installed versions are preferred for your personal use. Homebrew is popular for managing this.
In Bash, ctrl-A jumps to the beginning of line, and M-n jumps past the first token.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
This question arose in my mind while I was installing JDK on Ubuntu. While I was installing JDK the steps are -
Extracting the .bin file of java.
Make a directory named java6 in /usr/lib and move all the content of extracted .bin file to the /usr/lib/java6.
Now soft a soft link is created in the current directory like this-
ln -s java6 java
I am surprised that the newly created link 'java' is used to set "JAVA_HOME" environment variable. As far as I know a similar thing is not possible in Windows.
More over while I am installing nexus I noticed the following -
$ ln -s nexus-2.7-06-bundle nexus
$ cd nexus
$ ./bin/nexus console
What I am trying to say here is - first we access the link directory (nexus), then we are running script (in /bin/nexus). I noticed these two approaches in several tutorials. I think these approaches should have some benefits.
Now my questions are that -
Why a link (/usr/lib/java) is set as JAVA_HOME; what is the advantage of doing so?
Why we are running the script (... /bin/nexus) from going to the soft link directory and what is the advantage of doing so?
When I am using the base directory instead of the link for the mentioned two cases, it also works fine. So, why these approaches?
If you install java7 instead of java6 (or java7 parallel to java6
or something else like that), if the JAVA_HOME variable and 100 other things are set
explicitly to java6, you would have to change them all to java7.
(and it is not trivial to find all config stuff which need changes).
With the link, you set all config stuff to the link and change only the link if necessary.And yes, this is possible on Windows too.
1) Why a link (/usr/lib/java) is set as JAVA_HOME; what is the advantage of doing so?
JAVA_HOME points to java you want to use (say java6)
JAVA_HOME is just a convention, usually software like eclipse, maven etc... use it to find where Java is located.
And yea it can be done in Windows too.
2) Why we are running the script (... /bin/nexus) from going to the soft link directory and what is the advantage of doing so?
Advantage none (It depends on you how you see it)
This Q is somewhat similar to Q1..
Say in future you want to use new version nexus-2.8-*. So instead of changing all configuration from nexus-2.7-* to nexus-2.8-*; you can just change the soft link nexus(to point the new version)
3) When I am using the base directory instead of the link for the mentioned two cases, it also works fine. So, why these approaches?
You answered you own Q!
Yep its a link; so nexus --> nexus-2.7-06-bundle; one and the same...
why the approach? see 3rd point of previous Q
Think of soft link as shortcut in Windows
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
My KDE is broken, the desktop Widgets cannot be displayed. And many KDE programs look like this:
All the software written in GTK is all right.
Can any one give me any suggestion about what's happening and which part is broken?
Where can I find error log?
You don't say what disto you're using (please add it to the tags in your question), nor how you got in this state - new installation? dist-upgrade? hard crash? That would be useful information.
But in general, here's what I would try:
Log out and go to a bare terminal with CTRL-ALT-F1, then login and rename your .kde / .kde4 directories: mv ~/.kde ~/.kde.old and reboot or otherwise restart your GUI system.
That will at least tell you whether the problem is messed up personal settings or messed-up system files.
If that doesn't fix the issue (that directory will be recreated when you start up KDE again; all your settings will be lost, but you can recover them - carefully, one by one - from the backup you just made), then I would first try sudo apt-get check (assuming you're on a Debian-based distro).
If that doesn't report any problems, then I would update my system - possibly even do a dist-upgrade without changes any sources.
If this issue still wasn't fixed, I would run sudo dpkg -l > ~/Desktop/dpkg_out.txt to get a list of installed or uninstalled packages and their state in a file, and then look through the file for problems as explained here.
Finally, if all of that failed, I would take a good hard look at my video drivers.
Good luck!
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I would like to backup a dir in Win XP on a Solaris server via rsync. I installed cygwin but when I type rsync I get 'command not found'. How can I install rsync? And how can I install ssh. I have installed Poderosa as ssh client (a sort of putty).
run your cygwin setup.exe again, and expand the categories to find 'rsync' and 'ssh'.
Much easier. Run setup, click through to the 'Cygwin Setup - Select Packages' window, and type 'rsync' in the 'Search' box at upper left. At this writing, this shows three lines, one of which is 'Net'. Expand Net and you'll find rsync. Click the circular arrow icon to mark it for install, then click Next at lower right.
You still need to install the rsync package. Run setup.exe again and go through the packages manually (it's probably in 'networking' or 'utilities').
When you run setup.exe, the package selection will be set to "default". You need to click on the top-level circular arrow picture until it says "Install" or "Full" (my memory fails me), it will do this for all sub-packages as well.
The first time you click on it, wait a few seconds - there's a long delay in getting from "default" to the next option.
That's the best way. All the times I've tried to select individual packages, I've had troubles so I've long since gotten into the habit of installing everything.
If all you want is rsync, the BackupPC project (OSS) has a slightly modified version of cygwin's rsync that runs without a full cygwin installation, and can even be installed remotely on PCs with IPC$. http://sourceforge.net/project/showfiles.php?group_id=34854&package_id=88133