]> pere.pagekite.me Git - homepage.git/blob - blog/archive/2018/07/07.rss
Generated.
[homepage.git] / blog / archive / 2018 / 07 / 07.rss
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/'>
3 <channel>
4 <title>Petter Reinholdtsen - Entries from July 2018</title>
5 <description>Entries from July 2018</description>
6 <link>http://people.skolelinux.org/pere/blog/</link>
7
8
9 <item>
10 <title>Sharing images with friends and family using RSS and EXIF/XMP metadata</title>
11 <link>http://people.skolelinux.org/pere/blog/Sharing_images_with_friends_and_family_using_RSS_and_EXIF_XMP_metadata.html</link>
12 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Sharing_images_with_friends_and_family_using_RSS_and_EXIF_XMP_metadata.html</guid>
13 <pubDate>Tue, 31 Jul 2018 23:30:00 +0200</pubDate>
14 <description>&lt;p&gt;For a while now, I have looked for a sensible way to share images
15 with my family using a self hosted solution, as it is unacceptable to
16 place images from my personal life under the control of strangers
17 working for data hoarders like Google or Dropbox. The last few days I
18 have drafted an approach that might work out, and I would like to
19 share it with you. I would like to publish images on a server under
20 my control, and point some Internet connected display units using some
21 free and open standard to the images I published. As my primary
22 language is not limited to ASCII, I need to store metadata using
23 UTF-8. Many years ago, I hoped to find a digital photo frame capable
24 of reading a RSS feed with image references (aka using the
25 &amp;lt;enclosure&amp;gt; RSS tag), but was unable to find a current supplier
26 of such frames. In the end I gave up that approach.&lt;/p&gt;
27
28 &lt;p&gt;Some months ago, I discovered that
29 &lt;a href=&quot;https://www.jwz.org/xscreensaver/&quot;&gt;XScreensaver&lt;/a&gt; is able to
30 read images from a RSS feed, and used it to set up a screen saver on
31 my home info screen, showing images from the Daily images feed from
32 NASA. This proved to work well. More recently I discovered that
33 &lt;a href=&quot;https://kodi.tv&quot;&gt;Kodi&lt;/a&gt; (both using
34 &lt;a href=&quot;https://www.openelec.tv/&quot;&gt;OpenELEC&lt;/a&gt; and
35 &lt;a href=&quot;https://libreelec.tv&quot;&gt;LibreELEC&lt;/a&gt;) provide the
36 &lt;a href=&quot;https://github.com/grinsted/script.screensaver.feedreader&quot;&gt;Feedreader&lt;/a&gt;
37 screen saver capable of reading a RSS feed with images and news. For
38 fun, I used it this summer to test Kodi on my parents TV by hooking up
39 a Raspberry PI unit with LibreELEC, and wanted to provide them with a
40 screen saver showing selected pictures from my selection.&lt;/p&gt;
41
42 &lt;p&gt;Armed with motivation and a test photo frame, I set out to generate
43 a RSS feed for the Kodi instance. I adjusted my &lt;a
44 href=&quot;https://freedombox.org/&quot;&gt;Freedombox&lt;/a&gt; instance, created
45 /var/www/html/privatepictures/, wrote a small Perl script to extract
46 title and description metadata from the photo files and generate the
47 RSS file. I ended up using Perl instead of python, as the
48 libimage-exiftool-perl Debian package seemed to handle the EXIF/XMP
49 tags I ended up using, while python3-exif did not. The relevant EXIF
50 tags only support ASCII, so I had to find better alternatives. XMP
51 seem to have the support I need.&lt;/p&gt;
52
53 &lt;p&gt;I am a bit unsure which EXIF/XMP tags to use, as I would like to
54 use tags that can be easily added/updated using normal free software
55 photo managing software. I ended up using the tags set using this
56 exiftool command, as these tags can also be set using digiKam:&lt;/p&gt;
57
58 &lt;blockquote&gt;&lt;pre&gt;
59 exiftool -headline=&#39;The RSS image title&#39; \
60 -description=&#39;The RSS image description.&#39; \
61 -subject+=for-family photo.jpeg
62 &lt;/pre&gt;&lt;/blockquote&gt;
63
64 &lt;p&gt;I initially tried the &quot;-title&quot; and &quot;keyword&quot; tags, but they were
65 invisible in digiKam, so I changed to &quot;-headline&quot; and &quot;-subject&quot;. I
66 use the keyword/subject &#39;for-family&#39; to flag that the photo should be
67 shared with my family. Images with this keyword set are located and
68 copied into my Freedombox for the RSS generating script to find.&lt;/p&gt;
69
70 &lt;p&gt;Are there better ways to do this? Get in touch if you have better
71 suggestions.&lt;/p&gt;
72
73 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
74 activities, please send Bitcoin donations to my address
75 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
76 </description>
77 </item>
78
79 <item>
80 <title>Simple streaming the Linux desktop to Kodi using GStreamer and RTP</title>
81 <link>http://people.skolelinux.org/pere/blog/Simple_streaming_the_Linux_desktop_to_Kodi_using_GStreamer_and_RTP.html</link>
82 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Simple_streaming_the_Linux_desktop_to_Kodi_using_GStreamer_and_RTP.html</guid>
83 <pubDate>Thu, 12 Jul 2018 17:55:00 +0200</pubDate>
84 <description>&lt;p&gt;Last night, I wrote
85 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html&quot;&gt;a
86 recipe to stream a Linux desktop using VLC to a instance of Kodi&lt;/a&gt;.
87 During the day I received valuable feedback, and thanks to the
88 suggestions I have been able to rewrite the recipe into a much simpler
89 approach requiring no setup at all. It is a single script that take
90 care of it all.&lt;/p&gt;
91
92 &lt;p&gt;This new script uses GStreamer instead of VLC to capture the
93 desktop and stream it to Kodi. This fixed the video quality issue I
94 saw initially. It further removes the need to add a m3u file on the
95 Kodi machine, as it instead connects to
96 &lt;a href=&quot;https://kodi.wiki/view/JSON-RPC_API/v8&quot;&gt;the JSON-RPC API in
97 Kodi&lt;/a&gt; and simply ask Kodi to play from the stream created using
98 GStreamer. Streaming the desktop to Kodi now become trivial. Copy
99 the script below, run it with the DNS name or IP address of the kodi
100 server to stream to as the only argument, and watch your screen show
101 up on the Kodi screen. Note, it depend on multicast on the local
102 network, so if you need to stream outside the local network, the
103 script must be modified. Also note, I have no idea if audio work, as
104 I only care about the picture part.&lt;/p&gt;
105
106 &lt;blockquote&gt;&lt;pre&gt;
107 #!/bin/sh
108 #
109 # Stream the Linux desktop view to Kodi. See
110 # http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html
111 # for backgorund information.
112
113 # Make sure the stream is stopped in Kodi and the gstreamer process is
114 # killed if something go wrong (for example if curl is unable to find the
115 # kodi server). Do the same when interrupting this script.
116 kodicmd() {
117 host=&quot;$1&quot;
118 cmd=&quot;$2&quot;
119 params=&quot;$3&quot;
120 curl --silent --header &#39;Content-Type: application/json&#39; \
121 --data-binary &quot;{ \&quot;id\&quot;: 1, \&quot;jsonrpc\&quot;: \&quot;2.0\&quot;, \&quot;method\&quot;: \&quot;$cmd\&quot;, \&quot;params\&quot;: $params }&quot; \
122 &quot;http://$host/jsonrpc&quot;
123 }
124 cleanup() {
125 if [ -n &quot;$kodihost&quot; ] ; then
126 # Stop the playing when we end
127 playerid=$(kodicmd &quot;$kodihost&quot; Player.GetActivePlayers &quot;{}&quot; |
128 jq .result[].playerid)
129 kodicmd &quot;$kodihost&quot; Player.Stop &quot;{ \&quot;playerid\&quot; : $playerid }&quot; &gt; /dev/null
130 fi
131 if [ &quot;$gstpid&quot; ] &amp;&amp; kill -0 &quot;$gstpid&quot; &gt;/dev/null 2&gt;&amp;1; then
132 kill &quot;$gstpid&quot;
133 fi
134 }
135 trap cleanup EXIT INT
136
137 if [ -n &quot;$1&quot; ]; then
138 kodihost=$1
139 shift
140 else
141 kodihost=kodi.local
142 fi
143
144 mcast=239.255.0.1
145 mcastport=1234
146 mcastttl=1
147
148 pasrc=$(pactl list | grep -A2 &#39;Source #&#39; | grep &#39;Name: .*\.monitor$&#39; | \
149 cut -d&quot; &quot; -f2|head -1)
150 gst-launch-1.0 ximagesrc use-damage=0 ! video/x-raw,framerate=30/1 ! \
151 videoconvert ! queue2 ! \
152 x264enc bitrate=8000 speed-preset=superfast tune=zerolatency qp-min=30 \
153 key-int-max=15 bframes=2 ! video/x-h264,profile=high ! queue2 ! \
154 mpegtsmux alignment=7 name=mux ! rndbuffersize max=1316 min=1316 ! \
155 udpsink host=$mcast port=$mcastport ttl-mc=$mcastttl auto-multicast=1 sync=0 \
156 pulsesrc device=$pasrc ! audioconvert ! queue2 ! avenc_aac ! queue2 ! mux. \
157 &gt; /dev/null 2&gt;&amp;1 &amp;
158 gstpid=$!
159
160 # Give stream a second to get going
161 sleep 1
162
163 # Ask kodi to start streaming using its JSON-RPC API
164 kodicmd &quot;$kodihost&quot; Player.Open \
165 &quot;{\&quot;item\&quot;: { \&quot;file\&quot;: \&quot;udp://@$mcast:$mcastport\&quot; } }&quot; &gt; /dev/null
166
167 # wait for gst to end
168 wait &quot;$gstpid&quot;
169 &lt;/pre&gt;&lt;/blockquote&gt;
170
171 &lt;p&gt;I hope you find the approach useful. I know I do.&lt;/p&gt;
172
173 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
174 activities, please send Bitcoin donations to my address
175 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
176 </description>
177 </item>
178
179 <item>
180 <title>Streaming the Linux desktop to Kodi using VLC and RTSP</title>
181 <link>http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html</link>
182 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Streaming_the_Linux_desktop_to_Kodi_using_VLC_and_RTSP.html</guid>
183 <pubDate>Thu, 12 Jul 2018 02:00:00 +0200</pubDate>
184 <description>&lt;p&gt;PS: See
185 &lt;ahref=&quot;http://people.skolelinux.org/pere/blog/Simple_streaming_the_Linux_desktop_to_Kodi_using_GStreamer_and_RTP.html&quot;&gt;the
186 followup post&lt;/a&gt; for a even better approach.&lt;/p&gt;
187
188 &lt;p&gt;A while back, I was asked by a friend how to stream the desktop to
189 my projector connected to Kodi. I sadly had to admit that I had no
190 idea, as it was a task I never had tried. Since then, I have been
191 looking for a way to do so, preferable without much extra software to
192 install on either side. Today I found a way that seem to kind of
193 work. Not great, but it is a start.&lt;/p&gt;
194
195 &lt;p&gt;I had a look at several approaches, for example
196 &lt;a href=&quot;https://github.com/mfoetsch/dlna_live_streaming&quot;&gt;using uPnP
197 DLNA as described in 2011&lt;/a&gt;, but it required a uPnP server, fuse and
198 local storage enough to store the stream locally. This is not going
199 to work well for me, lacking enough free space, and it would
200 impossible for my friend to get working.&lt;/p&gt;
201
202 &lt;p&gt;Next, it occurred to me that perhaps I could use VLC to create a
203 video stream that Kodi could play. Preferably using
204 broadcast/multicast, to avoid having to change any setup on the Kodi
205 side when starting such stream. Unfortunately, the only recipe I
206 could find using multicast used the rtp protocol, and this protocol
207 seem to not be supported by Kodi.&lt;/p&gt;
208
209 &lt;p&gt;On the other hand, the rtsp protocol is working! Unfortunately I
210 have to specify the IP address of the streaming machine in both the
211 sending command and the file on the Kodi server. But it is showing my
212 desktop, and thus allow us to have a shared look on the big screen at
213 the programs I work on.&lt;/p&gt;
214
215 &lt;p&gt;I did not spend much time investigating codeces. I combined the
216 rtp and rtsp recipes from
217 &lt;a href=&quot;https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/&quot;&gt;the
218 VLC Streaming HowTo/Command Line Examples&lt;/a&gt;, and was able to get
219 this working on the desktop/streaming end.&lt;/p&gt;
220
221 &lt;blockquote&gt;&lt;pre&gt;
222 vlc screen:// --sout \
223 &#39;#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:rtp{dst=projector.local,port=1234,sdp=rtsp://192.168.11.4:8080/test.sdp}&#39;
224 &lt;/pre&gt;&lt;/blockquote&gt;
225
226 &lt;p&gt;I ssh-ed into my Kodi box and created a file like this with the
227 same IP address:&lt;/p&gt;
228
229 &lt;blockquote&gt;&lt;pre&gt;
230 echo rtsp://192.168.11.4:8080/test.sdp \
231 &gt; /storage/videos/screenstream.m3u
232 &lt;/pre&gt;&lt;/blockquote&gt;
233
234 &lt;p&gt;Note the 192.168.11.4 IP address is my desktops IP address. As far
235 as I can tell the IP must be hardcoded for this to work. In other
236 words, if someone elses machine is going to do the steaming, you have
237 to update screenstream.m3u on the Kodi machine and adjust the vlc
238 recipe. To get started, locate the file in Kodi and select the m3u
239 file while the VLC stream is running. The desktop then show up in my
240 big screen. :)&lt;/p&gt;
241
242 &lt;p&gt;When using the same technique to stream a video file with audio,
243 the audio quality is really bad. No idea if the problem is package
244 loss or bad parameters for the transcode. I do not know VLC nor Kodi
245 enough to tell.&lt;/p&gt;
246
247 &lt;p&gt;&lt;strong&gt;Update 2018-07-12&lt;/strong&gt;: Johannes Schauer send me a few
248 succestions and reminded me about an important step. The &quot;screen:&quot;
249 input source is only available once the vlc-plugin-access-extra
250 package is installed on Debian. Without it, you will see this error
251 message: &quot;VLC is unable to open the MRL &#39;screen://&#39;. Check the log
252 for details.&quot; He further found that it is possible to drop some parts
253 of the VLC command line to reduce the amount of hardcoded information.
254 It is also useful to consider using cvlc to avoid having the VLC
255 window in the desktop view. In sum, this give us this command line on
256 the source end
257
258 &lt;blockquote&gt;&lt;pre&gt;
259 cvlc screen:// --sout \
260 &#39;#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:rtp{sdp=rtsp://:8080/}&#39;
261 &lt;/pre&gt;&lt;/blockquote&gt;
262
263 &lt;p&gt;and this on the Kodi end&lt;p&gt;
264
265 &lt;blockquote&gt;&lt;pre&gt;
266 echo rtsp://192.168.11.4:8080/ \
267 &gt; /storage/videos/screenstream.m3u
268 &lt;/pre&gt;&lt;/blockquote&gt;
269
270 &lt;p&gt;Still bad image quality, though. But I did discover that streaming
271 a DVD using dvdsimple:///dev/dvd as the source had excellent video and
272 audio quality, so I guess the issue is in the input or transcoding
273 parts, not the rtsp part. I&#39;ve tried to change the vb and ab
274 parameters to use more bandwidth, but it did not make a
275 difference.&lt;/p&gt;
276
277 &lt;p&gt;I further received a suggestion from Einar Haraldseid to try using
278 gstreamer instead of VLC, and this proved to work great! He also
279 provided me with the trick to get Kodi to use a multicast stream as
280 its source. By using this monstrous oneliner, I can stream my desktop
281 with good video quality in reasonable framerate to the 239.255.0.1
282 multicast address on port 1234:
283
284 &lt;blockquote&gt;&lt;pre&gt;
285 gst-launch-1.0 ximagesrc use-damage=0 ! video/x-raw,framerate=30/1 ! \
286 videoconvert ! queue2 ! \
287 x264enc bitrate=8000 speed-preset=superfast tune=zerolatency qp-min=30 \
288 key-int-max=15 bframes=2 ! video/x-h264,profile=high ! queue2 ! \
289 mpegtsmux alignment=7 name=mux ! rndbuffersize max=1316 min=1316 ! \
290 udpsink host=239.255.0.1 port=1234 ttl-mc=1 auto-multicast=1 sync=0 \
291 pulsesrc device=$(pactl list | grep -A2 &#39;Source #&#39; | \
292 grep &#39;Name: .*\.monitor$&#39; | cut -d&quot; &quot; -f2|head -1) ! \
293 audioconvert ! queue2 ! avenc_aac ! queue2 ! mux.
294 &lt;/pre&gt;&lt;/blockquote&gt;
295
296 &lt;p&gt;and this on the Kodi end&lt;p&gt;
297
298 &lt;blockquote&gt;&lt;pre&gt;
299 echo udp://@239.255.0.1:1234 \
300 &gt; /storage/videos/screenstream.m3u
301 &lt;/pre&gt;&lt;/blockquote&gt;
302
303 &lt;p&gt;Note the trick to pick a valid pulseaudio source. It might not
304 pick the one you need. This approach will of course lead to trouble
305 if more than one source uses the same multicast port and address.
306 Note the ttl-mc=1 setting, which limit the multicast packages to the
307 local network. If the value is increased, your screen will be
308 broadcasted further, one network &quot;hop&quot; for each increase (read up on
309 multicast to learn more. :)!&lt;/p&gt;
310
311 &lt;p&gt;Having cracked how to get Kodi to receive multicast streams, I
312 could use this VLC command to stream to the same multicast address.
313 The image quality is way better than the rtsp approach, but gstreamer
314 seem to be doing a better job.&lt;/p&gt;
315
316 &lt;blockquote&gt;&lt;pre&gt;
317 cvlc screen:// --sout &#39;#transcode{vcodec=mp4v,acodec=mpga,vb=800,ab=128}:rtp{mux=ts,dst=239.255.0.1,port=1234,sdp=sap}&#39;
318 &lt;/pre&gt;&lt;/blockquote&gt;
319
320 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
321 activities, please send Bitcoin donations to my address
322 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
323 </description>
324 </item>
325
326 <item>
327 <title>What is the most supported MIME type in Debian in 2018?</title>
328 <link>http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_in_2018_.html</link>
329 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_in_2018_.html</guid>
330 <pubDate>Mon, 9 Jul 2018 08:05:00 +0200</pubDate>
331 <description>&lt;p&gt;Five years ago,
332 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_.html&quot;&gt;I
333 measured what the most supported MIME type in Debian was&lt;/a&gt;, by
334 analysing the desktop files in all packages in the archive. Since
335 then, the DEP-11 AppStream system has been put into production, making
336 the task a lot easier. This made me want to repeat the measurement,
337 to see how much things changed. Here are the new numbers, for
338 unstable only this time:
339
340 &lt;p&gt;&lt;strong&gt;Debian Unstable:&lt;/strong&gt;&lt;/p&gt;
341
342 &lt;pre&gt;
343 count MIME type
344 ----- -----------------------
345 56 image/jpeg
346 55 image/png
347 49 image/tiff
348 48 image/gif
349 39 image/bmp
350 38 text/plain
351 37 audio/mpeg
352 34 application/ogg
353 33 audio/x-flac
354 32 audio/x-mp3
355 30 audio/x-wav
356 30 audio/x-vorbis+ogg
357 29 image/x-portable-pixmap
358 27 inode/directory
359 27 image/x-portable-bitmap
360 27 audio/x-mpeg
361 26 application/x-ogg
362 25 audio/x-mpegurl
363 25 audio/ogg
364 24 text/html
365 &lt;/pre&gt;
366
367 &lt;p&gt;The list was created like this using a sid chroot: &quot;cat
368 /var/lib/apt/lists/*sid*_dep11_Components-amd64.yml.gz| zcat | awk &#39;/^
369 - \S+\/\S+$/ {print $2 }&#39; | sort | uniq -c | sort -nr | head -20&quot;&lt;/p&gt;
370
371 &lt;p&gt;It is interesting to see how image formats have passed text/plain
372 as the most announced supported MIME type. These days, thanks to the
373 AppStream system, if you run into a file format you do not know, and
374 want to figure out which packages support the format, you can find the
375 MIME type of the file using &quot;file --mime &amp;lt;filename&amp;gt;&quot;, and then
376 look up all packages announcing support for this format in their
377 AppStream metadata (XML or .desktop file) using &quot;appstreamcli
378 what-provides mimetype &amp;lt;mime-type&amp;gt;. For example if you, like
379 me, want to know which packages support inode/directory, you can get a
380 list like this:&lt;/p&gt;
381
382 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
383 % appstreamcli what-provides mimetype inode/directory | grep Package: | sort
384 Package: anjuta
385 Package: audacious
386 Package: baobab
387 Package: cervisia
388 Package: chirp
389 Package: dolphin
390 Package: doublecmd-common
391 Package: easytag
392 Package: enlightenment
393 Package: ephoto
394 Package: filelight
395 Package: gwenview
396 Package: k4dirstat
397 Package: kaffeine
398 Package: kdesvn
399 Package: kid3
400 Package: kid3-qt
401 Package: nautilus
402 Package: nemo
403 Package: pcmanfm
404 Package: pcmanfm-qt
405 Package: qweborf
406 Package: ranger
407 Package: sirikali
408 Package: spacefm
409 Package: spacefm
410 Package: vifm
411 %
412 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
413
414 &lt;p&gt;Using the same method, I can quickly discover that the Sketchup file
415 format is not yet supported by any package in Debian:&lt;/p&gt;
416
417 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
418 % appstreamcli what-provides mimetype application/vnd.sketchup.skp
419 Could not find component providing &#39;mimetype::application/vnd.sketchup.skp&#39;.
420 %
421 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
422
423 &lt;p&gt;Yesterday I used it to figure out which packages support the STL 3D
424 format:&lt;/p&gt;
425
426 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
427 % appstreamcli what-provides mimetype application/sla|grep Package
428 Package: cura
429 Package: meshlab
430 Package: printrun
431 %
432 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
433
434 &lt;p&gt;PS: A new version of Cura was uploaded to Debian yesterday.&lt;/p&gt;
435
436 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
437 activities, please send Bitcoin donations to my address
438 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
439 </description>
440 </item>
441
442 <item>
443 <title>Debian APT upgrade without enough free space on the disk...</title>
444 <link>http://people.skolelinux.org/pere/blog/Debian_APT_upgrade_without_enough_free_space_on_the_disk___.html</link>
445 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Debian_APT_upgrade_without_enough_free_space_on_the_disk___.html</guid>
446 <pubDate>Sun, 8 Jul 2018 12:10:00 +0200</pubDate>
447 <description>&lt;p&gt;Quite regularly, I let my Debian Sid/Unstable chroot stay untouch
448 for a while, and when I need to update it there is not enough free
449 space on the disk for apt to do a normal &#39;apt upgrade&#39;. I normally
450 would resolve the issue by doing &#39;apt install &amp;lt;somepackages&amp;gt;&#39; to
451 upgrade only some of the packages in one batch, until the amount of
452 packages to download fall below the amount of free space available.
453 Today, I had about 500 packages to upgrade, and after a while I got
454 tired of trying to install chunks of packages manually. I concluded
455 that I did not have the spare hours required to complete the task, and
456 decided to see if I could automate it. I came up with this small
457 script which I call &#39;apt-in-chunks&#39;:&lt;/p&gt;
458
459 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
460 #!/bin/sh
461 #
462 # Upgrade packages when the disk is too full to upgrade every
463 # upgradable package in one lump. Fetching packages to upgrade using
464 # apt, and then installing using dpkg, to avoid changing the package
465 # flag for manual/automatic.
466
467 set -e
468
469 ignore() {
470 if [ &quot;$1&quot; ]; then
471 grep -v &quot;$1&quot;
472 else
473 cat
474 fi
475 }
476
477 for p in $(apt list --upgradable | ignore &quot;$@&quot; |cut -d/ -f1 | grep -v &#39;^Listing...&#39;); do
478 echo &quot;Upgrading $p&quot;
479 apt clean
480 apt install --download-only -y $p
481 for f in /var/cache/apt/archives/*.deb; do
482 if [ -e &quot;$f&quot; ]; then
483 dpkg -i /var/cache/apt/archives/*.deb
484 break
485 fi
486 done
487 done
488 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
489
490 &lt;p&gt;The script will extract the list of packages to upgrade, try to
491 download the packages needed to upgrade one package, install the
492 downloaded packages using dpkg. The idea is to upgrade packages
493 without changing the APT mark for the package (ie the one recording of
494 the package was manually requested or pulled in as a dependency). To
495 use it, simply run it as root from the command line. If it fail, try
496 &#39;apt install -f&#39; to clean up the mess and run the script again. This
497 might happen if the new packages conflict with one of the old
498 packages. dpkg is unable to remove, while apt can do this.&lt;/p&gt;
499
500 &lt;p&gt;It take one option, a package to ignore in the list of packages to
501 upgrade. The option to ignore a package is there to be able to skip
502 the packages that are simply too large to unpack. Today this was
503 &#39;ghc&#39;, but I have run into other large packages causing similar
504 problems earlier (like TeX).&lt;/p&gt;
505
506 &lt;p&gt;Update 2018-07-08: Thanks to Paul Wise, I am aware of two
507 alternative ways to handle this. The &quot;unattended-upgrades
508 --minimal-upgrade-steps&quot; option will try to calculate upgrade sets for
509 each package to upgrade, and then upgrade them in order, smallest set
510 first. It might be a better option than my above mentioned script.
511 Also, &quot;aptutude upgrade&quot; can upgrade single packages, thus avoiding
512 the need for using &quot;dpkg -i&quot; in the script above.&lt;/p&gt;
513
514 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
515 activities, please send Bitcoin donations to my address
516 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
517 </description>
518 </item>
519
520 </channel>
521 </rss>