Removed DHCP Daemons in Raspbian

Raspberry Pi 4

I got one of my Raspberry Pi servers attempting to obtain DHCP IP address, a behavior that ignored my static IP address configuration.

Not sure why, but it appeared I’d be getting an extra DHCP address, from the same network segment, in addition to the static IP the Raspberry Pi already had.

Normally I’d just disable the service, but since my home office network is fairly static, I figured I would just remove the DHCP package.

WARNING: do not follow my steps unless you’re in the same situation and pretty sure you’re using static IP addressing.

Double Check that You’re Using Static IP

Check your /etc/network/interfaces file, it should have something similar for your primary interface – in wired network cable case it’s eth0:

auto eth0
iface eth0 inet static
    address 192.168.1.99
    netmask 255.255.255.0
    gateway 192.168.1.1

Also, run ip a and make sure you’re seeing this same IP among the active interfaces:

greys@s7:~ $ ip a
1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0:  mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether b8:27:ee:66:88:ff brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.99/24 brd 192.168.1.255 scope global eth0
       valid_lft forever preferred_lft forever

Remove ISC DHCP Client

So I did this:

root@srv:~# apt-get remove isc-dhcp-client
 Reading package lists… Done
 Building dependency tree
 Reading state information… Done
 The following packages were automatically installed and are no longer required:
   libdns-export1104 libisc-export1100
 Use 'apt autoremove' to remove them.
 The following additional packages will be installed:
   dhcpcd5
 Suggested packages:
   dhcpcd-gtk
 The following packages will be REMOVED:
   isc-dhcp-client
 The following NEW packages will be installed:
   dhcpcd5
 0 upgraded, 1 newly installed, 1 to remove and 207 not upgraded.

All cool? Not really. If you read carefully, you’ll notice that I removed isc-dhcp-client, but automatically installed dhcpcd5 – which started making DHCP requests again.

Remove DHCPcD5

Next step then! Let’s remove DHCPcD5:

root@srv:~# apt-get remove dhcpcd5
 Reading package lists… Done
 Building dependency tree
 Reading state information… Done
 The following additional packages will be installed:
   isc-dhcp-client
 Suggested packages:
   avahi-autoipd isc-dhcp-client-ddns
 The following packages will be REMOVED:
   dhcpcd5
 The following NEW packages will be installed:
   isc-dhcp-client
 0 upgraded, 1 newly installed, 1 to remove and 207 not upgraded.

Much better!

Or is it? If you look closer, you’ll see that this command installed isc-dhcp-client back.

Delete both DHCP Client Packages

This time I specified both packages to be removed. I even used apt-get purge instead of apt-get remove – to definitely destroy any configs:

root@srv:~# apt-get purge dhcpcd5 isc-dhcp-client
 Reading package lists… Done
 Building dependency tree
 Reading state information… Done
 The following packages were automatically installed and are no longer required:
   libdns-export1104 libisc-export1100
 Use 'apt autoremove' to remove them.
 The following additional packages will be installed:
   pump
 The following packages will be REMOVED:
   dhcpcd5* isc-dhcp-client*
 The following NEW packages will be installed:
   pump
 0 upgraded, 1 newly installed, 2 to remove and 207 not upgraded.

When this installed pump (that’s apparently another BOOTP/DHCP client – I never even heard about it before), I got curious.

Having researched online, it appears one can configure static IP in Raspberry Pi using DHCP client configs. Doesn’t sound right to me! There’s also the systemd way to disable dhcpd.service, but at this stage I was not looking for half measures.

Having carefully considered this, I decided to unstall the whole lot. It also removed wicd* (Wired and Wireless Network Connection Manager) bunch which is another set of packages for managing network interfaces and connections.

I’m honestly suprised and seriously suprised how involved a network interface and IP address configuration is! Since I’m not using any of these niceties and because this is a static server-like environment where I’m not switching Wi-Fi networks or changing connection profiles all the time, I’m comfortable letting it all go.

Uninstalling DHPCP clients, pump and Wicd

WARNING: be super sure you’re using static IP addressing on your Raspberry Pi system before running the next command.

Here’s the final uninstall command:

root@s7:~# apt-get remove dhcpcd5 isc-dhcp-client pump
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package 'isc-dhcp-client' is not installed, so not removed
Package 'pump' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  libdns-export1104 libisc-export1100 openresolv python-wicd
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  dhcpcd5 wicd wicd-daemon wicd-gtk
0 upgraded, 0 newly installed, 4 to remove and 207 not upgraded.

FINALLY! No more DHCP requests from this server 🙂

