<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Uncategorized &#8211; Sandy Scott&#039;s Web Spot</title>
	<atom:link href="https://www.sandyscott.net/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sandyscott.net</link>
	<description>My little corner of the web</description>
	<lastBuildDate>Sat, 11 Oct 2025 18:03:07 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.5</generator>
	<item>
		<title>Neovim from scratch</title>
		<link>https://www.sandyscott.net/2025/06/neovim-from-scratch/</link>
					<comments>https://www.sandyscott.net/2025/06/neovim-from-scratch/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Tue, 24 Jun 2025 21:29:56 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=927</guid>

					<description><![CDATA[So, after playing around with lazyvim and getting quite frustrated with all sorts of weirdness due to mismatched versions and suchlike, I thought I&#8217;d dig into the fundamentals and build my own setup, install various plugins manually, maybe setup an LSP from scratch. This is not a beginner tutorial &#8211;...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2025/06/neovim-from-scratch/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">So, after playing around with lazyvim and getting quite frustrated with all sorts of weirdness due to mismatched versions and suchlike, I thought I&#8217;d dig into the fundamentals and build my own setup, install various plugins manually, maybe setup an LSP from scratch.</p>



<p class="wp-block-paragraph">This is not a beginner tutorial &#8211; if you&#8217;ve never used vim or neovim before then there plenty of videos, blogs and even books to help you get started. Also, if you have a working installation of [neo]vim, then you can also start it and type: <code>:Tutor</code> (including the colon) and press enter and follow the instructions.</p>



<p class="wp-block-paragraph">Anyway, lets dig in. First port of call, as always, is the manual.</p>



<pre class="wp-block-code"><code>:help</code></pre>



<p class="wp-block-paragraph">I wont&#8217; reproduce the whole help file here, but this first page is super useful, as it tells you how to find specific information, like on a specific command or option:</p>



<pre class="wp-block-code"><code>help.txt        Nvim

                        VIM - main help file
                                                                         k  
      Move around:  Use the cursor keys, or "h" to go left,            h   l
                    "j" to go down, "k" to go up, "l" to go right.       j
Close this window:  Use ":q&lt;Enter&gt;".                                        
   Get out of Vim:  Use ":qa!&lt;Enter&gt;" (careful, all changes are lost!).
        
Jump to a subject:  Position the cursor on a tag (e.g. bars) and hit CTRL-].
   With the mouse:  Double-click the left mouse button on a tag, e.g. bars.
        Jump back:  Type CTRL-O.  Repeat to go further back.
                                                
Get specific help:  It is possible to go directly to whatever you want help
                    on, by giving an argument to the :help command. 
                    Prepend something to specify the context:  help-context   
        
                          WHAT                  PREPEND    EXAMPLE
                      Normal mode command                  :help x
                      Visual mode command         v_       :help v_u
                      Insert mode command         i_       :help i_&lt;Esc&gt;
                      Command-line command        :        :help :quit
                      Command-line editing        c_       :help c_&lt;Del&gt;
                      Vim command argument        -        :help -r
                      Option                      '        :help 'textwidth'
                      Regular expression          /        :help /&#91;
                    See help-summary for more contexts and an explanation.
</code></pre>



<p class="wp-block-paragraph">We can make the help full screen with <code>:only</code>.</p>



<p class="wp-block-paragraph">Before we start adding our own stuff, lets have a quick look at what gets included by default. <code>:help initialization</code> shows a serious list of stuff that goes on under the hood when Neovim is started.</p>



<p class="wp-block-paragraph">Item 4. mentions <code>default-mappings </code>and <code>default-autocmds</code>, take a quick look at those to see what&#8217;s going on.</p>



<p class="wp-block-paragraph">One little note, if you&#8217;re going to get deep into Neovim, I recommend you get used to Lua. This means that the mapping functions end up looking different. Instead of adding <code>:noremap F3</code> i to your <code>init.vim</code>, you put <code>vim.keymap.set('F3','i')</code> in your <code>init.lua</code>.</p>



<p class="wp-block-paragraph">On the subject of key mappings, there are a few useful tools to keep in mind:</p>



<figure class="wp-block-table"><table><tbody><tr><td><strong>:help index</strong></td><td>Shows the default key list</td></tr><tr><td><strong>:map</strong></td><td>Shows a list of all the mappings currently in effect</td></tr><tr><td><strong>:help map-which-keys</strong></td><td>Some advice from the manual about which keys to use for mappings</td></tr></tbody></table></figure>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2025/06/neovim-from-scratch/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Advanced Apt &#8211; 1. What is a Repository?</title>
		<link>https://www.sandyscott.net/2025/06/advanced-apt-1-what-is-a-repository/</link>
					<comments>https://www.sandyscott.net/2025/06/advanced-apt-1-what-is-a-repository/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Sun, 01 Jun 2025 17:52:30 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=917</guid>

					<description><![CDATA[This post series is to clarify some of the more advanced stuff about how apt works, specifically when dealing with multiple repositories and versions, that you might want to use apt-pinning to sort out. What is a repository? This is an important question, because answering it explains where a lot...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2025/06/advanced-apt-1-what-is-a-repository/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">This post series is to clarify some of the more advanced stuff about how apt works, specifically when dealing with multiple repositories and versions, that you might want to use apt-pinning to sort out.</p>



<h1 class="wp-block-heading">What is a repository?</h1>



<p class="wp-block-paragraph">This is an important question, because answering it explains where a lot of the different fields or tags come from when you&#8217;re describing how to select packages.</p>



<p class="wp-block-paragraph">A repository is just a web server, with files arranged in a specific way that allows <code>apt</code> to collect all the metadata about all the hosted packages and then download the one you want.</p>



<p class="wp-block-paragraph">Lets take a look at sources.list to find one, the default for Debian 12 (Bookworm) is:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Shell&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">deb http://deb.debian.org/debian bookworm main contrib non-free-firmware non-free
deb http://deb.debian.org/debian bookworm-updates main contrib non-free-firmware non-free
deb http://security.debian.org/debian-security bookworm-security main contrib non-free-firmware non-free</pre></div>



<p class="wp-block-paragraph">so the first <code>deb</code> just tells us this repository contains the binary files, the only other option is <code>deb-src</code>, which means instead it contains the source code. The next bit <a href="http://deb.debian.org/debian">http://deb.debian.org/debian</a> is the url for the repository, so before we look the rest of the line, lets look there:</p>



<figure class="wp-block-image size-full"><a href="https://www.sandyscott.net/wp-content/uploads/2025/06/image.png"><img fetchpriority="high" decoding="async" width="492" height="567" src="https://www.sandyscott.net/wp-content/uploads/2025/06/image.png" alt="" class="wp-image-919" srcset="https://www.sandyscott.net/wp-content/uploads/2025/06/image.png 492w, https://www.sandyscott.net/wp-content/uploads/2025/06/image-260x300.png 260w, https://www.sandyscott.net/wp-content/uploads/2025/06/image-130x150.png 130w" sizes="(max-width: 492px) 100vw, 492px" /></a></figure>



<p class="wp-block-paragraph">As you can see it&#8217;s just a list of files and folder, and conveniently the owner of the repo has implemented a nice web interface so we can see that. The critical info is in the <code>dists/</code> folder:</p>



<figure class="wp-block-image size-full"><a href="https://www.sandyscott.net/wp-content/uploads/2025/06/image-1.png"><img decoding="async" width="524" height="810" src="https://www.sandyscott.net/wp-content/uploads/2025/06/image-1.png" alt="" class="wp-image-921" srcset="https://www.sandyscott.net/wp-content/uploads/2025/06/image-1.png 524w, https://www.sandyscott.net/wp-content/uploads/2025/06/image-1-194x300.png 194w, https://www.sandyscott.net/wp-content/uploads/2025/06/image-1-97x150.png 97w" sizes="(max-width: 524px) 100vw, 524px" /></a></figure>



<p class="wp-block-paragraph">There&#8217;s quite a few things in here, but actually less than it first appears. So there are versions of debian referred to in 3 different ways:</p>



<ul class="wp-block-list">
<li>Version &#8211; the 3 Debian XX.YY folders at the top</li>



<li>Release Codename &#8211; bookworm, trixie etc.</li>



<li>Suite names or release aliases &#8211; stable, testing etc.</li>



<li></li>
</ul>



<p class="wp-block-paragraph">You also have a sub suite or sub release for some combination of</p>



<ul class="wp-block-list">
<li>backports</li>



<li>backports-sloppy</li>



<li>updates</li>



<li>proposed-updates</li>
</ul>



<p class="wp-block-paragraph">Lets open up <a href="https://deb.debian.org/debian/dists/bookworm/">bookworm</a></p>



<figure class="wp-block-image size-full"><a href="https://www.sandyscott.net/wp-content/uploads/2025/06/image-2.png"><img decoding="async" width="595" height="424" src="https://www.sandyscott.net/wp-content/uploads/2025/06/image-2.png" alt="" class="wp-image-923" srcset="https://www.sandyscott.net/wp-content/uploads/2025/06/image-2.png 595w, https://www.sandyscott.net/wp-content/uploads/2025/06/image-2-300x214.png 300w, https://www.sandyscott.net/wp-content/uploads/2025/06/image-2-150x107.png 150w" sizes="(max-width: 595px) 100vw, 595px" /></a></figure>



<p class="wp-block-paragraph">Notice that the 4 names of the folders at the bottom match the last 4 values on the deb line, but for now well have a look at <a href="https://deb.debian.org/debian/dists/bookworm/Release">Release</a> (it&#8217;s a plain text file)</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Shell&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">Origin: Debian
Label: Debian
Suite: stable
Version: 12.11
Codename: bookworm
Changelogs: https://metadata.ftp-master.debian.org/changelogs/@CHANGEPATH@_changelog
Date: Sat, 17 May 2025 09:13:04 UTC
Acquire-By-Hash: yes
No-Support-for-Architecture-all: Packages
Architectures: all amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x
Components: main contrib non-free-firmware non-free
Description: Debian 12.11 Released 17 May 2025
MD5Sum:
 0ed6d4c8891eb86358b94bb35d9e4da4  1484322 contrib/Contents-all
 d0a0325a97c42fd5f66a8c3e29bcea64    98581 contrib/Contents-all.gz
 f49a4e0893e46866e12d086ec218fd81   840868 contrib/Contents-amd64
 06c8860da678334327980e51b5c1780b    60955 contrib/Contents-amd64.gz
 ...</pre></div>



<p class="wp-block-paragraph">Now we&#8217;re getting somewhere. This has a lot of useful data laid out in black and white</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><tbody><tr><td><strong>Field</strong></td><td><strong>Data</strong></td><td><strong>Description</strong></td></tr><tr><td>Origin</td><td>Debian</td><td>Who made the package</td></tr><tr><td>Label</td><td>Debian</td><td>? (appears to always be &#8220;Debian&#8221; in here)</td></tr><tr><td>Suite</td><td>stable</td><td></td></tr><tr><td>Version</td><td>12.11</td><td></td></tr><tr><td>Codename</td><td>bookworm</td><td></td></tr><tr><td>Architectures</td><td>all amd64 arm64 armel armhf i386 mips64el mipsel ppc64el s390x</td><td>List of processor architectures for which this repository contains compiled software</td></tr><tr><td>Components</td><td>main contrib non-free-firmware non-free</td><td>Subdivisions within the repository &#8211; for the main Debian repositories the distinction is about how free the software is.</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">Lets drill a bit deeper. If you do into <a href="https://deb.debian.org/debian/dists/bookworm/main/binary-amd64/">main/binary-amd64/</a> the, download and extract <a href="https://deb.debian.org/debian/dists/bookworm/main/binary-amd64/Packages.gz">Packages.gz</a> you&#8217;ll get another plain text file with a massive list of data about the packages you can install, here&#8217;s an excerpt:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;Shell&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">...
Package: apt
Version: 2.6.1
Installed-Size: 4232
Maintainer: APT Development Team &lt;deity@lists.debian.org&gt;
Architecture: amd64
Replaces: apt-transport-https (&lt;&lt; 1.5~alpha4~), apt-utils (&lt;&lt; 1.3~exp2~)
Provides: apt-transport-https (= 2.6.1)
Depends: adduser, gpgv | gpgv2 | gpgv1, libapt-pkg6.0 (&gt;= 2.6.1), debian-archive-keyring, libc6 (&gt;= 2.34), libgcc-s1 (&gt;= 3.0), libgnutls30 (&gt;= 3.7.5), libseccomp2 (&gt;= 2.4.2), libstdc++6 (&gt;= 11), libsystemd0
Recommends: ca-certificates
Suggests: apt-doc, aptitude | synaptic | wajig, dpkg-dev (&gt;= 1.17.2), gnupg | gnupg2 | gnupg1, powermgmt-base
Breaks: apt-transport-https (&lt;&lt; 1.5~alpha4~), apt-utils (&lt;&lt; 1.3~exp2~), aptitude (&lt;&lt; 0.8.10)
Description: commandline package manager
Description-md5: 9fb97a88cb7383934ef963352b53b4a7
Tag: admin::package-management, devel::lang:ruby, hardware::storage,
 hardware::storage:cd, implemented-in::c++, implemented-in::perl,
 implemented-in::ruby, interface::commandline, network::client,
 protocol::ftp, protocol::http, protocol::ipv6, role::program,
 scope::application, scope::utility, suite::debian, use::downloading,
 use::organizing, use::playing, use::searching, works-with-format::html,
 works-with::audio, works-with::software:package, works-with::text
Section: admin
Priority: required
Filename: pool/main/a/apt/apt_2.6.1_amd64.deb
Size: 1372852
MD5sum: 2a077296b9b9f4f8b027f86d9500192b
SHA256: 6ea03cbbc7a7bfcee601c9fb08d4e026fd522ede5350561f06867ad9c0a0fa6b                                                                                                                 

Package: apt-doc
Source: apt
...</pre></div>



<p class="wp-block-paragraph">Here you&#8217;ve got the name of the package, it&#8217;s version, processor architecture and dependencies and some metadata like the Description, Tags, Section (for a categorised list). The file hashes at the end are used by apt to download the file.</p>



<h3 class="wp-block-heading">More reading:</h3>



<ul class="wp-block-list">
<li>Apt Configuration: <a href="https://wiki.debian.org/AptConfiguration#apt_preferences_.28APT_pinning.29">https://wiki.debian.org/AptConfiguration#apt_preferences_.28APT_pinning.29</a></li>



<li>Apt preferences (ie. apt pinning) <a href="https://manpages.debian.org/buster/apt/apt_preferences.5.en.html">https://manpages.debian.org/buster/apt/apt_preferences.5.en.html</a></li>



<li>APT Repositories Explained <a href="https://gist.github.com/CodingKoopa/3b30afe8c91e3950f6b124cd2abe3b6b">https://gist.github.com/CodingKoopa/3b30afe8c91e3950f6b124cd2abe3b6b</a></li>



<li><code>apt-cache policy</code></li>



<li><code>apt-cache policy [packagename]</code></li>
</ul>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2025/06/advanced-apt-1-what-is-a-repository/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Update Nextcloud</title>
		<link>https://www.sandyscott.net/2024/08/update-nextcloud/</link>
					<comments>https://www.sandyscott.net/2024/08/update-nextcloud/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Fri, 16 Aug 2024 20:36:39 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=877</guid>

					<description><![CDATA[If you&#8217;re updating Nextcloud, it offers the alternative to run the upgrade via the command line: However, on most systems you&#8217;ll have to work a little harder than just On my system there are 2 main problems: This is the command I use: And a few of the other commonly-used...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2024/08/update-nextcloud/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">If you&#8217;re updating Nextcloud, it offers the alternative to run the upgrade via the command line:</p>



<figure class="wp-block-image size-full"><a href="https://www.sandyscott.net/wp-content/uploads/2024/08/image.png"><img loading="lazy" decoding="async" width="749" height="602" src="https://www.sandyscott.net/wp-content/uploads/2024/08/image.png" alt="" class="wp-image-878" srcset="https://www.sandyscott.net/wp-content/uploads/2024/08/image.png 749w, https://www.sandyscott.net/wp-content/uploads/2024/08/image-300x241.png 300w, https://www.sandyscott.net/wp-content/uploads/2024/08/image-150x121.png 150w, https://www.sandyscott.net/wp-content/uploads/2024/08/image-350x280.png 350w" sizes="auto, (max-width: 749px) 100vw, 749px" /></a></figure>



<p class="wp-block-paragraph">However, on most systems you&#8217;ll have to work a little harder than just</p>



<pre class="wp-block-code"><code>./occ upgrade</code></pre>



<p class="wp-block-paragraph">On my system there are 2 main problems:</p>



<ul class="wp-block-list">
<li>You don&#8217;t generally login as the same user as the Nextcloud web service &#8211; as I&#8217;m using a Debian system the correct user is <code>www-data</code>. </li>



<li>It needs to start PHP to run the command, which by default doesn&#8217;t include the APCu module when you start it from the command line, so we need to fix that.</li>
</ul>



<p class="wp-block-paragraph">This is the command I use:</p>



<pre class="wp-block-code"><code>sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ upgrade</code></pre>



<p class="wp-block-paragraph">And a few of the other commonly-used commands after updating (the Administration Overview screen will tell you which of these you need to run:</p>



<pre class="wp-block-code"><code>sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ maintenance:mode --on

sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ maintenance:mode --off

sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ maintenance:repair --include-expensive

sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ db:add-missing-indices
</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2024/08/update-nextcloud/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Linux software updates &#8211; How to resolve changed configuration files.</title>
		<link>https://www.sandyscott.net/2021/04/linux-software-updates-how-to-resolve-changed-configuration-files/</link>
					<comments>https://www.sandyscott.net/2021/04/linux-software-updates-how-to-resolve-changed-configuration-files/#respond</comments>
		
		<dc:creator><![CDATA[Sandy]]></dc:creator>
		<pubDate>Fri, 02 Apr 2021 15:46:00 +0000</pubDate>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apt]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[dpkg]]></category>
		<guid isPermaLink="false">https://www.sandyscott.net/?p=821</guid>

					<description><![CDATA[Sometimes, when you&#8217;re updating software on your Linux machine, the person maintaining the package will have also updated the default configuration file that ships with the software. This is an issue if you have customised that configuration file on your system &#8211; the system doesn&#8217;t know whether it should keep...<p> <a class="continue-reading-link" href="https://www.sandyscott.net/2021/04/linux-software-updates-how-to-resolve-changed-configuration-files/"><span>Continue reading</span><i class="crycon-right-dir"></i></a> </p>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Sometimes, when you&#8217;re updating software on your Linux machine, the person maintaining the package will have also updated the default configuration file that ships with the software.</p>



<p class="wp-block-paragraph">This is an issue if you have customised that configuration file on your system &#8211; the system doesn&#8217;t know whether it should keep your version, use the new one, or something else. So it asks you to decide what to do about it.</p>



<p class="wp-block-paragraph">I&#8217;m using Debian, which uses the <code>dpkg </code>package management system &#8211; that name may be unfamiliar, but if you&#8217;ve used any of the Debain family (Ubuntu, Mint, MX, elementary etc.) you will have used one of the friendlier wrappers around it: <code>apt </code>or <code>apt-get</code>.</p>



<p class="wp-block-paragraph">Today, it&#8217;s the Collabora Office configuration file that has been updated:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}">Configuration file '/etc/loolwsd/loolwsd.xml'
 ==&gt; Modified (by you or by a script) since installation.
 ==&gt; Package distributor has shipped an updated version.
   What would you like to do about it ? Your options are:
    Y or I : install the package maintainer's version
    N or O : keep your currently-installed version
      D    : show the differences between the versions
      Z    : start a shell to examine the situation
 The default action is to keep your current version.
*** loolwsd.xml (Y/I/N/O/D/Z) [default=N] ?</pre></div>



<ul class="wp-block-list"><li>The first option is self-explanatory &#8211; you&#8217;ll lose any customizations you&#8217;ve made, but that might be OK for you.</li><li>Keeping your currently-installed version is usually OK &#8211; well designed software shouldn&#8217;t break because it&#8217;s missing a line in an old configuration file.</li></ul>



<p class="wp-block-paragraph">In either case the system will keep a copy of the one you don&#8217;t pick, so you can change your mind later. If you choose to use the package mantainer&#8217;s version, there will be a copy of your old one with <code>.dpkg-old</code> added to the filename. If you keep you own config file, the package maintainer&#8217;s version will be saved alongside it, with <code>.dpkg-dist</code> added to the filename.</p>



<ul class="wp-block-list"><li>Choosing option D can help you decide &#8211; but ultimately doesn&#8217;t resolve the situation.</li><li>Option Z is the point of today&#8217;s post &#8211; this is how you can fix the situation.</li></ul>



<p class="wp-block-paragraph">Lets hit Z, and this is what I get:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}"> The default action is to keep your current version.
*** loolwsd.xml (Y/I/N/O/D/Z) [default=N] ? Z
Useful environment variables:
 - DPKG_SHELL_REASON
 - DPKG_CONFFILE_OLD
 - DPKG_CONFFILE_NEW
Type 'exit' when you're done.
root@waldorf:/# </pre></div>



<p class="wp-block-paragraph">The system tells you about 3 environment variables that might be useful to help fix the situation. here I&#8217;ve use the echo command (with a $ before the environment variable name) to see what&#8217;s in them:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}">root@waldorf:/# echo $DPKG_SHELL_REASON
conffile-prompt
root@waldorf:/# echo $DPKG_CONFFILE_OLD
/etc/loolwsd/loolwsd.xml
root@waldorf:/# echo $DPKG_CONFFILE_NEW
/etc/loolwsd/loolwsd.xml.dpkg-new</pre></div>



<p class="wp-block-paragraph">DPKG_CONFFILE_PROMPT isn&#8217;t much use to us, but the other two are. We can start a program to compare and merge the differences between the two. I&#8217;m using Neovim in diff mode &#8211; there are lots of otherways of doing this &#8211; I&#8217;d suggest you do your research and find your preferred merge tool or text editor.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}">root@waldorf:/# nvim -d $DPKG_CONFFILE_OLD $DPKG_CONFFILE_NEW</pre></div>



<p class="wp-block-paragraph">I wont to get into the details of how to use [Neo]vim, but if you&#8217;re already a vim user and haven&#8217;t used diff mode before, these commands will get you started. <a href="https://neovim.io/doc/user/diff.html">You can find more info in the documentation.</a></p>



<figure class="wp-block-table"><table><tbody><tr><td><strong>Keystrokes</strong></td><td><strong>Command</strong></td></tr><tr><td>&lt;Ctrl-w&gt; l</td><td>Move to the right window</td></tr><tr><td>&lt;Ctrl-w&gt; h</td><td>Move to the left window</td></tr><tr><td>]c</td><td>Move to the next change</td></tr><tr><td>[c</td><td>Move to the previous change</td></tr><tr><td>:diffget</td><td>Copy the change you&#8217;re on from the other window</td></tr><tr><td>:diffput</td><td>Push the change from your current window into the other one.</td></tr></tbody></table></figure>



<dl class="wp-block-simple-definition-list-blocks-list"></dl>



<p class="wp-block-paragraph">Note that the last two commands will make the files the same at that point</p>



<p class="wp-block-paragraph">Modifiy one of the files (I typically modify my old file &#8211; pulling the changes from the new one that I want, and leaving the ones that I don&#8217;t), then save and exit your text editor or mergetool</p>



<p class="wp-block-paragraph">Type exit at the prompt, then the system will ask you again what you want to do:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">*** loolwsd.xml (Y/I/N/O/D/Z) [default=N] ?</pre></div>



<p class="wp-block-paragraph">In this case I&#8217;ll choose N or O because I&#8217;ve made the changes I want to the original config file.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sandyscott.net/2021/04/linux-software-updates-how-to-resolve-changed-configuration-files/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
