murphycj
murphycj

Reputation: 83

Permission denied while running make install for util-linux

I' am trying to install util-linux on a machine which I don't have root access. The commands I run:

cd util-linux-2.29
./configure --prefix=$( pwd ) --disable-use-tty-group
make
make install

I get the following error after running make install (I truncated the output):

chmod 4755 /athena/elementolab/scratch/chm2059/from_dat02/chm2059/lib/util-linux-2.29/bin/mount
chmod 4755 /athena/elementolab/scratch/chm2059/from_dat02/chm2059/lib/util-linux-2.29/bin/umount
make[4]: Leaving directory `/athena/elementolab/scratch/chm2059/from_dat02/chm2059/lib/util-linux-2.29'
/usr/bin/mkdir -p '/usr/share/bash-completion/completions'
/usr/bin/install -c -m 644 bash-completion/blkid bash-completion/cal bash-completion/col bash-completion/colcrt bash-completion/colrm bash-completion/column bash-completion/findmnt bash-completion/flock bash-completion/getopt bash-completion/hexdump bash-completion/ipcmk bash-completion/ipcrm bash-completion/ipcs bash-completion/isosize bash-completion/logger bash-completion/look bash-completion/lsipc bash-completion/lsns bash-completion/mcookie bash-completion/mkfs bash-completion/mkswap bash-completion/namei bash-completion/prlimit bash-completion/readprofile bash-completion/renice bash-completion/rev bash-completion/script bash-completion/scriptreplay bash-completion/setsid bash-completion/tailf bash-completion/whereis bash-completion/wipefs bash-completion/fsck bash-completion/mkfs.bfs bash-completion/fsck.minix bash-completion/mkfs.minix bash-completion/fsck.cramfs bash-completion/mkfs.cramfs bash-completion/addpart bash-completion/delpart '/usr/share/bash-completion/completions'
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/blkid’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/cal’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/col’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/colcrt’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/colrm’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/column’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/findmnt’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/flock’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/getopt’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/hexdump’: Permission denied
/usr/bin/install: cannot create regular file ‘/usr/share/bash-completion/completions/ipcmk’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/ipcrm’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/ipcs’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/isosize’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/logger’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/look’: Permission denied
/usr/bin/install: cannot create regular file ‘/usr/share/bash-completion/completions/lsipc’: Permission denied
/usr/bin/install: cannot create regular file ‘/usr/share/bash-completion/completions/lsns’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/mcookie’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/mkfs’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/mkswap’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/namei’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/prlimit’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/readprofile’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/renice’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/rev’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/script’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/scriptreplay’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/setsid’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/tailf’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/whereis’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/wipefs’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/fsck’: Permission denied
/usr/bin/install: cannot create regular file ‘/usr/share/bash-completion/completions/mkfs.bfs’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/fsck.minix’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/mkfs.minix’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/fsck.cramfs’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/mkfs.cramfs’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/addpart’: Permission denied
/usr/bin/install: cannot remove ‘/usr/share/bash-completion/completions/delpart’: Permission denied

I' am not sure how to go about this. After running configure, it does confirm that prefix is set to what I set it to.

Upvotes: 1

Views: 2245

Answers (3)

Sachin Bharadwaj S
Sachin Bharadwaj S

Reputation: 121

Installation requires su permission.

Try sudo make install

Upvotes: 0

Ljm Dullaart
Ljm Dullaart

Reputation: 4969

A make install without root permissions is always tricky. You will almost always loose some of the functionality.

The way to go in these kind of situations is to go through the configure file.

./configure --prefix=$( pwd ) --disable-use-tty-group --disable-bash-completion

should get rid of these messages, at the expense of no longer being able to do bash-completion. You could also go through the Makefile and see if somethings have to be changed there (for example: there should be a line

bashcompletiondir = /usr/share/bash-completion

or something like that. You can try to change that directory. But, unless this is for a one-off test, I would not recommend that.

Upvotes: 0

murphycj
murphycj

Reputation: 83

While looking at the make file I found the following comments:

#
# Don't rely on configure.ac AC_CONFIG_FILES for install paths.
#
# The paths should be expanded at make time rather than configure:
#  - to support 'make install prefix=/foo DESTDIR=/foo'
#  - to recursively expands the paths (e.g. AC_CONFIG_FILES expands
#    '${exec_prefix}/sbin' to ${exec_prefix}/sbin')
#

So I ran:

make install prefix=$( pwd ) DESTDIR=$( pwd )

which worked!

Upvotes: 2

Related Questions