]> 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>What is the most supported MIME type in Debian in 2018?</title>
11 <link>http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_in_2018_.html</link>
12 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_in_2018_.html</guid>
13 <pubDate>Mon, 9 Jul 2018 08:05:00 +0200</pubDate>
14 <description>&lt;p&gt;Five years ago,
15 &lt;a href=&quot;http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_.html&quot;&gt;I
16 measured what the most supported MIME type in Debian was&lt;/a&gt;, by
17 analysing the desktop files in all packages in the archive. Since
18 then, the DEP-11 AppStream system has been put into production, making
19 the task a lot easier. This made me want to repeat the measurement,
20 to see how much things changed. Here are the new numbers, for
21 unstable only this time:
22
23 &lt;p&gt;&lt;strong&gt;Debian Unstable:&lt;/strong&gt;&lt;/p&gt;
24
25 &lt;pre&gt;
26 count MIME type
27 ----- -----------------------
28 56 image/jpeg
29 55 image/png
30 49 image/tiff
31 48 image/gif
32 39 image/bmp
33 38 text/plain
34 37 audio/mpeg
35 34 application/ogg
36 33 audio/x-flac
37 32 audio/x-mp3
38 30 audio/x-wav
39 30 audio/x-vorbis+ogg
40 29 image/x-portable-pixmap
41 27 inode/directory
42 27 image/x-portable-bitmap
43 27 audio/x-mpeg
44 26 application/x-ogg
45 25 audio/x-mpegurl
46 25 audio/ogg
47 24 text/html
48 &lt;/pre&gt;
49
50 &lt;p&gt;The list was created like this using a sid chroot: &quot;cat
51 /var/lib/apt/lists/*sid*_dep11_Components-amd64.yml.gz| zcat | awk &#39;/^
52 - \S+\/\S+$/ {print $2 }&#39; | sort | uniq -c | sort -nr | head -20&quot;&lt;/p&gt;
53
54 &lt;p&gt;It is interesting to see how image formats have passed text/plain
55 as the most announced supported MIME type. These days, thanks to the
56 AppStream system, if you run into a file format you do not know, and
57 want to figure out which packages support the format, you can find the
58 MIME type of the file using &quot;file --mime &amp;lt;filename&amp;gt;&quot;, and then
59 look up all packages announcing support for this format in their
60 AppStream metadata (XML or .desktop file) using &quot;appstreamcli
61 what-provides mimetype &amp;lt;mime-type&amp;gt;. For example if you, like
62 me, want to know which packages support inode/directory, you can get a
63 list like this:&lt;/p&gt;
64
65 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
66 % appstreamcli what-provides mimetype inode/directory | grep Package: | sort
67 Package: anjuta
68 Package: audacious
69 Package: baobab
70 Package: cervisia
71 Package: chirp
72 Package: dolphin
73 Package: doublecmd-common
74 Package: easytag
75 Package: enlightenment
76 Package: ephoto
77 Package: filelight
78 Package: gwenview
79 Package: k4dirstat
80 Package: kaffeine
81 Package: kdesvn
82 Package: kid3
83 Package: kid3-qt
84 Package: nautilus
85 Package: nemo
86 Package: pcmanfm
87 Package: pcmanfm-qt
88 Package: qweborf
89 Package: ranger
90 Package: sirikali
91 Package: spacefm
92 Package: spacefm
93 Package: vifm
94 %
95 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
96
97 &lt;p&gt;Using the same method, I can quickly discover that the Sketchup file
98 format is not yet supported by any package in Debian:&lt;/p&gt;
99
100 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
101 % appstreamcli what-provides mimetype application/vnd.sketchup.skp
102 Could not find component providing &#39;mimetype::application/vnd.sketchup.skp&#39;.
103 %
104 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
105
106 &lt;p&gt;Yesterday I used it to figure out which packages support the STL 3D
107 format:&lt;/p&gt;
108
109 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
110 % appstreamcli what-provides mimetype application/sla|grep Package
111 Package: cura
112 Package: meshlab
113 Package: printrun
114 %
115 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
116
117 &lt;p&gt;PS: A new version of Cura was uploaded to Debian yesterday.&lt;/p&gt;
118
119 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
120 activities, please send Bitcoin donations to my address
121 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
122 </description>
123 </item>
124
125 <item>
126 <title>Debian APT upgrade without enough free space on the disk...</title>
127 <link>http://people.skolelinux.org/pere/blog/Debian_APT_upgrade_without_enough_free_space_on_the_disk___.html</link>
128 <guid isPermaLink="true">http://people.skolelinux.org/pere/blog/Debian_APT_upgrade_without_enough_free_space_on_the_disk___.html</guid>
129 <pubDate>Sun, 8 Jul 2018 12:10:00 +0200</pubDate>
130 <description>&lt;p&gt;Quite regularly, I let my Debian Sid/Unstable chroot stay untouch
131 for a while, and when I need to update it there is not enough free
132 space on the disk for apt to do a normal &#39;apt upgrade&#39;. I normally
133 would resolve the issue by doing &#39;apt install &amp;lt;somepackages&amp;gt;&#39; to
134 upgrade only some of the packages in one batch, until the amount of
135 packages to download fall below the amount of free space available.
136 Today, I had about 500 packages to upgrade, and after a while I got
137 tired of trying to install chunks of packages manually. I concluded
138 that I did not have the spare hours required to complete the task, and
139 decided to see if I could automate it. I came up with this small
140 script which I call &#39;apt-in-chunks&#39;:&lt;/p&gt;
141
142 &lt;p&gt;&lt;blockquote&gt;&lt;pre&gt;
143 #!/bin/sh
144 #
145 # Upgrade packages when the disk is too full to upgrade every
146 # upgradable package in one lump. Fetching packages to upgrade using
147 # apt, and then installing using dpkg, to avoid changing the package
148 # flag for manual/automatic.
149
150 set -e
151
152 ignore() {
153 if [ &quot;$1&quot; ]; then
154 grep -v &quot;$1&quot;
155 else
156 cat
157 fi
158 }
159
160 for p in $(apt list --upgradable | ignore &quot;$@&quot; |cut -d/ -f1 | grep -v &#39;^Listing...&#39;); do
161 echo &quot;Upgrading $p&quot;
162 apt clean
163 apt install --download-only -y $p
164 for f in /var/cache/apt/archives/*.deb; do
165 if [ -e &quot;$f&quot; ]; then
166 dpkg -i /var/cache/apt/archives/*.deb
167 break
168 fi
169 done
170 done
171 &lt;/pre&gt;&lt;/blockquote&gt;&lt;/p&gt;
172
173 &lt;p&gt;The script will extract the list of packages to upgrade, try to
174 download the packages needed to upgrade one package, install the
175 downloaded packages using dpkg. The idea is to upgrade packages
176 without changing the APT mark for the package (ie the one recording of
177 the package was manually requested or pulled in as a dependency). To
178 use it, simply run it as root from the command line. If it fail, try
179 &#39;apt install -f&#39; to clean up the mess and run the script again. This
180 might happen if the new packages conflict with one of the old
181 packages. dpkg is unable to remove, while apt can do this.&lt;/p&gt;
182
183 &lt;p&gt;It take one option, a package to ignore in the list of packages to
184 upgrade. The option to ignore a package is there to be able to skip
185 the packages that are simply too large to unpack. Today this was
186 &#39;ghc&#39;, but I have run into other large packages causing similar
187 problems earlier (like TeX).&lt;/p&gt;
188
189 &lt;p&gt;Update 2018-07-08: Thanks to Paul Wise, I am aware of two
190 alternative ways to handle this. The &quot;unattended-upgrades
191 --minimal-upgrade-steps&quot; option will try to calculate upgrade sets for
192 each package to upgrade, and then upgrade them in order, smallest set
193 first. It might be a better option than my above mentioned script.
194 Also, &quot;aptutude upgrade&quot; can upgrade single packages, thus avoiding
195 the need for using &quot;dpkg -i&quot; in the script above.&lt;/p&gt;
196
197 &lt;p&gt;As usual, if you use Bitcoin and want to show your support of my
198 activities, please send Bitcoin donations to my address
199 &lt;b&gt;&lt;a href=&quot;bitcoin:15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&quot;&gt;15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b&lt;/a&gt;&lt;/b&gt;.&lt;/p&gt;
200 </description>
201 </item>
202
203 </channel>
204 </rss>