Avoid making local installs into system directories. The system directories eg /usr, are reserved for the package management system to use. By definition, if you are doing make install that means you are making a local install, and if you need to do sudo make install that means you don't have permission to wherever you are writing.

So, if you are getting permission errors with make install, check and see whether you are trying to install into system directories, and install into /usr/local or similar instead. /usr/local is reserved for local installations. You may need to give yourself permission to write to /usr/local, but this is usually easily done. On Debian this can be done by adding yourself to the staff group. Better still, find or create a binary package, and install that instead. That way you can easily keep track of installed packages and obtain the other benefits of package management.

Note that the package management system conversely does not install into /usr/local, per the FHS. See Section 9.1 of the Debian Policy Manual- File system hierarchy for an overview.

Answer from Faheem Mitha on Stack Exchange
Top answer
1 of 3
21

Avoid making local installs into system directories. The system directories eg /usr, are reserved for the package management system to use. By definition, if you are doing make install that means you are making a local install, and if you need to do sudo make install that means you don't have permission to wherever you are writing.

So, if you are getting permission errors with make install, check and see whether you are trying to install into system directories, and install into /usr/local or similar instead. /usr/local is reserved for local installations. You may need to give yourself permission to write to /usr/local, but this is usually easily done. On Debian this can be done by adding yourself to the staff group. Better still, find or create a binary package, and install that instead. That way you can easily keep track of installed packages and obtain the other benefits of package management.

Note that the package management system conversely does not install into /usr/local, per the FHS. See Section 9.1 of the Debian Policy Manual- File system hierarchy for an overview.

2 of 3
5

As has been answered above, sudo make install lets you install the files in directories which are otherwise read-only to you as a user.

The problem I can foresee is that at a later date you may want to uninstall or upgrade the program. If you still have the source code directory tree then a make uninstall will uninstall the program for you but if, as many other typical users, you had deleted the source code directory tree then you are out of luck. And since you have not installed the program using a package management system, you may also be unable to uninstall the program that way.

The best way to install such programs may be to install them in your home directory. Pass the option --prefix=/home/<user>/<some>/<directory> to ./configure. This will allow you to use make install instead of sudo make install since /home/<user>/<some>/<directory> is writable by you. Also uninstallation is a snap -- rm -rf /home/<user>/<some>/<directory>

🌐
Reddit
reddit.com › r/linux › why "sudo make install"?
r/linux on Reddit: Why "sudo make install"?
September 14, 2023 -

Why do that many projects recommend to push compiled binaries to the filesystem root?

edit Ok. I might have been wrong. My /usr/local ist empty. If stuff only gets installed there, my argument is invalid. I still feel pretty insecure about doing a make install, because it at least could conflict with the system installation.

Thanks for answering. /edit

I have a folder ~/usr where I push all compiled stuff. I then do cmake -DCMAKE_INSTALL_PREFIX=$HOME/usr/ or ./configure --prefix ... and then install that without sudo. Some big projects I compile even have their own prefix.

Sure you have to tell your users to have ~/usr/bin in your PATH. I also added that to my LD_LIBRARY_PATH and PKG_CONFIG_PATH. But IMO that should be a default thing to do for Linux users (who compile stuff).

Polluting your distro installation with random crap is a sure way to get issues later. Its far worse then anything you can do to install Software on Windows.

I mean compiling a bleeding edge kicad, inkscape or jpeg-xl is easy. But will probably trash your system if you already have an older version installed.

(Some projects tell you to build a distro package and sudo install that. Much better, but I still prefer having the binaries in my own prefix. Also a lot got better, since many big projects publish daily snapshots as Appimage or similar.)

edit2 I was of course talking about a single-user system for users who sometimes like to test bleeding edge software. Not Multi-user sytems. Not Grandma, who's not allowed to install stuff. edit

Discussions