pS: on a somewhat relevant note, think I’ll upgrade all them 207 packages – but first will complete a reboot to check network configuration still works for the static IP.

See Also




Ubuntu 19.10

Ubuntu 19.10
Ubuntu 19.10 Desktop Wallpaper

Ubuntu 19.10 was released on October 17th, which means it’s time to upgrade Ubuntu on my Dell XPS laptop. Please note this is NOT a long-term support (LTS) release, so 19.10 will only be supported until July 2020.



Ubuntu 19.10 – Eoan Ermine

Seems like a pretty solid upgrade:

  • WPA3 support for improved wireless security – need to check if I can upgrade my Ubiquiti equipment to support it
  • Linux Kernel upgraded to 5.3 – this is where I expect majority of improvements for my laptop
  • Dark Theme – in a very short space of just a few months I’m now using dark themes on my iPhone, desktop and laptop, plus in as many apps as support it properly
  • Ubuntu 19.10 is available for Raspberry Pi 4
  • lots of visual improvements in each of the Ubuntu editions – Xubuntu, Kubuntu, Ubuntu MATE

Download Ubuntu 19.10

As always, the best place to start with Ubuntu download is http://releases.ubuntu.com/19.10/

Upgrading to Ubuntu 19.10

I did the usual sequence to get my laptop upgraded. Except the last step which needed the -d option to recognise that Ubuntu 19.10 is available. All of these commands were run through sudo.

  • apt update
  • apt upgrade
  • apt dist-upgrade
  • do-release-upgrade -d

Do you use Ubuntu? When are you planning to upgrade?

See Also




Upgrading Raspbian OS from Stretch to Buster

With recently released Debian 10 Buster it's possible to upgrade Raspbian OS on your Raspberry Pi device to the same release.
Raspberry Pi 4

Debian 10 Buster got released a while back and this means it should be possible to upgrade Raspbian OS on Rasberry Pi devices to the Raspbian Buster as well. Raspbian OS is based on Debian as you remember.

Step 1: Confirm Your Current Linux Kernel and OS release

Always a good step: confirm Raspbian version and check your current Linux Kernel version:

greys@s7:~ $ uname -a
Linux s7 4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l GNU/Linux
greys@s7:~ $ cat /etc/debian_version
9.9

Step 2: Update Existing Release Before Upgrading to the Next

Just like in the upgrade Jessie to Stretch procedure, we start with using apt-get command to upgrade existing packages available for the current release.

The reason it’s recommended to do this is by moving to the latest available version in your current release you are minimising the changes required for the upgrade to the next release. Changes and configuration file syntax are not likely to be as dramatic between last version in current release and first version in the next release.

We refresh list of available updates:

greys@s7:~ $ sudo apt-get update

and install these updates:

 greys@s7:~ $ sudo apt-get upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
The following packages will be upgraded:
cups-browsed cups-filters cups-filters-core-drivers dbus dbus-x11 fonts-opensymbol libcupsfilters1 libdbus-1-3 libexpat1 libexpat1-dev
libfontembed1 libraspberrypi-bin libraspberrypi-dev libraspberrypi-doc libraspberrypi0 libreoffice libreoffice-avmedia-backend-gstreamer
libreoffice-base libreoffice-base-core libreoffice-base-drivers libreoffice-calc libreoffice-common libreoffice-core libreoffice-draw
libreoffice-gtk libreoffice-gtk2 libreoffice-impress libreoffice-java-common libreoffice-librelogo libreoffice-math libreoffice-nlpsolver
libreoffice-ogltrans libreoffice-pdfimport libreoffice-report-builder libreoffice-report-builder-bin libreoffice-script-provider-bsh
libreoffice-script-provider-js libreoffice-script-provider-python libreoffice-sdbc-hsqldb libreoffice-sdbc-postgresql libreoffice-style-galaxy
libreoffice-style-tango libreoffice-systray libreoffice-wiki-publisher libreoffice-writer libssl-dev libssl-doc libssl1.0.2 libssl1.1 libzmq5
nodered omxplayer openssl patch python3-uno raspberrypi-bootloader raspberrypi-kernel rpi-chromium-mods uno-libs3 ure vim vim-common vim-runtime
vim-tiny xxd
65 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 176 MB of archives.
After this operation, 9,103 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
...

Run apt-get dist-upgrade too, in my case it shows zero packages:

greys@s7:~ $ sudo apt-get dist-upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Step 3: Upgrade Raspbian OS to Buster

Three elements to this step:

  1. Update release code name in /etc/apt/sources.list
  2. Download list of available package updates
  3. Upgrade Raspbian OS

