I am non-root user. Mu sudoers file allows me to sudo apt-get install and to sudo dpkg. So basically I can install any *.deb files, which I rarely need to do because I can get most stuff with apt-get install.

Sometimes there is a package I want to install that is not on one of the sources listed in my /etc/apt/sources.list. I can not write to /etc/apt and I can not sudo apt-key add.

So my question is: given a package repository, is there a way for a non root user to download a particular package as a *.deb file plus all the (missing) dependencies as *.deb files (and install them)? Will this mess something up?


How I install the packages warsow and warsow-data from http://archive.getdeb.net/ubuntu xenial-getdeb games

This is just an example package.


Assuming you can boot a live system I guess in your case it might be the best procedure, to perform your tasks in there and then transfer your downloaded packages over.

The following is regarding using a live-dvd (with a stick it should be more easy as long as you made it use the free space as persistent storage).

Boot your live-dvd and select 'try ubuntu', when finished attach a usb-stick. Open gnome-disk-utility, find your usb-device and unmount it, also write down it's device-path (for this example we will use /dev/sdb1).

Now open a terminal with Ctr-Alt-t and type sudo mkdir -p /var/cache/apt/archives/ this will take care that this directory truly exists.

In the same terminal, you now mount the usb-stick to that point sudo mount /dev/sdb1 /var/cache/apt/archives (be sure to use the correct device).

So now we will add the repository holding the software you want:

  • for classic deb-archives: sudo echo "deb http://archive.getdeb.net/ubuntu xenial-getdeb games" >> /etc/apt/sources.list.d/getdeb-games.list add the pgp-key wget -q -O- http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -
  • for ppa's: sudo apt-add-repository someppa/ppa

Now we update our package lists sudo apt-get update and download the packages sudo apt-get install -d warsow; the -d options makes apt-get only download the package and all dependencies.

Voila finished, all your needed packages are now on your stik. Reboot into your normal system, attach the stick, open a terminal and cd into the stick and there issue sudo dpkg -i *.deb to manually install all packages and then run sudo apt-get install -f to clean everything up.

This procedure can bring in newer versions of already installed packages depending what repositories you use, so be careful, what you download and install. With third-party repositories there is also always the probability to catch yourself a flu or a virus, so think about what you do.

  • To clarify: I aware that I can install any deb package once I have it. My question is about getting those packages, given an apt source and package name. – Dimitri Schachmann Nov 8 '16 at 17:35
  • give my an example and I'll try to show you – d1bro Nov 8 '16 at 17:41
  • I updated my question. – Dimitri Schachmann Nov 8 '16 at 18:44
  • rewrote the answer, this might also be possible with a virtualmachine and passing through a usb-stick. – d1bro Nov 8 '16 at 18:50
  • plus are you sure you want to mess with this system? why not ask your sysadmin/dad/mom? - oh yeah it is due to warsow ;) – d1bro Nov 8 '16 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.