Laptop upgraded to Debian Stretch

I decided to take the plunge and update my laptop to the latest Debian release as I was still running Jessie.

My desktop PC has been running Stretch since it was released but it was a clean install on a new hard drive so didn’t have the possibility of a failed upgrade.

Full upgrade using the apt-get dist-upgrade option went relatively smoothly bar a couple of dependency issues which I resolved by removing the affending packages as they were not that important (just KDE libraries). All in it took about 2.5 hours to finish the upgrade, including reading/research and backing up important files. Backups are good!

I followed (or at least read) the instructions from Debian upgrade guide but the basics are:

Make sure your current system is up to date

apt-get update
apt-get upgrade

(if there are upgrades available)

apt-get clean

(optional, just clears out downloaded files used to install/upgrade)

Change your apt sources file (/etc/apt/sources.list) to point to new release. Change all instances of jessie in the sources.list file to stretch, save then rerun apt-get update to update the new release files.

Run apt-get upgrade  again to upgrade any installed packages (this may throw up list of files no longer needed as well). After these are upgraded you can run the dist-upgrade command to upgrade to the latest release.

apt-get dist-upgrade

Once this is finished you are now running the latest release which you can test by looking at the content of the file /etc/debian_version which in my case is now 9.2. you can check the kernel version as well by running uname -a from the terminal which gives me

Linux debian 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64 GNU/Linux

This is just a quick and dirty run through of the basic process i would suggest you read the full upgrade instructions from the Debian website guide to upgrading to fully understand the issues you may have (oh and make a backup if you have important data on the drive). Backups are good!

Reset root password linux

Originally posted on on 10/01/2012. Original Article

This will work for all users although if you know the root password you can reset the user password anyway.

So I was going to use my old PC as a client for my Windows Domain Admin class but first I needed to make sure that I didn’t have any files that were important, unlikely since I hadn’t used the computer in years, but still need to check.

So I booted up the old PC and realised I couldn’t remember the passwords, oops!! After googling for the answer I found this way to reset (really delete) the root password, well any user password since they are all in the same file. BTW this computer is running Slackware Linux 12.2 (probably my favourite Slackware release)

Get a bootable distro that you can copy to disk and boot into a live environment or use one of the many rescue disks out there, I used SystemRescueCD which is really nice and easy to use and is quite easy on resources, the PC only has 640Mb of memory, so the newer Ubuntu live CD doesn’t run very fast or smooth.

Boot up the CD select an option, there are quite a few, I had to try a couple before I got one that worked, seems that there was a problem booting into a graphical environment, something wrong with the monitor settings (out of sync or refresh error, I forget which) but that doesn’t matter since I am happy using the command line. So once booted and at the prompt you need to mount the physical hard disk (remember this is running off the disk/RAM);

mount -t auto /dev/sda1 /mnt

Then go to the /etc directory

cd /mnt/temp/etc/

Edit the shadow file that holds the password information using your favourite editor such as emacs, vi, pico etc, my editor of choice is emacs

emacs shadow

What you need to do is locate the line that starts with root, usually the first line, and remove the encrypted password. This is the random assortment of letters between the second and third colons (:), highlighted in red below and just delete it.


This leaves


Save the file and that’s it, just reboot, remembering to remove the CD and when you get to the login screen* just enter root as username and leave the password field empty and BOOM!! access is granted (see note below)

Last thing…remember to set a new root password.

* I couldn’t login through the GUI after I had done this I had to reboot using the liveCD and change the runlevel in the inittab file then reboot to the text login and all was well, gave myself a new password and changed the runlevel back to the GUI and rebooted and was able to login as needed.

Adding Serial Port support to Virtualbox

This post was originally posted on on 22/09/2011  link to original post

Having got hold of a Cisco router I had to try to connect to it via my Windows XP virtual machine installed in VirtualBox. The problem I had was the COM port was not recognised in the VirtualBox settings, every time I tried to start the Windows VM it failed with an error.  One of these errors suggested checking the permissions and user groups to make sure these were correct.
Turns out I needed to add my (host) user to the correct group.

Use the command

ls -l /dev/ttyS*

to list the current groups for tty’s.
Output of tty configuration

As can be seen here the serial ports are all in the dialout group so using the user manager I added myself to the dialout group. Once that was done ( remember to logout and back in once you change group associations!! ) I set up the serial port in the virtualbox settings COM1, choose the Host Device option and add /dev/ttyS0 as the path.

Serial port configuration VirtualBox

Once this was done I started the Windows XP virtual machine and it now booted fine and once logged in Windows detected the new hardware and installed it automatically.

Now I am able to console into the router and all is good.