Category Archives: Linux

woman draw a light bulb in white board

Finally Solved – Nextcloud SMB Not Working on Ubuntu 20.04

After banging my head against this problem from a different server, as WSL is not there yet for running as personal production services, I finally managed to hit the right keywords to google fu the answer. php-smbclient has been dropped from the officially repositories and so can only be installed via a PPA.

Installing using the following commands finally sorted it for me, credit to Markus (linked below for this solution)

echo "deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/php.list
apt-key adv --recv-keys --keyserver hkps:// 4F4EA0AAE5267A6C        
apt-get update && apt-get install php-smbclient
phpenmod smbclient
service apache2 restart

FIXED: Varnish Caching Proxy Expected an action, ‘if’, ‘{‘ or ‘}’

So it seems Varnish 4.0 and 4.1 (more may be affected this is the limit of my testing presently) has a bug where some whitespace can through it from recognising valid configuration such as below
# ACLs to control who can access this caching proxy server
acl local {
""/8; /* loopback range */
""/29; /* local network range */
""/8; /* For testing on own hown network - REMOVE FOR PRODUCTION */

# Urls to cache
# /api/3.0/artists/
# /api/3.0/venues/

sub vcl_recv {
# Happens before we check if we have this in cache already.
# Typically you clean up the request here, removing cookies you don’t need,
# rewriting the request, etc.

if (client.ip !~ local ) {
{error 403 “Access denied”;}
return (lookup);

# We only want to cache GET request
if (req.request == “GET”) {


This was due to a bad code merge cited here

You can resolve this by manually removing the whitespace by using the command below

cat default-withWhiteSpace.vcl | tr -d " \t\n\r" > default.vcl

Solution: libpam-radius-auth: Sends out as NAS-IP-Address


When authentication linux to radius using libpam-radius-auth: Sends out as NAS-IP-Address


/etc/hosts file contains the local machine’s hostname with


Either remove the offending line, or before this line place the correct ip address with the hostname (note that order is important). computerName computerName

[FIXED] Errors were encountered while processing: /var/cache/apt/archives/vim-runtime_2%3a7.4.052-1ubuntu3_all.deb

Problem: vim install fails during dist-upgrade and running sudo apt-get -f install gives the error below
syslog:/var/syslog-ng/wcs$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
The following packages will be upgraded:
1 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
44 not fully installed or removed.
Need to get 0 B/4,888 kB of archives.
After this operation, 412 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 64153 files and directories currently installed.)
Preparing to unpack .../vim-runtime_2%3a7.4.052-1ubuntu3_all.deb ...
Leaving 'diversion of /usr/share/vim/vim74/doc/help.txt to /usr/share/vim/vim74/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim74/doc/tags to /usr/share/vim/vim74/doc/tags.vim-tiny by vim-runtime'
dpkg-divert: error: rename involves overwriting `/usr/share/vim/vim74/doc/tags.vim-tiny' with
different file `/usr/share/vim/vim74/doc/tags', not allowed
dpkg: error processing archive /var/cache/apt/archives/vim-runtime_2%3a7.4.052-1ubuntu3_all.deb (--unpack):
subprocess new pre-installation script returned error exit status 2
Processing /usr/share/vim/addons/doc
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)


All of the issues seemed to be down to the doc folder, nuking it meant that the install completed successfully
sudo rm -fR /usr/share/vim/vim74/doc/

Cleaning Up Linux Headers

Make sure you’ve rebooted BEFORE running any of these commands so that you are actively using the latest kernel.

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge

If you’ve had a previous apt-get install fail due to disk space issues and you’re trying to clean up the linux headers to free disk space run the below command which will force the purge
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y -f purge