[Bug 964930] Re: apt-setup generator 50mirror.ubuntu writes to wrong file, fails to update
Launchpad Bug Tracker
964930 at bugs.launchpad.net
Thu Mar 29 15:45:04 UTC 2012
This bug was fixed in the package apt-setup - 1:0.55ubuntu2
---------------
apt-setup (1:0.55ubuntu2) precise; urgency=low
* generators/50mirrors.ubuntu: do not reuse the file variable (LP: #964930)
-- Brian Murray <brian at ubuntu.com> Wed, 28 Mar 2012 17:04:23 +0100
** Changed in: apt-setup (Ubuntu)
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apt-setup in Ubuntu.
https://bugs.launchpad.net/bugs/964930
Title:
apt-setup generator 50mirror.ubuntu writes to wrong file, fails to
update
Status in “apt-setup” package in Ubuntu:
Fix Released
Bug description:
In the process of setting up a preseed file to load Ubuntu Precise
Pangolin from a local mirror, I ran into a problem where the
installation would fail. The logs reported it could not find most of
the packages on my mirror to install, but if I ran "in-target apt-get
update" everything worked fine. Looking through the log files, it was
clear that "apt-get update" was not being run for most of my mirrors.
After some troubleshooting, I believe I have found a bug in the
installer file "/usr/lib/apt-setup/generators/50mirror.ubuntu".
That file seems to take a command-line parameter telling it where to
write the generated configuration. "apt-setup" runs the generator and
tells it what filename to write into, then "apt-setup-verify" checks
the file, and updates the mirror information with "in-target apt-get
... update".
Towards the beginning, 50mirror.ubuntu sets $file to $1, and later it writes its configuration to $file. In between, however, it uses "file" as a temporary loop variable, like this:
for file in $ROOT/etc/apt/sources.list.base \
$ROOT/etc/apt/sources.list.new; do
...
done
After that loop completes, $file is set to the last of those files,
instead of the original file that was passed in. That makes the
script write its configuration to the wrong place, so apt-setup-verify
doesn't verify the file, and doesn't run "in-target apt-get ...
update". As a result, the index files for my mirrors aren't loaded,
and no packages can be found there.
After changing "for file" to "for file2", the installation completed
successfully.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt-setup/+bug/964930/+subscriptions
More information about the foundations-bugs
mailing list