[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Apt pinning breaks apt-get update when net is temporarily down



Hi,

yesterday I noticed something strange in the behavior of apt-get on my
debian Jessie system.
When I do
    apt-get update && apt-get dist-upgrade
the system is reported as up to date, no upgrades available - fine.
Now I tried and "simulated" a temporarily broken internet connection (just
to see what happens, because I worked on a script that is supposed to
update the package database as a cron job) with a simple ifdown eth0,
then ran apt-get update again, which of course threw a bunch of errors
and finally exited (as I found later to my surprise with return code 0,
but this is not the point). I was quite stunned then, when a subsequent 
apt-get dist-upgrade reported some 30 upgradable packages. After I
established the network connection again and repeated apt-get update the
system was up to date again. So far, so odd.

Investigating the upgrades apt-get suggested in "offline" mode, I found
that it were all packages from jessie-backports.

Next thing I tried was a quick test with an old Laptop I have with an
outdated LMDE install (which is basically Jessie as testing without
many upgrades for 1 1/2 years or so), just to make sure the problem is not
somewhere in the configuration of my desktop machine. So I added
jessie-backports to the laptop's sources.list and got more or less the
same result, up-to-date when online, a bunch of pending upgrades when
offline.

So finally I went back to my desktop machine and tried to add the debian
testing repo and use pinning for it as described at 
https://wiki.debian.org/AptPreferences .
Same result, only more dramatically looking; when online, apt-get update
&& apt-get dist-upgrade report some 20 pending upgrades, repeating the
procedure without network they suggest more than 1100 upgrades, which
looks a lot like a whole system upgrade to testing.

So this seems like pinning has no effect altogether when the network
connection is down, I can hardly believe that this is supposed to be
normal, is it? Or may there actually be such a bug in apt-get?

Certainly this is not much trouble when the updates are handled
manually, but looks it rather bad to me, when cron jobs are involved.

Any insights are much appreciated.

Thanks in advance, and best regards

Michael

.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Men will always be men -- no matter where they are.
		-- Harry Mudd, "Mudd's Women", stardate 1329.8


Reply to: