1

I would like to install a bunch of packages (glogg, libprotobuf7, libleveldb1, libsnappy1, libhdf5-7) on an Ubuntu system on which I do not have root privileges. (I understand that this can be achieved by forcing the downloading and installation to take place on my home directory for example).

I would like to do this as fast as possible, e.g using apt (rather than manually searching the web for a link address to the package, then wget-ing it, then opening the tarball, then reading the INSTALL file to install correctly etc).

Is there a way to do this?

How can I install a package without root access? has a 1st answer that assumes that we have the .deb file already downloaded. This is not my case (and if you know of a way to get it quickly without scouring the web, I'd love to know).

5
  • For the record, aptitude and apt-get are two different frontends. Jul 8, 2014 at 16:47
  • The deb packages that are downloaded for installation don't contain INSTALL files, and are meant to be read by dpkg to be parsed and installed. Also, note that the packages contain two files: data.tar.xz, which contain the files to be installed relative to /, and control.tar.xz, which contain metadata about the package (package name, dependencies, installed size, etc.) and any configuration scripts. Jul 8, 2014 at 16:51
  • what are you trying to install Jul 8, 2014 at 16:52
  • 2
    You can download the package by using apt-get download <package_name> without root access and follow the answer in that question
    – M.Tarun
    Jul 8, 2014 at 17:08
  • I've modified the proposed duplicate to make it one by adding how to get the .deb from the repositories. Jul 15, 2014 at 12:25

2 Answers 2

4

As mentioned in one of the comments, use apt-get just to download, then dpkg -i to install.

mkdir $HOME/.local
apt-get download <package_name>
dpkg -i --force-not-root --root=$HOME/.local <package_name.deb>

Note: what's nice is that apt-get automatically picks the package that fits your Ubuntu distribution and your architecture.

1
  • 2
    aptitude download <package_name> will also work. Jul 8, 2014 at 17:17
3

I guess the following would work to install the package to a directory: ~/local/

Download the package as package.deb using :

apt-get download <package_name>

Then run

dpkg --install package.deb --instdir=~/local
1
  • Results in dpkg: error: requested operation requires superuser privilege, does not fix the requested issue. Sep 15, 2022 at 15:53

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