2
 sudo yum install automake libtool flex bison pkgconfig gcc-c++ 
     boost-devel libevent-devel zlib-devel python-devel ruby-devel

for installing required packages for Thrift on CentOS 5..

is it possible to run a version of it without sudo?

EDIT: I do NOT have root access and I am NOT in the sudoers file. I want to know whether I can do something like yum install automake ....... without waiting/asking to get added to the sudoers file

2
  • 1
    sudo allows a permitted user to execute a command as the superuser or another user, as specified in the sudoers file. May 21, 2011 at 9:23
  • That's the whole point of sudoers and etc. You can't if you don't have the privileges. Otherwise each user might install whatever package he wanted without check. May 21, 2011 at 9:37

5 Answers 5

2

Yes it is possible but not without root access. The sudo command would not be required if you had sufficient privileges to access what your full command needs.

For instance, if you logged in as root. Or, first become 'superuser' by issuing the command:

su 

This will actually require the root password. Neither is recommended. It is best to use a system with the least privileges necessary and use sudo when needed, just as your full command already does.

Installing anything major (developer tools) are almost always going to require access of folders outside your home folder ~/

*This applies to all distributions of linux, not only the CentOS which you are using.

2

Never tried to do something like this myself but afaik rpm packages (atleast properly packages ones) do support relocation. But in order to install packages without root access, there are some steps required.

Following is lifted from linuxquestions.org:

Setup a private RPM database

mkdir -p /home/username/local/lib/rpm
rpm --initdb --root /home/username/local --dbpath /home/username/local/lib/rpm

If you do not like ~/local/lib/rpm, you can pick a different subdirectory structure.

Check for package dependancies

rpm -ivh package.rpm

If dependancies are found, install the dependant RPMs before installing the package RPM.

Finally install the package

rpm --root /home/username/local --dbpath /home/username/local/lib/rpm \
--relocate /usr=/home/username/local --nodeps -ivh package.rpm

To use the package you will have to play around with LD_LIBRARY_PATH to let the loader know where the required shared labraries are and modify your PATH to include any required scripts and executables.


1

sudo grants a command root permissions if the current user is allowed to use sudo.

If you've already root access, there is no reason for putting it in front of a command besides logging. Just remove sudo if you don't have sudo installed and already running as root:

yum install automake libtool flex bison pkgconfig gcc-c++ 
     boost-devel libevent-devel zlib-devel python-devel ruby-devel

If you're not root yet and the root account has a password set, run su and use your root password to login.

2
  • I do not have su or root access is the problem...is there any way to install stuff without those privileges?
    – algorithmicCoder
    May 21, 2011 at 9:34
  • 1
    Those packages installs to directories like /usr/bin which are writeable only by root. The programs in the packages make assumptions about the location of files, you cannot just install those packages in, say, your home directory. Can't you just compile the packages on a machine on which you've the compiler tools available, and move them to this machine on which you do not have root permissions?
    – Lekensteyn
    May 21, 2011 at 9:38
0

Sudo command is used to grant single operation in superuser's authentication. If you want to skip the sudo command, you have to log in as superuser by using command "su".

0

It is. Assuming that you pulled this install line off of some website, it's customary to include the sudo line in the event the user did not do it themselves. However, it's usually a good idea anyway because giving a program you trust root access allows it to make necessary changes on a global level.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .