Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have apt-get 0.7.23.1 on host machine. I do not have root, thus not able to update it, or install other packages.

I want to download .deb packages with it, but neither

apt-get -d bash (Invalid operation bash)

nor

apt-get -d install bash (do not have root)

work.

On my home machine with a newer version of apt-get I can

apt-get download bash

and it does exactly what I want it to.

How can I perform the same on the host machine?

share|improve this question
    
You always need to be root to install packages. –  Takkat Jun 9 '11 at 16:28
    
@Takkat I don't need to install them –  disfated Jun 9 '11 at 17:55
1  

2 Answers 2

up vote 16 down vote accepted

The command apt-get download wasn't added until version 0.8.11 of apt. It was first available in Ubuntu 11.04 (which uses apt 0.8.13.2). I'm not sure what you're running as AFAICT no supported version of Ubuntu contains version 0.7.23.1 of apt. You should really have the system administrator upgrade the machine. (I know, not very helpful.)

It's not clear from your question whether or not you have access to a graphical environment. If you do, your best bet would be to grab the files from http://packages.ubuntu.com/

This is also possible from the command line as there are predictable urls. For instance:

wget http://archive.ubuntu.com/ubuntu/pool/main/a/apt/apt_0.7.25.3ubuntu9.4_i386.deb

You can find the correct version and whether the package is in main or universe by using apt-cache policy

This is of course scriptable. Here's a quick one:

#! /bin/bash

PACKAGE=$1

URI=`apt-cache show $PACKAGE | grep "Filename:" | cut -f 2 -d " "`

wget http://archive.ubuntu.com/ubuntu/$URI
share|improve this answer
    
i don't have gui and of course i know that i can download packages manualy. –  disfated Jun 9 '11 at 17:57
    
ok, there is an option --print uris, but it works fine only with download action. There is also a filename field in apt-cache show pkg, which i could wget, but it is absent in the older version... –  disfated Jun 9 '11 at 18:02
    
I'm not sure what you're asking for then. You are aware that the feature you want isn't available in the version of apt that you have, you can't install new packages (so any non-default application is out of the question), and you don't want to use wget. I added a quick script that find the correct url and pass it to wget. Beyond that I'm out of ideas. –  andrewsomething Jun 9 '11 at 18:21
    
@disfated I assume the system you're working on (the one local to you) has a GUI. Why not find the links locally (from packages.ubuntu.com) and paste the URLs over SSH (for wget)? –  Oli Jun 9 '11 at 22:17
    
@andrewsomething oh, there is a "Filename" field in my apt-cache - at first i didn't notice it. it's ok now - i have uri and have wget installed. thank you and all responders :) –  disfated Jun 10 '11 at 7:41

apt-get download [package] works without root privileges but only for Ubuntu Natty and newer. You can also use apt download [package].

If you've got aptitude installed, you can run use aptitude download [package]

share|improve this answer
    
Do not have aptitude installed –  disfated Jun 9 '11 at 16:19
1  
apt is a Java tool. - I edited your answer because you were almost there. I tested apt-get download banshee as a normal user and it works just fine (downloads the package to the current path). –  Oli Jun 9 '11 at 16:27
    
Ah. I've reverted the edit because I've just found out that version 0.7.23 of apt-get doesn't have a download function. –  Oli Jun 9 '11 at 16:31
    
@Oli man apt gives me a manual of a java application ,indeed (strange). However, if you type apt in a terminal, you'll notice that it's about the same thing as aptitude and apt-get. –  RobinJ Jun 9 '11 at 16:44

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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