title: Could I use yum to install package on redhat without root?
body: <p>I recently rent a server for web-app testing purpose. Below is my server info, I assume it's Redhat linux. (I have used Ubuntu for a while).</p>
  
  <blockquote>
  <pre><code>Python 2.6.6 (r266:84292, Jul 23 2015, 15:22:56) 
  [GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2
  </code></pre>
  </blockquote>
  
  <p>When I wanted to install tmux on the server, I was thinking about using YUM for ease (not compile myself). When I type yum in terminal, nothing come out.</p>
  
  <pre><code>nl0391 [~]$ which yum
  nl0391 [~]$
  </code></pre>
  
  <p>There is no rpm as well.</p>
  
  <p>I supposed there is no yum installed. So I was thinking about installing yum myself from source. I got sources of yum and found I need gettext for installing yum. So I compiled gettext on my home successfully and continued to compile yum.</p>
  
  <p>First I used <code>./configure --configure=~/.usr/local</code> to point to my home dir which I have permission to write.</p>
  
  <p>Then <code>make</code> and <code>make install</code>.</p>
  
  <p>During <code>make install</code>, there's some problem with <code>/etc/yum.config</code>. It was also the permission issue so I change the <code>MakeFile</code> to let config in my <code>~/ect/yum.config</code>. This helped to successfully compile yum and finish installation.</p>
  
  <p>I can successfully run command <code>yum</code> or <code>man yum</code>. I believe the installation is right.</p>
  
  <p>But when I ran <code>yum install tmux</code> or <code>yum info</code> (let yum do something), the errors kept going out like below:</p>
  
  <pre><code>error: cannot open Packages database in /var/lib/rpm
  Traceback (most recent call last):
    File "/home/wxx920521/.usr/local/bin/yum", line 31, in &lt;module&gt;
      yummain.main(sys.argv[1:])
    File "/home/wxx920521/.usr/local/src/yum-2.0.7/yummain.py", line 163, in main
      (log, errorlog, filelog, conf, cmds) = parseCmdArgs(args)
    File "/home/wxx920521/.usr/local/src/yum-2.0.7/yummain.py", line 75,       in parseCmdArgs
      conf=yumconf(configfile=yumconffile)
    File "/home/wxx920521/.usr/local/src/yum-2.0.7/config.py", line 155,     in __init__
      self.yumvar['releasever'] = self._getsysver()
    File "/home/wxx920521/.usr/local/src/yum-2.0.7/config.py", line 285, in _getsysver
      idx = ts.dbMatch('provides', self.distroverpkg)
  _rpm.error: rpmdb open failed.
  </code></pre>
  
  <p>I even changed the python files of YUM to fix the <code>yum.conf</code> file path issues, but for rpmdb issue I just realized manually resolving this path might be nightmare and impossible.</p>
  
  <p>So I am wondering if I can use YUM on the root for which I don't have root permission? I can directly compile tmux in my home. Is it worthwhile to devote time compiling yum which potentially can't use if no root? Since I know on ubuntu <code>apt-get install</code> needs sudo before any usage?</p>
  
  <p>Any idea is appreciated.</p>