Issuing “apt-get update” or “apt-get upgrade” commands resulted in the following error:

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

I couldn’t locate any running processes which would be locking these files so went ahead and removed the lock files via:

sudo rm /var/lib/apt/lists/lock
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock

And then repeated the commands successfully.



Microsoft WSUS Rebuild

To re-install WSUS with a clean database i.e. no previous configuration:

Run Windows Powershell as Administrator and use the following commands:

  • Uninstall-WindowsFeature -Name UpdateServices,Windows-Internal-Database -Restart


  • Post restart, delete EVERYTHING in the C:\Windows\WID\ (for Win 2012 r2) folder.


  • Then run the following command to re-install WSUS:
    Install-WindowsFeature UpdateServices -Restart


This only works on PowerShell 3 or higher.


I had to run the postinstallation tasks manually via Powershell using the WID db, if using SQL you need to add in sql_instance=

C:\Program Files\Update Services\Tools\WsusUtil.exe content_dir=”<<dir of update download location>>




Deploying iTunes to Windows with Parental Controls

The Scene

We use WPKG to deploy Windows software within our domain and had a package to deploy iTunes (built from references here but wanted to prevent users from being pestered with iTunes update alerts (which they couldn’t install as non-admins anyway) whilst allowing them to update the iOS installations on their iPads and iPhones.

The Hang ups

Reading the Apple guidance on parental controlsĀ was not terribly helpful, it was clear what flags were available and what values for those flags needed to be applied but the description of keys and DWORD values was not well defined.
I spent some time trawling discussion threads and through a number of references worked out the correct interpretation of the Apple article.

The Solution

In the “HKEY_LOCAL_MACHINE\SOFTWARE\Apple Computer, Inc.\iTunes\Parental Controls\Default” key we need a DWORD-32bit key with the name “kParentalFlags_Locked” and a hex value of “1” (to prevent users from changing parental controls).

Inside the same parent key we need another DWORD-32bit value named “kParentalFlags_DisableCheckForAppUpdates” with a hex-value of “200000” (to prevent iTunes from updating).

Finally we need another DWORD-32bit value in the same registry key namedĀ “AdminFlags” and it’s hex-value needs to be a SUM of all key values so far defined, in our case this is “200001”.

Including these keys in our deployment script means that the “check for updates” menu item in the “Help” menu is not present and iTunes does not check for updates for itself. It does leave the ability for users to check for updates for their iOS devices though.


HP Printer Firmware Update : Windows Print Server

I was needing to update the firmware on an HP P3015 Laserjet printer and the “Firmware Update” utility on the web interface was failing.


The solution that I found was to simply copy the firmware update binary file to the printer via it’s UNC share name from the print server!

copy /b <firmware file> \\SERVER\PrinterShareName


This did the job perfectly!