Saturday, April 7, 2018

Lubuntu 17.04 to 17.10 upgrade

Introduction


I'm a bit tardy upgrading my Linux Lubuntu 17.04 distribution.  I have two computers running 17.04, an old HP dv8210us with a single-core, 2GHz AMD processor, and a newer Asus netbook with a dual-core, 1GHz AMD processor.

Everything was working nicely until I tried installing Notepadqq, an open-source version of the popular Notepad++ for Windows computer.  For my next snafu, I tried installing libdvd to play DVDs in my HP.  Unfortunately,  Lubuntu 17.04 is no longer supported, and I couldn't load the pre-requisite packages for either libdvd or Notepaddqq.   Also, security updates are no longer available.

These are my notes and learnings as I worked thru the upgrade process from 17.04 to 17.10.     The notes are my collection of how-tos for the next time I do this.   The learnings are little bits of wisdom I picked up along the way.

First learning:   if you have a choice, install an LTS version of Ubuntu or Lubuntu.  Long Term Support (LTS)  versions are supported for 5 years (Ubuntu) or 3 years (Lubuntu).   This is the second time I've done an upgrade, first from 12.04 to 14.04, and now from 17.04 to 17.10.   The process is not as smooth as one would hope.  My systems are old, things will certainly work better or differently or at least more quickly on your own hardware.

Second learning:  take copious notes of everything you customized and how you customized it.   One problem area on the HP is the Broadcom wireless card.  If you know how to handle it, it's pretty simple.  But the first time thru was painful; following my notes in Google Keep made a messy process easy.

First Note:  Installation media


This is pretty simple,  I created a bootable USB for the netbook (no optical disk player) and a bootable DVD for the HP (no USB boot).  First download the iso image from Lubuntu.net.

To create the bootable USB, use the Startup Disk Creator (System Tools -> Startup Disk Creator). Select the iso image as the source,  a 2GB USB drive as the destination, then click the Make Startup Disk button.

To create the bootable DVD, use xfburn ( Sound and Video > xfburn).   The Burn Image button burns an ISO image to a disc.  A DVD  is required to hold the whole image; a CD is not quite big enough.

Third learning:  procrastination is not your friend.   I upgraded Ubuntu 12.04 to 14.04 using the software center over the network;    four months ago, I could have repeated the process and skipped creating bootable media.

Second Note:  Broadcomm wireless adapter


My old HP laptop has a Broadcomm wireless adapter.  The following notes will help you get this working.   If you don't have a Broadcomm wireless adapter, skip this section.

First, do the install while connected to the Internet with an Ethernet cable. If the system tries to connect to the internet using the existing driver, the system will hang.   You will need to download the correct driver from the internet.   So, plug in.

After installation is complete, remain connected to the Internet via the ethernet cable.  Start a terminal window, and execute the following four commands.
 
$ sudo apt-get update
$ sudo apt-get install firmware-b43-installer
$ sudo apt-get remove bcmwl-kernel-source
$ sudo reboot


Third note:  Consistency


Working on a Windows 10 PC all day at work, I'm accustomed to hitting Windows-L to quickly lock my screen.  I don't have a strong preference for Windows-L on my PC verses Ctrl-Alt-L on my Linux systems, but it's convenient when all the simple things work the same way.

To add this to Lubuntu, edit the lubuntu-rc.xml configuration file in your favorite text editor.  Search for the string "lxsession-default lock".  When you find the string, copy the entire <keybind> thru </keybind>, and paste it below the existing lock command.  Add a comment that the sequence Windows + L locks the screen, and change the "key=C-A-l" to "key=W-l":

  
  <!-- Lock the screen on Windows + l-->
  <keybind key="W-l">
    <action name="Execute">
      <command>lxsession-default lock</command>
    </action>
  </keybind>


Save the file, and from a terminal session refresh your openbox configuration:

openbox --reconfigure

Assuming you didn't get any errors, both Ctrl-Alt-L and Windows-L sequences will lock your screen.

Fourth note:   Two Monitors


I have a second monitor sitting to the left of my laptop screen.   If you know Lubuntu, you know  where this is going...  the left monitor is always the main monitor.  And if you're really "clever", you can swap the monitor positions but find that you don't have a taskbar with the laptop monitor alone.

I've googled this problem, and it's a common question with no satisfactory answer.  After a lot of trial and error, the best solution that I've found is to configure the menu on both monitors identically, and to use xrandr to set the monitors so the second monitor is to the left of the laptop screen.    This gives me a configuration that works whether the laptop has a second monitor or not, and my mouse moves left to go to the left monitor.  With the taskbar on both monitors, I will also have a taskbar on the laptop when only the laptop screen is in use.

