1 <?xml version=
"1.0" encoding=
"ISO-8859-1"?>
2 <rss version='
2.0' xmlns:lj='http://www.livejournal.org/rss/lj/
1.0/'
>
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>
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><p
>Five years ago,
15 <a href=
"http://people.skolelinux.org/pere/blog/What_is_the_most_supported_MIME_type_in_Debian_.html
">I
16 measured what the most supported MIME type in Debian was
</a
>, 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:
23 <p
><strong
>Debian Unstable:
</strong
></p
>
27 ----- -----------------------
40 29 image/x-portable-pixmap
42 27 image/x-portable-bitmap
50 <p
>The list was created like this using a sid chroot:
"cat
51 /var/lib/apt/lists/*sid*_dep11_Components-amd64.yml.gz| zcat | awk
'/^
52 - \S+\/\S+$/ {print $
2 }
' | sort | uniq -c | sort -nr | head -
20"</p
>
54 <p
>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
"file --mime
&lt;filename
&gt;
", and then
59 look up all packages announcing support for this format in their
60 AppStream metadata (XML or .desktop file) using
"appstreamcli
61 what-provides mimetype
&lt;mime-type
&gt;. For example if you, like
62 me, want to know which packages support inode/directory, you can get a
63 list like this:
</p
>
65 <p
><blockquote
><pre
>
66 % appstreamcli what-provides mimetype inode/directory | grep Package: | sort
73 Package: doublecmd-common
75 Package: enlightenment
95 </pre
></blockquote
></p
>
97 <p
>Using the same method, I can quickly discover that the Sketchup file
98 format is not yet supported by any package in Debian:
</p
>
100 <p
><blockquote
><pre
>
101 % appstreamcli what-provides mimetype application/vnd.sketchup.skp
102 Could not find component providing
'mimetype::application/vnd.sketchup.skp
'.
104 </pre
></blockquote
></p
>
106 <p
>Yesterday I used it to figure out which packages support the STL
3D
109 <p
><blockquote
><pre
>
110 % appstreamcli what-provides mimetype application/sla|grep Package
115 </pre
></blockquote
></p
>
117 <p
>PS: A new version of Cura was uploaded to Debian yesterday.
</p
>
119 <p
>As usual, if you use Bitcoin and want to show your support of my
120 activities, please send Bitcoin donations to my address
121 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>
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><p
>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
'apt upgrade
'. I normally
133 would resolve the issue by doing
'apt install
&lt;somepackages
&gt;
' 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
'apt-in-chunks
':
</p
>
142 <p
><blockquote
><pre
>
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.
153 if [
"$
1" ]; then
154 grep -v
"$
1"
160 for p in $(apt list --upgradable | ignore
"$@
" |cut -d/ -f1 | grep -v
'^Listing...
'); do
161 echo
"Upgrading $p
"
163 apt install --download-only -y $p
164 for f in /var/cache/apt/archives/*.deb; do
165 if [ -e
"$f
" ]; then
166 dpkg -i /var/cache/apt/archives/*.deb
171 </pre
></blockquote
></p
>
173 <p
>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 'apt install -f
' 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.
</p
>
183 <p
>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 'ghc
', but I have run into other large packages causing similar
187 problems earlier (like TeX).
</p
>
189 <p
>Update
2018-
07-
08: Thanks to Paul Wise, I am aware of two
190 alternative ways to handle this. The
"unattended-upgrades
191 --minimal-upgrade-steps
" 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,
"aptutude upgrade
" can upgrade single packages, thus avoiding
195 the need for using
"dpkg -i
" in the script above.
</p
>
197 <p
>As usual, if you use Bitcoin and want to show your support of my
198 activities, please send Bitcoin donations to my address
199 <b
><a href=
"bitcoin:
15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
">15oWEoG9dUPovwmUL9KWAnYRtNJEkP1u1b
</a
></b
>.
</p
>