2

I wonder what make install does that after successfully running this command after I just compiled a source package, my system becomes aware of the new installed package.
Let's assume I have retrieved a pre-compiled Linux package from somewhere for my distribution and want to use install rather than merely cp to install the whole unzipped package under /usr/local making sure that I do everything that a typical sudo make install does for this package. I tried running sudo install -r -T ./[pre-compiled package] /usr/local aiming to recursively copy everything to /usr/local, but it fails and seems to do nothing.

1
  • 5
    make install might do a lot of things, and what needs to be done depends on the software you're installing. Commented Jul 27, 2017 at 6:59

1 Answer 1

6

make install executes the commands listed for the target named install in ./Makefile (and the commands for any other not-yet-completed targets that install depends on - e.g. the install target usually depends on the build target(s)). As @Henrik said, these could be anything...copying files, creating directories, setting ownership and/or permissions, creating or copying initial config files, and much more.

BTW, make install and the install command are two completely different things. The former executes a Makefile target called "install". The latter is kind of a fancy version of cp on steroids that can set owner, group, permissions, and do a bunch of other stuff that is useful when installing software - install is often used by install targets in Makefiles.

Anyway, make and make install are pretty much irrelevant to what you want to do - install pre-compiled software.

To install pre-compiled software, if you have a package for your distro (e.g. a .rpm or .deb file), then use the distro packaging tools to install it - e.g. dpkg on debian/ubuntu, rpm for fedora etc. If you don't have a copy of the package yet, but it is available as a package for your distro then use apt (debian) or dnf or yum (fedora) to fetch and install it.

For pre-compiled software that isn't a proper distro package (e.g. a tar.gz containing a bunch of files), and you can't find source code or a package for it, your best option is to use a program like GNU Stow or similar.

stow makes it fairly easy to install unpackaged software and still be able to uninstall it later (e.g. to prepare for upgrading to a new version) without leaving a huge mess of orphaned files behind....which is exactly what a simple untar or cp will do.

Unmanaged software is a mess waiting to happen. Use the package tools provided by your system if at all possible. if not, use something like stow.


One other program I intended to mention when I wrote this yesterday was checkinstall, but I just couldn't remember its name until now. checkinstall makes it easy to make a functional, if less than perfect, package of any software that you would otherwise install with make install. It's not much use for binary-only pre-compiled programs (e.g. proprietary software) but can be very useful when the source is available.

1
  • Tthere are several questions tagged /stow here with useful and informative answers. Commented Jul 27, 2017 at 10:00

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.