makefile - How to successfully run make install without root privileges - Stack Overflow
I'm trying to package an RPM of a systemd service written in C and managed by autoconf and autotools. I've learned that I should not build programs as root, which means that I should run make instead of sudo make, which is not a problem. However the next step, running make install, produces ... More on stackoverflow.com
🌐 stackoverflow.com
linux - "Make install" vs "Make install clean"? - Stack Overflow
[...] Note: You can save two extra ... make install and make clean as three separate steps. Also, as a side note: Don't build your package as root unless you really need to. In general you should work in an unprivileged account and then as a final step you can do sudo make install ... More on stackoverflow.com
🌐 stackoverflow.com
[solved] sudo make install fails - www.makemkv.com
I decided to do a fresh install the other day, but wanted to try the new Ubuntu Cinnamon Remix distro. I couldn't get MakeMKV to install but thought it may be some issue with Remix so I've reinstalled Linux Mint (19.3) today but the install still fails. Every time I run 'sudo make install', ... More on forum.makemkv.com
🌐 forum.makemkv.com
"sudo make install" returns "make: Nothing to be done for 'install'."
The last step won't work, guessing because there is no install file in the directory? Using Ubuntu (POP!_OS) 19.04 Everything else went sooth. Can open the app just fine, but it does not instal... More on github.com
🌐 github.com
6
May 3, 2019
Top answer
1 of 5
78

Make is a general purpose workflow program, usually used for compilation. But it can be used for anything.

When you do something like "make all", the make program executes a rule named "all" from a file in current directory named "Makefile". This rule usually calls the compiler to compile some source code into binaries.

When you do "make install", the make program takes the binaries from the previous step and copies them into some appropriate locations so that they can be accessed. Unlike on Windows, installation just requires copying some libraries and executables and there is no registry requirement as such. In short, "make install" just copies compiled files into appropriate locations.

2 of 5
54

make install does whatever the Makefile author wants it to do. Typically, by this point, it is too late to change the install directory, as it is often known earlier, during the build, so help files and configuration files can be referenced with the correct pathnames.

Many projects use the GNU Autotools to try to improve their portability among hardware and operating system differences. (Different Unix variants use slightly different headers for declarations of functions that are slightly off the usual path -- except most programs need one or another of the ones declared in different locations.)

When a project does use the Autotools, the normal mantra to install it is:

./configure
make
make install

The ./configure typically allows you to use a command line option like --prefix /opt/apache or something similar to specify a different pathname. /usr/local/ is a common default prefix. It is far easier for locally built software to live in one place and distribution-provided software to live in the "main directories": /usr/ /bin/, and so on. (Packagers are very careful to never touch files in /usr/local/ -- they know it is exclusively for system administrators.)

Anyway, the ./configure --prefix /path/to/new/prefix will set a variable in the Makefile that is available when compiling the program, modifying the manual pages so they point to the correct locations for files, modifying configuration files, etc. So make will build the software specifically for the install location you want and make install will install it into that location.

Most programs can run even without the final make install step -- just ./program_name will often start them up. This is definitely a per-project thing -- some, like postfix, qmail, etc., are made up of many different moving pieces and rely on them all working together. Others, like ls or su might be self-contained enough to execute fine from the directory they were built in. (This is not often useful -- but sometimes very useful.)

However, not all projects use the Autotools -- they are huge, complicated, and miserable to maintain. Hand-written Makefiles are much simpler to write, and I personally think just distributing a simple Makefile with configuration variables available is a lot easier on developers and users both. (Though the ./configure ; make ; make install mantra is really easy on users when it works.)

