Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
37
rated 0 times [  37] [ 0]  / answers: 1 / hits: 115307  / 2 Years ago, thu, february 17, 2022, 8:14:22

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?


More From » apt

 Answers
0

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

[#44720] Friday, February 18, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ciousuntru

Total Points: 352
Total Questions: 124
Total Answers: 95

Location: Grenada
Member since Tue, Oct 12, 2021
3 Years ago
;