« first day (2520 days earlier)      last day (1552 days later) » 

1:31 AM
Sorry if this has been asked many times before, but I can't seem to formulate the right search terms!

Basically, I want to install a local tar file in such a way that it's immediately available on the command line, just as if I had used "sudo apt-get install XYZ" (assume there are no dependencies).

I know how to unpack the tar and then compile with configure/make, but that just leaves me with an executable that I have to add a path to later.

I suppose I could copy to /bin and be done with it, but I just wondering what the standard practice was here.
2:06 AM
@SirGalahad The short answer is that you will usually use make install (or sudo make install). However, you should sometimes pass options to ./configure to configure where you want the software to be installed. The most common option for this is --prefix. The default prefix, when you don't tell configure what to use, is usually /usr/local (occasionally, a program or library's source code defaults to some other prefix).
So ./configure is usually equivalent to ./configure --prefix=/usr/local. To install software in your home directory install, you could use ./configure --prefix=/home/galahad (if /home/galahad is your home directory) or --prefix="$HOME". Then of course you must still build and install the software with make. I should say that not all software that is distributed in source code form is built this way. You should always look for documentation inside the extracted source code archive.
Most of the programs that are part of your system, including programs installed by package managers in the vast majority of GNU/Linux operating systems, are installed with a prefix of /usr. It is rare that you should pass that prefix to ./configure, because you generally want to avoid conflicts with system-provided software. As for what a prefix is, I recommend you take a look in these directories if you haven't already. (Sorry if you have and this part is obvious to you.)
As for what makes commands run when you type them even when you don't type a pathname that contains any / characters, and how that is related to the options you pass to ./configure and the result of running make install after running make... Are you familiar with the $PATH environment variable?
I just noticed, what you've said here is the same as your question. And I see the answer that has been posted there overlaps with what I've said here. You may want to edit your question to clarify what you need to know if that answer is not sufficient. Based on your comment on the answer, though, it seems to have told you what you want to know. (To everyone else: sorry for this wall of text.)
2:50 AM
@EliahKagan Actually that was a great explanation and a perfect elaboration of the answer I received there. Cheers!
@EliahKagan Hey, would you mind reposting your answer to that thread? I think it would be incredibly helpful to others in clearing up this confusion (for some reason, this just isn't a very well covered topic). Otherwise, I guess I could just append it to my question as a quotation or something...
1 hour later…
4:11 AM
A great article that I'm likely to start putting in comments when people post impossible debugging questions:
@SirGalahad I've posted an answer based on my chat messages above, with some more material to explain in more depth and to address the other major aspects of your question. In it I have included a link to these chat messages, in case anyone wants to see the more abbreviated version in the chat transcript. (Those chat messages are somewhat too long to make a reasonable "executive summary" section in the post.) If my answer is unclear or you have any questions, please let me know.
pfnuesel's answer is quite good and I think it is what most people will want to read first, but hopefully my answer will help some people as well.
@EliahKagan Love it. Great work man!
Thanks--I hope everything makes sense.
An interesting debugging puzzle:
Q: mysteriously disappearing file (except it's still there)

clo_jurI'm completely baffled by this one... Background I'm on macOS El Cap uname -a Darwin host-name 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 23 18:25:34 PDT 2016; root:xnu-3248.60.10~1/RELEASE_X86_64 x86_64 Problem Let's say that I am executing as user: jim I created an executable call...

I've just invited the author in here to discuss it.
clo_jur, whenever you get here: as a first step, how about you show the output of the following commands:
ls -l /usr/local/bin/phelper
file /usr/local/bin/phelper
printf '%s\n' "$PATH"
type phelper
type -a phelper
which phelper
4:36 AM
@Wildcard Was the post deleted?
4:57 AM
@Wildcard issue was solved. I managed to create and inject a dummy mv command which revealed an issue with the script itself. Although I'm still not sure why the basic mv command was failing. Thanks for the feedback.
5:25 AM
@clo_jur Okay, fair enough. :)
6:23 AM
@Kusalananda I'm a bit puzzled why removing dkms is considered a solution to anything. A workaround at best. Supposing you actually want to use dkms.
> Error! You must be root to use this command.
Since the command appears to be run as root, that's just weird.
@FaheemMitha Don't look at me, I just live here!
:-) Good morning! And welcome!
That question is not within what I know anything about. I'm not on Linux.
2 hours later…
8:29 AM
@Kusalananda Well, that permission error is weird. Never seen anything like it.
It's probably possible to track it down. though.
8:50 AM
@FaheemMitha As indicated by the text that Jeff linked to, it may have to do with the UID environment variable not being set properly.
@Kusalananda Yes, he said UID was 1000.
Though I don't understand how that's possible.
If this was as root.
Anyway, if that's really the case, it's not surprising the command bombed.
Though in another place he says id -u is 0.
UID is not a variable that is set by su or sudo, AFAIK, so it's probably just sloppy coding somewhere.
@Kusalananda it's set by bash, but not by dash, mksh or ksh
and it shouldn't be an environment variable, just a shell variable
if it's in the environment, that could be why it doesn't match: the UID changed but not the value of the UID variable because bash wasn't involved
it could also be due to real vs effective UID: UID is the real uid
9:14 AM
@Gilles So the issue might have been tht the variable was exported. Hm...
So if someone set UID, could that screw things up?
If they did so with export UID=$(id -ru)
... can't really test here.
Hmm, someone wants to assemble a mdadm array using another madam array. Is that even possible?
Q: On boot, automatically assemble mdadm array that uses another mdadm array