Update release name in /etc/apt/sources.list

First, let’s edit /etc/apt/sources.list file:

greys@s7:~ $ sudo vi /etc/apt/sources.list

I changed this:

to this:

Refresh packages info with apt-get update

Now we can refresh information about available package updates:

greys@s7:~ $ sudo apt-get update 

And, finally, we’re ready to…

Upgrade Raspbian packages to Buster release

greys@s7:~ $ sudo apt-get upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
...

… and finish it off with apt dist-upgrade:

greys@s7:~ $ sudo apt-get dist-upgrade
Reading package lists… Done
Building dependency tree
Reading state information… Done
Calculating upgrade… Done
The following packages were automatically installed and are no longer required:
...
The following packages will be REMOVED:
gnome-themes-standard-data gstreamer1.0-omx gstreamer1.0-omx-rpi gstreamer1.0-omx-rpi-config idle-python3.5 libcupscgi1 libcupsmime1 libcupsppdc1
libcurl3 libgles1-mesa libllvm3.9 libmariadbclient18 libreoffice-gtk libreoffice-style-galaxy libreoffice-systray libsensors4 libservlet2.5-java
libtirpc1 netsurf-gtk python3-spidev raspi-copies-and-fills xserver-xorg-video-fbturbo
The following NEW packages will be installed:
...
533 upgraded, 459 newly installed, 22 to remove and 0 not upgraded.
Need to get 861 MB/862 MB of archives.
After this operation, 1,045 MB of additional disk space will be used.
Do you want to continue? [Y/n]

Step 4: Confirm Successful Upgrade

We need to reboot the Raspberry Pi now:

greys@s7:~ $ sudo shutdown -r now

…and run uname -a command and inspect the /etc/debian_version file to confirm that our Raspberry Pi is indeed running the latest version of Raspbian OS now:

See Also




Unix Fun: cowsay command

Screen Shot 2019-06-10 at 12.16.32.png

cowsay is a comman line tool that you can install on any Linux or Unix distro to render funny text updates as if they’re told by a cute text mode cow. There are lots of options to customise the look of both the cow and the text message.

Installing cowsay in Raspbian OS

I decided to install cowsay on one of my Raspberry Pi systems at home:

greys@becky:~ $ sudo apt install cowsay
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
lxkeymap python-cairo python-gtk2 python-xklavier
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
cowsay-off
Suggested packages:
filters
The following NEW packages will be installed:
cowsay cowsay-off
0 upgraded, 2 newly installed, 0 to remove and 182 not upgraded.
Need to get 27.9 kB of archives.
After this operation, 114 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ftp.heanet.ie/mirrors/raspbian/raspbian stretch/main armhf cowsay all 3.03+dfsg2-3 [20.1 kB]
Get:2 http://ftp.heanet.ie/mirrors/raspbian/raspbian stretch/main armhf cowsay-off all 3.03+dfsg2-3 [7,816 B]
Fetched 27.9 kB in 0s (60.1 kB/s)
Selecting previously unselected package cowsay.
(Reading database ... 211819 files and directories currently installed.)
Preparing to unpack .../cowsay_3.03+dfsg2-3_all.deb ...
Unpacking cowsay (3.03+dfsg2-3) ...
Selecting previously unselected package cowsay-off.
Preparing to unpack .../cowsay-off_3.03+dfsg2-3_all.deb ...
Unpacking cowsay-off (3.03+dfsg2-3) ...
Setting up cowsay (3.03+dfsg2-3) ...
Setting up cowsay-off (3.03+dfsg2-3) ...
Processing triggers for man-db (2.7.6.1-2) ...

Using Cowsay in Linux

Just type “cowsay” followed by a few words and you’ll get something like this:

Screen Shot 2019-06-10 at 11.12.51.png

Changing the cow appearance in cowsay

From the cowsay man page:

There are several provided modes which change the appearance of the cow depending on its particular emotional/physical state. The -b option initiates Borg mode; -d causes the cow to appear dead; -g invokes greedy mode; -p causes a state of paranoia to come over the cow; -s makes the cow appear thoroughly stoned; -t yields a tired cow; -w is somewhat the opposite of -t, and initiates wired mode; -y brings on the cow’s youthful appearance.

Here’s an example of one of these options:

Screen Shot 2019-06-10 at 11.19.50.png

It’s also possible to just specify the charecters to be used for the eyes of the cow, -e option needs to be followed by the two characters you want to seeScreen Shot 2019-06-10 at 12.14.51.png:

That’s it for today, it’s been fun!

See Also