+ <div class="entry">
+ <div class="title"><a href="http://people.skolelinux.org/pere/blog/Debian_APT_upgrade_without_enough_free_space_on_the_disk___.html">Debian APT upgrade without enough free space on the disk...</a></div>
+ <div class="date"> 8th July 2018</div>
+ <div class="body"><p>Quite regularly, I let my Debian Sid/Unstable chroot stay untouch
+for a while, and when I need to update it there is not enough free
+space on the disk for apt to do a normal 'apt upgrade'. I normally
+would resolve the issue by doing 'apt install <somepackages>' to
+upgrade only some of the packages in one batch, until the amount of
+packages to download fall below the amount of free space available.
+Today, I had about 500 packages to upgrade, and after a while I got
+tired of trying to install chunks of packages manually. I concluded
+that I did not have the spare hours required to complete the task, and
+decided to see if I could automate it. I came up with this small
+script which I call 'apt-in-chunks':</p>
+
+<p><blockquote><pre>
+#!/bin/sh
+#
+# Upgrade packages when the disk is too full to upgrade every
+# upgradable package in one lump. Fetching packages to upgrade using
+# apt, and then installing using dpkg, to avoid changing the package
+# flag for manual/automatic.
+
+set -e
+
+ignore() {
+ if [ "$1" ]; then
+ grep -v "$1"
+ else
+ cat
+ fi
+}
+
+for p in $(apt list --upgradable | ignore "$@" |cut -d/ -f1 | grep -v '^Listing...'); do
+ echo "Upgrading $p"
+ apt clean
+ apt install --download-only -y $p
+ for f in /var/cache/apt/archives/*.deb; do
+ if [ -e "$f" ]; then
+ dpkg -i /var/cache/apt/archives/*.deb
+ break
+ fi
+ done
+done
+</pre></blockquote></p>
+
+<p>The script will extract the list of packages to upgrade, try to
+download the packages needed to upgrade one package, install the
+downloaded packages using dpkg. The idea is to upgrade packages
+without changing the APT mark for the package (ie the one recording of
+the package was manually requested or pulled in as a dependency). To
+use it, simply run it as root from the command line. If it fail, try
+'apt install -f' to clean up the mess and run the script again. This
+might happen if the new packages conflict with one of the old
+packages. dpkg is unable to remove, while apt can do this.</p>
+
+<p>It take one option, a package to ignore in the list of packages to
+upgrade. The option to ignore a package is there to be able to skip
+the packages that are simply too large to unpack. Today this was
+'ghc', but I have run into other large packages causing similar
+problems earlier (like TeX).</p>
+
+<p>As usual, if you use Bitcoin and want to show your support of my
+activities, please send Bitcoin donations to my address
+<b><a href="bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b</a></b>.</p>
+</div>
+ <div class="tags">
+
+
+ Tags: <a href="http://people.skolelinux.org/pere/blog/tags/debian">debian</a>, <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>.
+
+
+ </div>
+ </div>
+ <div class="padding"></div>
+
<div class="entry">
<div class="title"><a href="http://people.skolelinux.org/pere/blog/The_worlds_only_stone_power_plant_.html">The worlds only stone power plant?</a></div>
<div class="date">30th June 2018</div>
</div>
<div class="padding"></div>
- <div class="entry">
- <div class="title"><a href="http://people.skolelinux.org/pere/blog/Debian_used_in_the_subway_info_screens_in_Oslo__Norway.html">Debian used in the subway info screens in Oslo, Norway</a></div>
- <div class="date"> 2nd March 2018</div>
- <div class="body"><p>Today I was pleasantly surprised to discover my operating system of
-choice, Debian, was used in the info screens on the subway stations.
-While passing Nydalen subway station in Oslo, Norway, I discovered the
-info screen booting with some text scrolling. I was not quick enough
-with my camera to be able to record a video of the scrolling boot
-screen, but I did get a photo from when the boot got stuck with a
-corrupt file system:
-
-<p align="center"><a href="http://people.skolelinux.org/pere/blog/images/2018-03-02-ruter-debian-lenny.jpeg"><img align="center" width="40%" src="http://people.skolelinux.org/pere/blog/images/2018-03-02-ruter-debian-lenny.jpeg" alt="[photo of subway info screen]"></a></p>
-
-<p>While I am happy to see Debian used more places, some details of the
-content on the screen worries me.</p>
-
-<p>The image show the version booting is 'Debian GNU/Linux lenny/sid',
-indicating that this is based on code taken from Debian Unstable/Sid
-after Debian Etch (version 4) was released 2007-04-08 and before
-Debian Lenny (version 5) was released 2009-02-14. Since Lenny Debian
-has released version 6 (Squeeze) 2011-02-06, 7 (Wheezy) 2013-05-04, 8
-(Jessie) 2015-04-25 and 9 (Stretch) 2017-06-15, according to
-<a href="https://en.wikipedia.org/wiki/Debian_version_history">a Debian
-version history on Wikpedia</a>. This mean the system is running
-around 10 year old code, with no security fixes from the vendor for
-many years.</p>
-
-<p>This is not the first time I discover the Oslo subway company,
-Ruter, running outdated software. In 2012,
-<a href="http://people.skolelinux.org/pere/blog/Er_billettautomatene_til_kollektivtrafikken_i_Oslo_uten_sikkerhetsoppdateringer_.html">I
-discovered the ticket vending machines were running Windows 2000</a>,
-and this was
-<a href="http://people.skolelinux.org/pere/blog/Fortsatt_ingen_sikkerhetsoppdateringer_for_billettautomatene_til_kollektivtrafikken_i_Oslo_.html">still
-the case in 2016</a>. Given the response from the responsible people
-in 2016, I would assume the machines are still running unpatched
-Windows 2000. Thus, an unpatched Debian setup come as no surprise.</p>
-
-<p>The photo is made available under the license terms
-<a href="http://creativecommons.org/licenses/by/4.0/">Creative Commons
-4.0 Attribution International (CC BY 4.0)</a>.</p>
-
-<p>As usual, if you use Bitcoin and want to show your support of my
-activities, please send Bitcoin donations to my address
-<b><a href="bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b</a></b>.</p>
-</div>
- <div class="tags">
-
-
- Tags: <a href="http://people.skolelinux.org/pere/blog/tags/english">english</a>, <a href="http://people.skolelinux.org/pere/blog/tags/ruter">ruter</a>.
-
-
- </div>
- </div>
- <div class="padding"></div>
-
<p style="text-align: right;"><a href="index.rss"><img src="http://people.skolelinux.org/pere/blog/xml.gif" alt="RSS feed" width="36" height="14" /></a></p>
<div id="sidebar">
<li><a href="http://people.skolelinux.org/pere/blog/archive/2018/06/">June (2)</a></li>
+<li><a href="http://people.skolelinux.org/pere/blog/archive/2018/07/">July (1)</a></li>
+
</ul></li>
<li>2017
<li><a href="http://people.skolelinux.org/pere/blog/tags/chrpath">chrpath (2)</a></li>
- <li><a href="http://people.skolelinux.org/pere/blog/tags/debian">debian (156)</a></li>
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/debian">debian (157)</a></li>
<li><a href="http://people.skolelinux.org/pere/blog/tags/debian edu">debian edu (158)</a></li>
<li><a href="http://people.skolelinux.org/pere/blog/tags/drivstoffpriser">drivstoffpriser (4)</a></li>
- <li><a href="http://people.skolelinux.org/pere/blog/tags/english">english (374)</a></li>
+ <li><a href="http://people.skolelinux.org/pere/blog/tags/english">english (375)</a></li>
<li><a href="http://people.skolelinux.org/pere/blog/tags/fiksgatami">fiksgatami (23)</a></li>