Here's scoop:

First, right-click the task bar and open the panel settings.  Configure the panel settings to your personal preferences and close the window.

Next, open a terminal window, and change your working directory to .config/lxpanel/Lubuntu/panels.   Edit the panel file in the panels directory using a text editor like vi or leafpad.  In the global section, add one line

monitor=0

and save the file.   Now change the monitor=0 line to monitor=1, and using a Save as... dialog, save the panel as panel1.

Execute lxpanelctl restart, and you will have taskbars on both of your monitors.

Fifth Note:  Network and Volume Indicators


After installing 17.10, I noticed problems with the network and volume controls on the task bar:  The network menu collapsed so quickly it was almost unusable, and the volume control didn't work at all. After a lot of googling,  I found that this is only a problem if the autohide option on the taskbar is selected.  I like the autohide feature, so I worked around this problem in two ways.   I rarely use the network menu; if I need it, I turn off the autohide feature while I use the network menu.

I use the volume control frequently; so turning off autohide every time I want to mute an advertisement is not ideal.   Instead, I disabled the Sound Menu on the indicator menu and added the Volume Control plug in to the panel menu:
  • Right click on the task bar, and select Panel Settings
  • Click on the Panel Applets tab, select Indicator applets, and click the Preferences button
  • Uncheck the Sound Menu and close the Indicator applets menu
  • Back on the Panel Preferences menu, click the Add button
  • On the Add plugin to panel menu, scroll down the list, find the Volume Control, highlight it, and click the Add button
  • The Volume Control is added to the right of the power control.  Use the Up and Down buttons to move the control where you like.
  • Close the panel preferences

Sixth Note:  More on Network Interfaces


I have two wireless network interfaces with my Asus netbook.  The built-in Qualcomm Atheros AR9485 worked fine out of the box.   In addition, I have a Realtek RTL8192cu USB dongle.   When booting into Windows 10, I found the Realtek interface is much faster than the Qualcomm interface.   In Lubuntu, the Realtek interface would stop working every two or three minutes until I disabled/enabled the interface. Then it would work again for another two or three minutes.

Googling the issue turned up several different answers to the problem; the references below all agree that it's a driver issue.  In short, the driver in kernel 4.4 is supposed to work well, but Lubuntu 17.10 is using kernel 4.13, and the driver for the Realtek interface is buggy.  Here's how to fix it.

sudo apt-get install linux-headers-$(uname -r) build-essential dkms git
git clone https://github.com/pvaret/rtl8192cu-fixes.git
sudo dkms add ./rtl8192cu-fixes
# NB:  The step above reports a version.   
#      As of 2018-04-12, the version is 1.11, not 1.10.
#      Use the correct version in the next step.
sudo dkms install 8192cu/1.11
sudo depmod -a
sudo cp ./rtl8192cu-fixes/blacklist-native-rtl8192.conf /etc/modprobe.d/
sudo cp ./rtl8192cu-fixes/8192cu-disable-power-management.conf /etc/modprobe.d/
reboot


Seventh Note:  Printers


I use two printers at home, a old Lexmark Optra S 1255, and a wireless Epson NX420.  Configuring the Lexmark is easy; it's a postscript printer, and Linux has always supported postscript printers well.   Open System Tools -> Printers -> Add.  I have a network card in the printer, so I expand the Network Printer options and choose AppSocket/HP JetDirect.  Enter the IP of the printer, port 9100 is already filled in, and click Forward.  Select the manufacturer from the list, then the model,  describe the printer, click Apply and print the test page.

The default driver for the Epson NX420 does not work well at all; the colors do not align properly, but instead look like shadows.   This is another problem that's a pain to fix the first time, but it's not too bad the second time.  The NX420 needs a driver from http://www.openprinting.org/printer/Epson/Epson-NX420_Series.  Choose the 64-bit deb driver, download it, and then open the downloaded file.   Lubuntu will open the driver in the Software Center.   Click the Install button to install the driver.

Now add the printer ( System Tools -> Printers -> Add).   Expand the network printers, select the NX420, and click the Forward button.  The system searches for print drivers for a minute or so, then displays the Describe Printer dialog.  Click Apply, and print a test page to verify that the driver works properly.  The test page should identify the driver as EPSON.PPD, and the test page should look perfect.   If the print driver is STP01629.PPD and the images at the top of the test page don't align, then you have the bad print driver.

With these notes, I'm ready for the next upgrade.    With Lubuntu installed on my 12-year old laptop and my under-powered netbook,  I have two pretty responsive computers.   The laptop is perfect for my desk:  if the cat walks across it, who cares? It's a twelve year old computer.  And the one and half pound netbook is great for traveling.


References