Install package without root privileges and compiling to specific directory

5,992

Solution 1

dpkg -i gedit_3.10.4-0ubuntu4_amd64.deb --force-not-root --root=~/test 

You have not provided the filename where it expects the filename, so it throws the error "no such file or directory".

Solution 2

I actually made a tool for this purpose https://github.com/z3r0n3t/pkget I really hope it helps someone just see the readme

Share:
5,992

Related videos on Youtube

scs
Author by

scs

[email protected]

Updated on September 18, 2022

Comments

  • scs
    scs over 1 year

    I would like to automatically install the required software in a shell script if it is not already present. I would like to use apt-get to install software (my example is gedit) to a specific directory without using root privileges and without running additional program specific scripts for compiling the software.

    I tried the approach from https://askubuntu.com/questions/193695/installing-packages-into-local-directory (last post from user172681) with the example of gedit, but it results in an error.

    Example:

    cd test
    
    apt-get download gedit
    

    Get:1 http://de.archive.ubuntu.com/ubuntu/ trusty/main gedit amd64 3.10.4-0ubuntu4 [478 kB] Fetched 478 kB in 0s (3.356 kB/s)

    ls
    

    gedit_3.10.4-0ubuntu4_amd64.deb

    dpkg -i --force-not-root --root=~/test gedit_3.10.4-0ubuntu4_amd64.deb
    

    dpkg: error: unable to access dpkg status area: No such file or directory

    Any ideas ?

  • Nathan.Eilisha Shiraini
    Nathan.Eilisha Shiraini almost 7 years
    Welcome to SuperUser! While your answer appears correct, remember that you can use Markdown formatting, especially it is good practice to surrond command lines in `` backticks, or indent them with four spaces.