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.
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 themake install
usingsudo
.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 requiresudo
beforemake install
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.
The guide you are following assumes that you wish to install ffmpeg to
~/bin/
in your HOME direcetory. This has the advantage of not needingsudo
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 requiressudo
for installing. See also FFmpeg Compilation Guide.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: