[Bug 830492] Re: Downloads should not lock apt
James Haigh
James.R.Haigh at Gmail.com
Sat Nov 19 20:11:11 UTC 2011
Hey Michael, sorry I've not been participating recently.
I've had a good look at Aptdaemon and touched on the Python APT
bindings.
This is what I envision:
A transaction's download and install parts are separated.
== Install ==
The install part should be like apt-get's '--no-download' option, so
'_apply_changes' should never download files. No lock should be waiting
for a download; this is wasting time. Only
installs/removes/upgrades/triggers/etc should be holding a lock; the
things that actually need it.
When taking the next transaction in the queue in the function '_on_transaction_done', instead of:
next_trans = self._queue.popleft()
next_trans should be the next transaction /that has nothing to download/.
== Download ==
apt-get's '--print-uris' option outputs lines like this:
'http://gb.archive.ubuntu.com/ubuntu/pool/universe/g/gnash/gnash_0.8.9-1ubuntu1_i386.deb'
gnash_0.8.9-1ubuntu1_i386.deb 197240
MD5Sum:32996ac2d709e1c6e0b65a90272202bb
Of course all of this information can be represented in the form of a
magnet URI, something like this:
magnet:?as=http%3A//gb.archive.ubuntu.com/ubuntu/pool/universe/g/gnash/gnash_0.8.9-1ubuntu1_i386.deb&dn=gnash_0.8.9-1ubuntu1_i386.deb&xl=197240&xt=urn:md5:32996ac2d709e1c6e0b65a90272202bb
If the apt repo could also supply the BTIH, then the whole thing becomes
very easy. A 'xt=urn:btih:' parameter can be added to the magnet which
will be sent via RPC to Aria2 in daemon mode or deluge's server part.
This approach could also allow load balancing of mirrors by specifying
multiple Acceptable Source ('as') params to the magnet, and would make
it trivial to obtain packages from other machines on the LAN making
downloads upto 2 orders of magnitude faster out-of-the-box.
I prefer the idea of having only one download utility on a machine (or
even a LAN), this way downloads can be reordered or paused by any RPC
client.
When each file completes it is placed in /var/cache/apt/archives/ as
usual, and of course when all files for a transaction complete, that
transaction can be applied.
So how is this sounding? Personally, I can't wait to get this working.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apt in Ubuntu.
https://bugs.launchpad.net/bugs/830492
Title:
Downloads should not lock apt
Status in APT:
Won't Fix
Status in Aptboost:
In Progress
Status in The synaptic package manager:
Won't Fix
Status in “apt” package in Ubuntu:
Won't Fix
Status in “synaptic” package in Ubuntu:
Won't Fix
Bug description:
It should be possible to download while installing, or download 2
things at once.
Currently an apt-get command with '--download-only' will lock apt
(/var/lib/dpkg/lock). Synaptic even locks apt just by being open!
Examples:
* I might be updating my system. The update is still in the download stage, and I want to download and install a small package for something. Currently I would have to stop the download, install the package, and resume the download.
* I'm installing lots of application from the Software Centre. While 1 app is installing the next should be downloading.
* Run apt-get from command line while browsing software in Synaptic.
To avoid multiple instances of apt downloading the same file, each
partial file should have it's own lock (For example,
/var/cache/apt/archives/partial/inkscape_0.48.1-2ubuntu2_i386.deb
would have inkscape_0.48.1-2ubuntu2_i386.lock). It may also be
necessary to prevent updating package lists (sudo apt-get update) when
any download lock exists as well as apt's main lock.
To manage notifications about this bug go to:
https://bugs.launchpad.net/apt/+bug/830492/+subscriptions
More information about the foundations-bugs
mailing list