🌐
Medium
medium.com › @sarahh2 › dont-run-sudo-make-install-5debc22bda4b
Don’t run sudo make install. Why not, and what can I use instead? | by Sarah | Medium
June 18, 2020 - You can build a package out of the program at hand and install it as you would a package from the repositories, or any other freshly downloaded package. How do you do that? For Debian-based distros, you can use checkinstall to build a package for your distribution. Checkinstall works as a drop-in replacement for the dreaded sudo make install above:
🌐
Sudo
sudo.ws › docs › install
Sudo Installation Notes | Sudo
Optionally, type make check to build and run the sudo unit and regression tests. For more verbose output, use make check-verbose. Type make install (as root) to install sudo, visudo, the man pages, and a skeleton sudoers file. The install will not overwrite an existing sudoers file.
Find elsewhere
🌐
Thoughtbot
thoughtbot.com › blog › the-magic-behind-configure-make-make-install
The magic behind configure, make, and make install
August 5, 2024 - Since the install step is also defined in the Makefile, where the software is installed can change based on options passed to the configure script, or things the configure script discovered about your system. Depending on where the software is being installed, you might need escalated permissions for this step so you can copy files to system directories. Using sudo ...
🌐
GeeksforGeeks
geeksforgeeks.org › installation guide › how-to-install-make-on-ubuntu
How to install make on Ubuntu - GeeksforGeeks
July 23, 2025 - Enter the below command to install the make package. sudo apt install make · Install make on Ubuntu · After installing, we will check the make directory on our system in order to use the make package.
🌐
Stack Overflow
stackoverflow.com › questions › 77184153 › how-to-successfully-run-make-install-without-root-privileges
makefile - How to successfully run make install without root privileges - Stack Overflow
I'm trying to package an RPM of a systemd service written in C and managed by autoconf and autotools. I've learned that I should not build programs as root, which means that I should run make instead of sudo make, which is not a problem. However the next step, running make install, produces ...
🌐
MakeMKV
forum.makemkv.com › board index › os-specific forums › makemkv for linux
[solved] sudo make install fails - www.makemkv.com
$ make clean $ ./configure $ make $ sudo make install Look for this line in the configure output, to indicate that the system install command is being picked up properly:
🌐
GitHub
github.com › VirusTotal › qt-virustotal-uploader › issues › 13
"sudo make install" returns "make: Nothing to be done for 'install'." · Issue #13 · VirusTotal/qt-virustotal-uploader
May 3, 2019 - The last step won't work, guessing because there is no install file in the directory? Using Ubuntu (POP!_OS) 19.04 Everything else went sooth. Can open the app just fine, but it does not install to the system.
Author   VirusTotal
🌐
Zcash Community
forum.zcashcommunity.com › technical support
Sudo make install no longer working - Technical Support - Zcash Community Forum
May 23, 2023 - Hi, I’ve just successfully compiled v5.5.1, but my usual ‘sudo make install’ is failing. Here are the steps I follow (which historically have worked): $ git clone https://github.com/zcash/zcash.git $ cd zcash $ git checkout v5.5.1 $ ./zcutil/fetch-params.sh $ ./zcutil/clean.sh $ ./zcutil/build.sh $ sudo make install make: *** No rule to make target 'install'.
🌐
Linux.org
linux.org › home › forums › general linux forums › getting started
Should i use sudo when doing ./configure;make;make install? | Linux.org
May 31, 2021 - Hi there, use ./autogen.sh, ./configure and make as your normal user, but prefix "make install" with sudo to install the program files to /usr/local (which is root-owned).
🌐
Quora
quora.com › Why-are-there-both-sudo-apt-get-install-and-sudo-make-install
Why are there both 'sudo apt-get install' and 'sudo make install'? - Quora
Answer (1 of 2): The other answers are good. “apt-get install” searches the distro repositories for the binary package you want to install, downloads it and installs it. “make install” is part of the process when you have the source code for a program and you want to install it as an ...
🌐
Emweb
redmine.emweb.be › issues › 2985
Bug #2985: "sudo make install" doesn't ensure proper file permissions - Wt - Redmine
You are right. When make install (actually sudo make install) installs just binaries and other files, there's no need to run ldconfig (even though it wouldn't harm). But when you install dynamically loaded libraries (aka shared libraries, aka .so files) you have to.
🌐
DEV Community
dev.to › skypy › linux-make-install-command-2dd6
Linux make install command - DEV Community
September 1, 2021 - $ sudo make install ./installer.sh /opt/testapp kiwi kiwi 'testapp' -> '/opt/testapp/bin/testapp' (backup: '/opt/testapp/bin/testapp~') 'testapp.conf' -> '/opt/testapp/etc/testapp.conf' (backup: '/opt/testapp/etc/testapp.conf~') installation ...