When doing apt-get download -o RootDir=. apt
once it's downloaded the package it effectively tries to move it to
./$( pwd )/
(the prefix is whatever RootDir points to) instead of moving to
$( pwd )/
This causes it to fail unless you do a
mkdir -p ./$( readlink -f $( pwd ) )
Is this a bug or a feature?
On Sat, Oct 30, 2021 at 10:14:15AM +0100, Tim Woodall wrote:
When doing apt-get download -o RootDir=. apt
once it's downloaded the package it effectively tries to move it to
./$( pwd )/
(the prefix is whatever RootDir points to) instead of moving to
$( pwd )/
This causes it to fail unless you do a
mkdir -p ./$( readlink -f $( pwd ) )
Is this a bug or a feature?
Working as intended. 'download' wants to store the package in the
current directory, so it gets the absolute path name to that as "current directory" isn't a very stable property.
With RootDir (as the manpage explains) you say: Whatever the path, stick
this in front of it ? so you get what you asked for?
RootDir has some uses if you deal with chroots from the outside, but
fiddling even with absolute paths is usually not what you want ? the
manpage mentions Dir which effects only "relative" paths (most paths in
apt like where it finds its config files are relative to Dir ? which by default is '/' making it an absolute path in the process).
As you fiddle with directories you are likely to need APT_CONFIG as that
is parsed before the configuration files (and so can effect where those
are) and long before the command line is looked at (all at length
explained in the apt.conf manpage).
There is no option to set 'download's target directory from current
directory to another place at the moment. Shouldn't be incredibly hard
to implement if someone wanted to try (apt-private/private-download.cc
? DoDownload() ? implement an option who sets Dir::Cache::Archives to something else than the absolute CWD ? absolute? I already mentioned
what would happen otherwise, so connecting the dots is left as an
exercise for the reader).
So, what are you actually trying to do?
And next time, try to pick a slightly more sensible title and perhaps
even a more fitting place to ask first? I am ever so slightly annoyed
if I am kicked into high gear expecting a world ending disaster as it escalated to an apt-thread on debian-devel?
(so now, where were I before this 'emergency call' came in? mhhh)
I bootstrap exclusively using apt and dpkg, with a few minor tweaks so
that apt can reliably generate a successful install plan when installing
the initial essential packages after dpkg has unpacked them.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 339 |
Nodes: | 16 (2 / 14) |
Uptime: | 00:03:20 |
Calls: | 7,466 |
Calls today: | 2 |
Files: | 12,691 |
Messages: | 5,627,862 |