AlexI have two mdadm arrays on my system: alex@fileserver:~$ cat /proc/mdstat Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] md1 : active raid5 sdc1[0] md0[3] sde1[1] 7759197184 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU] md0 : active r...

@Kusalananda So if it was set as an environmental variable?
@FaheemMitha As Gilles said.
@Kusalananda I didn't follow what he said.
9:22 AM
... and I can't test Linux-specific things here to try to understand and make it clearer, sorry.
9:38 AM
@Kusalananda It's probably possible to run a Linux virtual machine in a BSD machine. OpenBSD, right?
@FaheemMitha I run both OpenBSD and Ubuntu as VMs on my Windows 10 laptop.
It's just that some Linux questions requires too much Linux-tinkering for me to be interested.
And yes, apparently nowadays, OpenBSD is able to run Linux VMs. I haven't done that though.
9:58 AM
@Kusalananda Windows? Eek. (Sorry, couldn't resist.)
@FaheemMitha Work laptop. I need Windows for one or two tasks.
@Kusalananda Apologies for my dumb (and predictable) response. It's hard to stop Windows bashing even when it's no longer as relevant as it used to be.
And I think I've said it before here, that running an OS in a VM is actually quite nice. I'm able to add and remove disks and set up internal networks between virtual hosts in a much free-er way than with real hardware...
@Kusalananda I should learn more about networking.
I was thinking about installing OpenBSD on my private Mac, but just the thought of the hassle of repartitioning if/when the initial partitions didn't turn out the way I wanted turned me off.
Three years ago I would have done it without blinking, but I have run so many varied setups virtually since then that I've become a bit soft I assume.
10:16 AM
@Kusalananda Soft?
I didn't know OpenBSD would run on a Mac.
@FaheemMitha It does.
@Kusalananda Good to know.
HOWEVER! If I type ./f and then autocomplete with <TAB>, I get a successful execution. BUT if I type ./foo without autocomplete, I get the same error:

-bash: ./foo: No such file or directory
@clo_jur ^^^^ this looks like the file name contains an invisible character
echo ./f<TAB> | od -t x1
Wildcard was right to insist that replacing the real executable name by foo made the question impossible to answer. You hid the problematic part.
If you'd copy-pasted the error message in your question without changing it, it would probably have contained the invisible character.
8 hours later…
6:05 PM
The review queue is totally empty! :-)
3 hours later…
9:21 PM
I've noticed that How to install tar file “globally”? has been closed as too broad. Is this because of the sentence at the end "As a bonus, it would be nice to know how to do this with RPM's and other types of packages as well"? Should the OP remove that? I don't really know why this is too broad and I think the OP might benefit from a comment explaining it--assuming the closure is even correct.
I admit I don't for sure where this community's general consensus lies about how broad is too broad.
1 hour later…
10:40 PM
@EliahKagan I think it's just fundamentally too broad. What can you say about "a tar file"?
It had votes for "unclear" too, which is also arguable.
It's not asking about tar files in general. It's asking how you install software that you have compiled by extracting a tar file and running ./configure and make.
> I know how to unpack the tar and then compile with configure/make, but that just leaves me with an executable that I have to add a path to later.
@EliahKagan that should have been closed as a duplicate. It's come up many times.
11:03 PM
I see what you mean. In a way it seems like it's narrower than questions like How to compile and install programs from source, though given the several topics I ended up talking about while trying to make my answer make sense, I kind of see how it could be viewed as a broad question too. Should I search for a more similar question it might be a duplicate of and post a comment if I find one?

« first day (2520 days earlier)      last day (1552 days later) »