5

I am installing the latest FFmpeg from this guide:

In some places it suggests performing make install without sudo, here is a single example of several:

cd ~/ffmpeg_sources
wget http://download.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
tar xjvf last_x264.tar.bz2
cd x264-snapshot*
PATH="$PATH:$HOME/bin" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static --disable-openclcd ~/ffmpeg_sources
wget http://download.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
tar xjvf last_x264.tar.bz2
cd x264-snapshot*
PATH="$PATH:$HOME/bin" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static --disable-opencl
PATH="$PATH:$HOME/bin" make
make install
make distclean

Should I being using sudo make install instead ?

My intention is to make the packages available for all users, including Apache/PHP.

g_p
  • 19,034
  • 6
  • 59
  • 69
dotancohen
  • 2,864

5 Answers5

9

In your case you don't need to do a sudo make install as you will install the library in your $HOME. You have configured the build to use a prefix and bindir to install it in your $HOME.

To make the package avaiable to other programs it would be better to choose directories outside of your $HOME. Then you will need to do the make install using sudo.

Uwe Plonus
  • 709
  • 4
  • 14
4

It depends upon where your package is going to be install.

During installation you need to enter sudo if you are performing installation in the system directories like /usr. You are needed to enter this because you do not have the write permission in that directory. A local install will not require sudo before make install

g_p
  • 19,034
  • 6
  • 59
  • 69
4

As an addendum, consider using checkinstall to generate a managed package, then installing it with dpkg or another apt tool. For installing software from source this can relieve many headaches when it comes time to upgrade, remove, or resolve problems.

orbatos
  • 61
  • 2
2

The guide you are following assumes that you wish to install ffmpeg to ~/bin/ in your HOME direcetory. This has the advantage of not needing sudo for installing but we will not be able to use ffmpeg system-wide from all users.

In addition, this path does not exist in a default Ubuntu installation, where self-compiled sytem-wide software should preferably go to /opt. See What is the best place to install user apps?.

In case we need to have access to ffmpeg from all users we should use an installation path outside our HOME for make install. This of course then requires sudo for installing. See also FFmpeg Compilation Guide.

Takkat
  • 144,580
0

If you are in doubt, almost certainly the answer is you should not use sudo.

Each time you try sudo make install you expose your system to potential bugs, as root.

I am a practicing sysadmin and regularly need to setup software for third parties; unless there is something that is truly system-aspect (such as a kernel module), most of the software gets installed and lives happily in user-space, even when shared by many, by employing ./configure --prefix

fi. >1000 software components visible here are all setup under a single regular user: https://hpc.uni.lu/users/software/

Example:

  • CUDA is a GPU development environment provided by nVidia; that's installed without sudo
  • nVidia GPU drivers though, need lower level access and thus, are done via sudo/root