Thursday, May 13, 2010

Scanning Functionality for a Brother MFC-7340 Multifunction Device in Ubuntu 10.04

I had installed the printing functionality for a Brother MFC-7340 multifunction device in Ubuntu 10.04 (Lucid Lynx), including a Windows XP virtual machine running in VMware Workstation 7 on that Ubuntu installation.  Now I wanted to set up scanning functionality as well.  This post describes that effort.

I first verified that the scanning functionality was not installed automatically as part of the printer driver.  I went into Ubuntu’s Applications > Graphics > XSane Image Scanner.  (I was not sure whether XSane came with Ubuntu or whether I installed it separately through Synaptic Package Manager.)  XSane said it was “scanning for devices” and then reported that there were “no devices available.”  It occurred to me that this could be because I had connected the printer to the virtual machine, which probably would have made it unavailable for Ubuntu itself.  I went into the virtual machine and selected VM > Removable Devices > Brother Printer > Disconnect.  Then I went back out to Ubuntu and tried again in XSane.  I got the same result.  So it did seem that I would need to install scanner drivers separately.

The Brother Drivers for Linux webpage did have drivers and instructions for scanners.  I went to the driver download page, where I found that the MFC-7340 was categorized as a “brscan3” model.  I selected the Debian driver for the 32-bit brscan3.  There was also an option to download and install a scan-key-tool.  I wasn’t sure what that was, or if I would need it, so I held off.  The 32-bit brscan3 download gave me a file called brscan3-0.2.9-1.i386.deb.  There were different installation instructions for USB and ethernet connections.  There was also a separate webpage for Scanner Settings for Normal Users.  They had an Ubuntu 10.04 option there.  The steps I had to take there were, first, to type “sudo gedit /lib/udev/rules.d/40-libsane.rules” and then add two lines at the end of the, right before the line that began with “# The following rule will disable USB autosuspend for the device.”  The two lines I had to add were:

# Brother scanners
ATTRS{idVendor}=="04f9", ENV{libsane_matched}="yes"
Then I had to save that file and reboot the system.  When that was done, as with the printer configuration, I went through the Pre-required Procedures that seemed to apply to all versions of Ubuntu generally or to this version (32-bit 10.04) particularly.  Those steps seemed to be as follows:
sudo -i
mkdir /var/spool/lpd
apt-get install sane-utils
apt-get install psutils
I got an error for the mkdir command, as this was a step I had already done – I think when I installed the printer driver.  I already had sane-utils too, and got a message telling me to run “apt-get autoremove” to get rid of some packages that were no longer required, which I did.  I already had psutils as well.  With the Pre-Required Procedures out of the way, I was ready to follow the USB installation instructions for the scanner driver.  Having already downloaded the driver and connected the MFC-7340’s USB cable, I navigated to the folder where I had put the download and then typed this:
dpkg -i --force-all brscan3-0.2.9-1.i386.deb
dpkg -l | grep Brother
This all seemed good.  I started XSane, adjusted its settings, and scanned.  It worked with the automatic sheet feeder.  It saved in multiple formats, including JPG and PDF.  I tried scanning while standing at the scanner and punching the buttons on the MFC-7340.  That didn’t work.  That, then, was what the scan-key-tool driver was for.  From the download page, I got the 32-bit Debian brscan3 scan-key-tool driver (brscan-skey-0.2.1-3.i386.deb) and looked at the installation instructions.  They said I needed GIMP, which I already had installed (I think it came with Ubuntu), and that I also needed to have installed the scanner driver already, which I had done.  That took care of the Pre-Required Procedures.  Now, as above, I navigated to the folder where I had put the download and entered more or less the same commands as with the scanner driver, plus a couple of additional steps:
dpkg -i --force-all brscan-skey-0.2.1-3.i386.deb
dpkg -l | grep Brother
brscan-skey
brscan-skey -l
Following their additional instructions, I set the scan-key-tool to run automatically when I started the computer, by going into System > Preferences > Startup Applications > Add (suggested name = Brother Scan Key, command = brscan-skey, comment = Scan from the MFC-7340 console).  I scanned from the console.  The resulting file was saved in /root/brscan, probably because I had run all of these commands as root (i.e., sudo).  I ran brscan-skey again from my normal user (i.e., not root) prompt.  This time, I saved to Image rather than to File.  This provoked GIMP to start up and display the scan.  I saw that, again, it was saving the scans to /root/brscan (though I could only see them when I went there as root).  I changed the file name and location to a PDF in my preferred folder for scans, but GIMP was not prepared to do PDFs, so that was apparently an advantage of saving as File rather than as Image.  I tried again with GIMP, this time as a JPG to my preferred folder.  That worked, but the scankey was still saving copies of them to /root/brscan too.  The instructions said I could type “brscan-skey -u” to change the target user, so I did that as root, and then typed brscan-skey as myself.  Unfortunately, that didn’t do it; it was still saving in /root.  I tried “sudo brscan-skey -t” to stop it altogether.  That worked.  Now it wouldn’t scan from the console.  I started it as myself again.  Now it was saving to /home/ray/brscan.

The next step I wanted to take, following their additional instructions, was to modify the default script for scan-to-image so that it would save in my preferred folder as a JPG, and scan-to-file so that it would save there as a PDF.  Brother suggested changing this line in the default scantoimage script:
scanimage --device-name "$device" --resolution $resolution > $output_file
to this:
scanimage --device-name "$device" --resolution $resolution | pnmtops | gs -q -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=- - > $output_file.pdf
To edit the default script for the scanner's Image option, I typed this:
cd /usr/local/Brother/sane/script
ls
sudo gedit scantoimage-0.2.1-3.sh
Once I was in the scantoimage script, I decided to change several things, including increasing the resolution to 300.  Now, unfortunately, the script didn’t work.  After I punched the Start button on the scanner, it just sat there for a moment, and then gave a long beep and a “sane_read: Error during device I/O,” and a tiny brscan.XXXXX file would appear in /home/ray; and when I opened that file, it was all black; or if I restored the line about echoing the output to gimp, it said this:
GIMP message
Opening ‘/home/ray/brscan/brscan.3bq3GA failed: PNM Image plug-in could not open image
and then gave up.  Weird thing is, I couldn’t get it to function normally, even when I restored scantoimage-0.2.1-3.sh to what I thought was its original condition.  I stopped and restarted brscan-skey (i.e., stop with brscan-skey -t); still the same thing.  I restarted the computer and, at the same time, shut down and then restarted the printer.  Having set brscan-skey to start automatically with Ubuntu, I went right to the console and tried again.  Now it scanned.  Maybe I had needed to completely kill brscan-skey after a bad edit.  I edited scantoimage-0.2.1-3.sh again, this time making just one change and then testing it.  Everything was fine until I got to the part where I made the recommended change to the actual scanimage line in the script.  Then, once again, the scanner just started the scan and then froze.  Eventually it reset itself.  I tried again, but now it was just waiting for a few seconds and then giving me that long beep and not even trying to scan.  I commented out their recommended change and restored the way it was originally, saved, and tried again.  Still just the long beep.  So I typed this
kill -9 `pidof brscan-skey-0.2.1-3`
brscan-skey
(note:  those are backticks, not single quotation marks) and then tried scanning again, but still the long beep and the error.  Turning the printer off for 30 seconds and then back on after killing brscan-skey did the trick.  I played some more and got the long beep and error again.  This time, I didn’t turn the printer off; I just killed brscan-skey and waited for the printer to reset itself.  That worked too.  After more searching, I found what looked like it might be an answer in Stutz’s Debian Linux Cookbook (pp. 286-287), which said this:
scanimage outputs images in the PNM (“portable anymap”) formats, so make sure that you have the `netpbm’ package (installed on most Linux systems by default); it’s a useful collection of tools for converting and manipulating these formats.
Well, Synaptic told me that I did not have netpbm installed.  I installed it, using Synaptic.  I observed that a list of devices (produced by “echo 'devicenames == ' | gs -q | tr " " "\n" | sort”) contained pnm but not the pnmtops device used in Brother’s command.  Pnmtops did appear to be in Ubuntu 10.04; it just didn’t appear to be on my system.  So I changed that too.  About this time, I discovered that Ubuntu had probably been giving me error messages in Terminal after each try, but Terminal tended to be buried under other windows.  So now I got this error:
scanimage: sane_read: Error during device I/O
scanimage: received signal 13
scanimage: trying to stop scannerSegmentation fault
So I changed it back to pnmtops.  This time, I got an additional error, after the “scanimage: sane_read: Error during device I/O” message:
pnmtops: warning, image too large for page, rescaling to 0.691703
pnmtops: writing color PostScript...
pnmtops: EOF/error reading 1 byte sample to file.
It looked like almost nobody had gotten that EOF/error message.  Not a good sign!  The rescaling part did not seem to be a problem.

Around this point, I realized that I had been trying to set the scanner’s Image option to produce PDFs, when I had originally wanted to do that via the File option.  I didn’t know whether I would have any better luck editing scantofile-0.2.1-3.sh than I had had with scantoimage-0.2.1-3.sh, but I decided to try.  I was puzzled that the Ubuntu Manual said, “Never use mktemp().”  I tried their recommended alternative of mkstemp, but bash did not seem to recognize it.  After some additional playing around, I came up with this working script:
#! /bin/sh

# $1 = scanner device
# $2 = friendly name
#
# Resolutions: 100,200,300,400,600

resolution=300
device=$1
sleep 0.01
output_file="/media/DATA/Current/Scan_`date +%Y%m%d-%H%M%S`.pdf"

scanimage --device-name "$device" --resolution $resolution | pnmtops | gs -q -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=- - > $output_file

chmod 644 $output_file
This script would name each PDF by its date and time, so that they would sort in the correct order in Nautilus or in Windows Explorer.  I think netpbm had to be installed (above) for this to work.  This script changed a number of things in the Brother script, including notably the filename and location.

I took these changes to the scantoimage script as well.  That script would normally output a PPM file, so I added a pnmtojpeg conversion line to produce an output file in the better-known JPG format, for maximum compatibility with various browsers and other programs.  I set quality to 95 because, in a brief test, the resulting JPG was half the size of one set to 100.  I included a slight bit of smoothing to make the file slightly smaller and better-looking, without blurring sharp lines.  I put this JPG file into a Lossy folder, to distinguish it from a parallel process in which I used the scanner’s PPM output to create a lossless PNG version, in case I needed maximum quality.  After the scanning session, I could then easily get rid of all unnecessary copies by deleting either the Lossy or the Lossless folder (or by mixing their contents as needed).  The resulting, working scantoimage script was as follows:
#! /bin/sh
#
# $1 = scanner device
# $2 = friendly name
#
# Resolution options: 100,200,300,400,600

resolution=300
device=$1
sleep 0.01
dir_name="/media/DATA/Current/"
file_name="Scan_`date +%Y%m%d-%H%M%S`"

ppm_file=$dir_name$file_name".ppm"
scanimage --device-name "$device" --resolution $resolution > $ppm_file

mkdir $dir_name"Lossy"
jpg_file=$dir_name"Lossy/"$file_name".jpg"
pnmtojpeg --quality=95 --smooth=10 $ppm_file > $jpg_file

mkdir $dir_name"Lossless"
png_file=$dir_name"Lossless/"$file_name".png"
pnmtopng $ppm_file > $png_file

# Change, comment, or delete the next line, depending on which
# file (if any) you want to open in GIMP
rm $ppm_file

# Uncomment the next line if you want the file to open in GIMP
# echo gimp $output_file \;rm -f $output_file | sh &
As with the printer setup, the final question was whether I could use the MFC-7340 from within a Windows XP virtual machine on VMware Workstation 7.  I went into a virtual machine, opened Adobe Acrobat, and entered the commands to scan.  It did not see any scanning devices.  I cancelled out of that and went to VM > Removable Devices > Brother Printer.  I saw that there was no “Brother Scanner” option, so this did not look good.  I clicked on Connect anyway, to connect the printer, and went back to Acrobat.  But that made the difference:  now it saw both TW-Brother MFC-7340 and WIA-Brother MFC-7340.  I usually used the latter, so I went with that.  I went through all the other normal steps to make a scan.  Unfortunately, Acrobat crashed.  It had been doing that anyway in that virtual machine, so I couldn’t infer anything for sure from that.  I tried again.  This time, Acrobat sat there for several minutes with the “Transferring data...” dialog open and then finally said, “Scanning canceled.”  I tried again, this time using the Twain (TW-Brother MFC-7340) option.  It said, “Reading from the device.”  It got as far as 0% Completed, and it hung there.  After maybe 10-15 minutes, I canceled it.  Apparently scanning would not be happening from within the virtual machine.  Otherwise, though, it appeared the project was complete.

Installing a Brother MFC-7340 Printer in Ubuntu 10.04

I was installing Ubuntu 10.04 (Lucid Lynx) on a desktop computer.  I wanted to get my Brother MFC-7340 printer working from within Ubuntu.  I had not been able to make it work with Ubuntu 9.10, but now I had found a post where mdgrech described how it could be done.  The steps I took were as follows:
sudo -i
aa-complain cupsd
mkdir /usr/share/cups/model
mkdir /var/spool/lpd
apt-get install sane-utils
apt-get install psutils
It puzzled me that mdgrech’s link led to the LPR driver for the MFC-7420.  I suspected he knew exactly what he was doing; but just in case that was a mistaken link, I went to the Brother Linux driver download page and downloaded the Debian LPR driver for the MFC-7340 instead.  This gave me a file called brmfc7340lpr-2.0.2-1.i386.deb.  To install the LPR driver, Brother advised using CUPS if it was working on my system.  I wasn’t sure if it was.  I was advised to try this:  “sudo /etc./init.d/cups status.”  That said “cupsd is running.”  Now what?  I followed the links to the Cupswrapper Driver Install page.  There, I had to follow certain “pre-required procedures.”  These appeared to be more or less the steps that mdgrech had already had me take (above).  So apparently he had used the CUPS approach too.  Encouraged, I continued along this CUPS route.  There was some disagreement on the next step.  Brother said that I should turn on the printer and connect it to the computer now; mdgrech seemed to say I should install the driver first.  I wound up not connecting the printer until later.  Meanwhile, it seemed that I would need to be installing the cupswrapper driver as well as the LPR driver, so I went back to the download page and did that.  This gave me a download called cupswrapperMFC7340-2.0.2-1.i386.deb.  The next steps were to navigate to the folder where I had downloaded brmfc7340lpr-2.0.2-1.i386.deb and then type these commands:
dpkg -i --force-all brmfc7340lpr-2.0.2-1.i386.deb
dpkg -i --force-all cupswrapperMFC7340-2.0.2-1.i386.deb
dpkg -l | grep Brother
The next step was to go to http://localhost:631/printers.  It showed the printer.  So now I did turn on the printer and plug in the USB cable.  (Note that there are slightly different instructions if your connection is ethernet.)  Ubuntu saw the printer, but gave me a “Missing printer driver” note in the upper right corner of the screen, and then said “Searching for available drivers.”  Eventually it gave me a New Printer dialog.  

Note:  mdgrech had advised, instead, to go to http://localhost:631/admin, select Add printer, choose Brother MFC-7340, choose “Another Make/Manufacturer,” select the MFC-7340, and click Add Printer.  Since I had gone to http://localhost:631/printers as Brother advised, I was now at the New Printer dialog, so I proceeded from there.  I selected “Select printer from database” (with Brother highlighted) > Forward > MFC7340 for CUPS > Brother MFC7340 for CUPS [en] (recommended) > Forward.  I went with the defaults in the “Describe Printer” dialog > Apply.  I printed a test page.  It worked!

There was one other thing I needed to check.  On this Ubuntu machine, I was running Windows XP in a virtual machine in VMware, and had previously tried to install the MFC-7340 from there.  I still had it listed as a printer.  So I went into VMware at this point and tried printing from there.  The print job queued up, but it didn’t print.  I ran Brother’s Installation Diagnostics software, there in Windows XP, and it reported failure:  “Cannot communicate with the machine.”  I went into Start > Settings > Printers and Faxes (right-click) > right-click on the Brother MFC-7340 Printer > Properties > Ports tab.  I checked the box next to the USB003 port, which was the only port that specifically referred to the Brother MFC-7340.  I clicked OK and tried printing again.  Once again, it queued but did not print.  Then it occurred to me that, of course, I would have to go into VMware’s VM > Removable Devices.  There, sure enough, I saw “Brother Printer.”  I clicked Connect.  The queue dialog said, “Printing,” and then it did print.

The other thing I really wanted to be able to do with the Brother MFC-7340 was to scan.  This appeared to be an entirely different process, so I started another post for that.  Otherwise, with this step finished, I returned to the project of tweaking Ubuntu 10.04, as described in a separate post.

Compaq CQ60-420US Laptop Ethernet Connection Problem

I was having problems going online with my Compaq CQ60-420US laptop.  The wireless connection worked, but for some reason the wired connection didn’t, even when I connected it using a cable that was working fine for another computer.  This problem was occurring in both Microsoft Vista and Ubuntu (both 9.10 and 10.04) on this dual-boot machine.  I had spent a lot of time on the phone with HP tech support, and had even shipped the computer back to Texas for a motherboard replacement.  Maybe they didn’t replace the motherboard, or maybe they replaced it with another defective one; but in any event, it still wasn’t working.  For example, if I tried going to a website in Internet Explorer 8, it would say, “Internet Explorer cannot display the webpage,” and if I tried in Google Chrome, it would say, “This webpage is not available.”

In Vista (classic view), I went to Start > Settings > Network Connections.  With wireless disconnected, I right-clicked on Local Area Connection (Realtek PCIe FE Family Controller) > Diagnose.  Windows Network Diagnostics said,

Windows did not find any problems with this computer’s network connection.
I tried the option that said, “Reset the network adapter ‘Local Area Connection.’”  After a minute, it said, “The problem has been resolved.”  Yet I was still getting the “cannot display” error in Internet Explorer.  Clicking on the “Diagnose Connection Problems” button in Internet Explorer produced the Windows Network Diagnostics “Identifying the problem” message, followed by “Cannot communicate with” the webpage I had been trying to reach. It again offered me the option of resetting the network adapter, but I declined.

Microsoft offered a “Fix it for me” option, but of course I was not able to connect to that webpage on the laptop.  When I looked into that option on another computer, it said that it was intended to fix problems with Internet Explorer itself (e.g., freezes or crashes).  This was not just an Internet Explorer problem.  Choosing the “Let me fix it myself” option, then, I had already gone through methods 1 (try viewing another webpage), 2 (Network Diagnostics tool), and 3 (reset modem or router), and I did not bother trying methods 4 (delete browsing history) and 5 (use Internet Explorer no add-ons mode).  Advanced Troubleshooting Method 1 called for temporarily disabling the Internet security suite or firewall.  I had tried that, but not recently, so I tried it again.  In Control Panel, I went to Windows Security Center and turned off the firewall.  That did not help, so I turned off Windows Defender.  Still no solution.  In the system tray (at the bottom right corner of the screen, I moused over the various icons until I found the one that said, “Computer status – Protected.”  I right-clicked on that, and that opened Microsoft Security Essentials.  I went to its Settings tab and turned off Real-time protection > Save Changes.  Still no joy in either Internet Explorer or Chrome.  Just to be sure, I killed and restarted Internet Explorer and Chrome and tried again, but still no connection.  In Internet Explorer, I went into Tools > Internet Options > Security, unchecked Enable Protected Mode, restarted Internet Explorer, and tried again; but no.  This didn’t seem to be the solution, so I went on to Advanced Troubleshooting Method 2:  check whether Windows assigned you an automatic IP address.  To do this, Microsoft told me to go to Internet Explorer > Diagnose Connection Problems and click on IP Address, but I didn’t see an option like that.  Instead, I clicked on the Reset Network Adapter option again.  This time, the Windows Network Diagnostics dialog said something a little different:
Windows tried a repair but a problem still exists.
Cannot communicate with www.hotmail.com (64.4.20.174).
As advised on a couple of other websites, in Start > Run > CMD, I typed these commands:
ipconfig /release
ipconfig /renew
I wasn’t sure how to read the output, so I went back to the Microsoft advice.  I now saw that Advanced Method 2 didn’t apply, since it was just trying to see whether I had a problem related to my Internet Service Provider (ISP).  I didn’t, since the computer on which I was doing this typing was connected to the same line, and it was working just fine.  So:  on to Advanced Method 3:  test Internet Explorer by using a safe mode startup option that enables networking.  To do this, I went to Start > Search for files or folders > msconfig.exe.  The one I wanted was under C:\ProgramData\Microsoft\Windows\Start Menu.  I double-clicked on it and went to Boot tab, clicked Safe boot and Network > Apply.  Then Start > Shut down > Restart.  In Safe Mode, I opened Internet Explorer.  It still could not connect.  The Microsoft advice told me, in that case, to skip to Advanced Method 6:  Start > Run > devmgmt.msc > Network Adapters.  There were no exclamation marks.  Microsoft said, in that case, I should go to Advanced Method 7:  run System Restore.  But this, they said, would make sense only if the problem was a recent one, and in this case it wasn’t.  Advanced Methods 8 and 9 were oriented toward fixing problems with Internet Explorer but, again, it was a Chrome problem too.  I tried to go back to msconfig.exe via Search, but it didn’t find it, so I used Start > Run > CMD and then typed msconfig.exe at the prompt.  I went back to the msconfig.exe Boot tab and unclicked Safe Boot.  I restarted back into Vista and verified that the problem was still there.  I re-enabled my various security programs and settings, and pondered the situation.

It seemed I had a recurrent hardware problem that HP was not going to fix for me.  I noticed that Amazon.com had a number of devices that would plug into a USB port to give me an ethernet connection.  I got one that, according to its sole review, was good only for 32-bit operating systems, which is what I had on the laptop.  It cost me less than $7.  If the problem was just with the motherboard, this would hopefully get around it.  Unfortunately, that one failed.  I did not actually succeed in resolving this problem within the existing situation.  Instead, I moved to a different apartment, and for some reason that solved the problem.

Ubuntu 10.04 Adjustments: Software Source List

I was making some adjustments to my Ubuntu 10.04 (Lucid Lynx) installation.  I got kind of bogged down in the Software Sources.  This post describes that part of the enterprise.

When I went into Software Sources > Other Software, I now had a whole boatload of items, most of which were marked "disabled on upgrade to lucid."  To handle this, I tried Ubuntu Tweak.  It was an easy download, double-click to install.  I went into Applications > System Tools to run it.  Then I went down the list of applications and other items on the left side of its window and selected and adjusted them to taste.  I found that I had to exit Ubuntu Tweak and start it again in order to get the prompt that would re-enable my disabled Software Sources.

In Software Sources > Other Software, I noticed several things that didn't look quite right.  First, the "Cdrom with Ubuntu 9.10 'Karmic Koala'" was unchecked.  This made sense; I wasn't running 9.10 anymore.  I selected that item and clicked Remove.  I thought I'd put the new CD in its place.  I had installed 10.04 via download, not via CD, but in the process of fixing the installation I had downloaded and burned the alternate installation CD.  So now I put that into the CD drive and clicked on Add CD-ROM.  It gave me this:
Upgrade volume detected
A distribution volume with software packages has been detected.
Would you like to try to upgrade from it automatically?
It looked like the answer to that should be no, so I clicked Cancel.  Then I had another error:
Error scanning the CD
E:Unable to locate any package files, perhaps this is not a Debian disc or the wrong architecture?
Apparently the Alternative CD was more different from the ordinary Ubuntu CD than I had realized.  I was curious, so I downloaded and burned the official 10.04 CD.  While that was underway, I went to the next problem item on the Software Sources list:  “Unsupported updates.”  The common advice, repeated on a number of websites that seemed to have copied it from one another, was that this would give me programs that I “probably don’t need or even want.”  Au contraire, I was thinking that a person would enable this kind of source to get access to solutions to new problems as soon as they were discovered.  But for purposes of stability, for now, until I needed them, I decided to go with the flow and leave them unchecked.

Next, I saw that some items were marked as "disabled on upgrade to lucid."  According to TualatriX, Ubuntu Tweak > Applications > Source Center would enable only those that supported Lucid.  I’m not sure what happened to this particular category of problem; I played around with a couple of things and these went away.  Next, some of the titles were not right.  In particular, I saw this:
Medibuntu – Ubuntu 9.10 “karmic koala” (http://packages.medibuntu.org/ lucid free non-free)
I didn’t seem to find advice on exactly this problem, so I just selected that item in Software Sources, clicked Edit, and changed the Comment to “Medibuntu – Ubuntu 10.04 ‘lucid lynx.’”  These tinkerings led me to the revelations that “Mixing repositories can break your system,” and that I should have made a backup of my list of sources before I started fooling around.  The backup, it seemed, could be made with this command:
sudo cp -i /etc/apt/sources.list /etc/apt/sources.list_backup
This made me think that I could work up a good source list once and then not have to start from scratch like this in the future.  I had already modified the sources list in Ubuntu Tweak, but now I thought I might want to start over.  I got out of Software Sources and typed “sudo gedit /etc/apt/sources.list” in Terminal.  I copied the sources.list file suggested in the Ubuntu Guide wiki and used that to replace the contents of sources.list.  The two were pretty much the same anyway, but I thought this might clean things up a bit.  I saved and exited sources.list and went back into Software Sources.  Oddly, it still had some of the items that I had added in Ubuntu Tweak.  I went back into sources.list and, no, those other items (e.g., Skype) had definitely not been added to sources.list when I wasn’t looking.  Evidently Ubuntu Tweak was maintaining its own list of software sources and was using that to supplement whatever was in sources.list.  In Software Sources, I cleaned up the list (added comments, deleted duplicates) and then clicked Close.  It gave me the option to Reload, which I did.  Now I got an error message:
Could not download all repository indexes
The repository may no longer be available or could not be contacted because of network problems.
This applied to the CD-ROM line I had copied over from the wiki.  I closed that dialog.  The CD ISO was still downloading, so I couldn’t do anything more about that yet.  In the meantime, I went back into Ubuntu Tweak > Source Center > All Categories > Unlock.  Sources that I had selected previously were still checked, so UT did seem to be saving its own list somewhere.  I refreshed, got the CD-ROM error message again, closed that, installed new applications implied by my selection of sources, and then exited.  Trying another approach, I went to the Ubuntu Sources List Generator and selected all of the repositories I would want.  I excluded source code repositories, since I did not plan to be working with source code.  I clicked “Generate List.”  It gave me a replacement sources.list file, plus a list of commands to run to get the keys necessary to make the sources work; but it also looked like those commands were listed in the comments in the sources.list file too.  I looked again at Ubuntu Tweak.  It had a much longer list of sources, but I thought I could probably do without some.  In particular, I didn’t know if I needed a source just for some individual programs.  One, "déjà vu dup," was supposed to be a simple backup utility.  It was listed in Synaptic and would presumably be updated through there.  I hadn’t used it before, but I thought I would give it a try.  Likewise for Firefox, Opera, Shutter, deluge-torrent, and others.  The list generated by Ubuntu Sources List Generator did include Google, Medibuntu, and other major sources.  So I unchecked all of the sources in Ubuntu Tweak, including the Ubuntu Tweak source itself.  Then I took another look at sources.list, in the form I had copied from the wiki.  It was much more verbose than the one generated by the Ubuntu Sources List Generator, and now that I understood more about it, I didn’t want all those extra comments.  In the end, I decided that all I needed from the sources.list file that I had copied from the wiki was the first line, referring to the Ubuntu 10.04 CD-ROM.  So I replaced the existing sources.list with this one, provided by the List Generator:

#############################################################
################### OFFICIAL UBUNTU REPOS ###################
#############################################################

deb cdrom:[Ubuntu 10.04 LTS _Lucid Lynx_ - Release i386 (20100429)]/ lucid main restricted

###### Ubuntu Main Repos
deb http://us.archive.ubuntu.com/ubuntu/ lucid main restricted universe multiverse 

###### Ubuntu Update Repos
deb http://us.archive.ubuntu.com/ubuntu/ lucid-security main restricted universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ lucid-updates main restricted universe multiverse 

###### Ubuntu Partner Repo
deb http://archive.canonical.com/ubuntu lucid partner
deb-src http://archive.canonical.com/ubuntu lucid partner

##############################################################
##################### UNOFFICIAL  REPOS ######################
##############################################################

###### 3rd Party Binary Repos

#### GetDeb - http://www.getdeb.net
## Run this command: wget -q -O- http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -
deb http://archive.getdeb.net/ubuntu lucid-getdeb apps

#### Google Linux Software Repositories - http://www.google.com/linuxrepositories/index.html
## Run this command: wget -q https://dl-ssl.google.com/linux/linux_signing_key.pub -O- | sudo apt-key add -
deb http://dl.google.com/linux/deb/ stable non-free

#### HandBrake - http://handbrake.fr/
## Run this command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 62D38753
deb http://ppa.launchpad.net/handbrake-ubuntu/ppa/ubuntu lucid main 

#### Medibuntu - http://www.medibuntu.org/ 
## Run this command: sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update 
deb http://packages.medibuntu.org/ lucid free non-free 

#### Mendeley Desktop - http://www.mendeley.com/
## Run this command: no gpg keys supplied
deb http://www.mendeley.com/repositories/xUbuntu_10.04 /

#### muCommander - http://www.mucommander.com/
## Run this command: sudo wget -O - http://apt.mucommander.com/apt.key | sudo apt-key add - 
deb http://apt.mucommander.com stable main non-free contrib  

#### Ubuntu Tweak - http://ubuntu-tweak.com/
## Run this command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0624A220
deb http://ppa.launchpad.net/tualatrix/ubuntu lucid main

#### Wine - https://launchpad.net/~ubuntu-wine/+archive/ppa/
## Run this command:  sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F9CB8DB0
deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu lucid main

#### X Updates - https://launchpad.net/~ubuntu-x-swat/+archive/x-updates/
## Run this command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys AF1CDFA9
deb http://ppa.launchpad.net/ubuntu-x-swat/x-updates/ubuntu lucid main 

With that as my new sources.list file, I went back into Software Sources.  The entries that had been added previously were still there, along with the new ones listed in my new sources.list file.  I deleted the old ones and closed.  It asked if it should reload, and I said yes.  It said, "Could not download all repository indexes," because I had not yet entered the commands shown in the sources.list (above).  So I entered them, one at a time.  Some just gave me OK; some gave me other messages and then OK; some seemed to have problems.  I went to System > Administration > Update Manager and updated programs.    When it was done, I clicked the Check button.  It again said "Could not download all repository indexes" and "Please use apt-cdrom to make this CD-ROM recognized by APT."  It also said, "Some index files failed to download, they have been ignored, or old ones used instead."  For the CD-ROM, I went into System > Administration > Software Sources > Other Software and clicked the Add CD-ROM button.  I inserted the CD.  It said, "A volume with software packages has been detected."  I didn't want to install anything from the CD-ROM now, so I canceled out of that.  When I clicked Close, I was again given an opportunity to Reload, which I took.  I clicked Check again in Update Manager.  That was apparently the only thing I had needed to fix; there were no errors now.  Back in Software Sources, I saw that I had two entries for the CD-ROM.  I looked again at sources.list.  It had added a duplicate of the CD-ROM line, but it put it as the very first line, not lower down under the "OFFICIAL UBUNTU REPOS" heading as shown above.  So I deleted the one (under that heading), saved sources.list, and took another look in Software Sources.  There was now just one CD-ROM.  I made a trivial change and tried to close; I took the Reload option; all was good.  I saved a copy of the revised sources.list file, for use in this or other computers.  It was time to return to the main project of updating Ubuntu 10.04.

Monday, May 10, 2010

Enabling PAE on Ubuntu 10.04

I had written a string of posts on the process of installing and tweaking Ubuntu 10.04 (Lucid Lynx).  As part of that effort, I wrote a post on using a PAE-enabled kernel, which would permit 32-bit Ubuntu 9.10 to access more than 3GB - 4GB of RAM.  Unfortunately, that post somehow got vaporized.  This post provides the steps needed to use PAE in Ubuntu 10.04.


I found an Ubuntu community webpage that said that, in Lucid, the CD and DVD installers would automatically install the PAE-enabled kernel.  I had installed 10.04 using Update Manager, however, and I was not seeing the PAE kernel listed in the GRUB boot menu when I started the system.  Following the advice on the community webpage regarding how to install PAE manually, I went to System > Administration > Synaptic Package Manager and searched for PAE.  This showed me that, sure enough, the packages named in the community webpage (i.e., linux-generic-pae and linux-headers-generic-pae) were not installed.  When I marked those two for installation, they automatically brought along some others.

After Synaptic downloaded and installed those packages, I rebooted the system.  I didn't notice what the BIOS and GRUB said when it rebooted, so when Ubuntu was back up, I typed "uname -r" in Terminal.  It said 2.6.32-22-generic-pae.  So it appeared the PAE updated had been successful.  I typed "free -m" to see how much RAM I had.  It saw a total of 8068 (i.e., 8GB).  So it had worked:  the PAE kernel was recognizing more than 4GB of RAM.

Upgrading to Ubuntu 10.04 LTS

I installed Ubuntu 9.10.  In April 2010, System > Administration > Update Manager gave me the option of upgrading to 10.04 (Lucid Lynx).  I went with this option in May.  Shortly after starting the upgrade, I got this message:

Third party sources disabled
Some third party entries in your source list were disabled.  You can re-enable them after the upgrade with the 'software-properties' tool or your package manager.
I went ahead with the upgrade.   Next, I got this message:
Support for some applications ended.
Canonical Ltd. no longer provides support for the following software packages.  You can still get support from the community.
The community was the only place I had ever gotten support anyway, so that was fine.  I started the process, and I got an indication that the upgrade would be upgrading 1500 files, and it would take nearly an hour.  I went with that.  Next, it asked me where I wanted to install grub-pc.  I had two partitions on a hard drive, one for Windows XP programs, and one for Ubuntu, so (following the advice in the yellow pop-up) I selected both of those, but not the hard drive itself.  I had data partitions on another drive, and didn't install grub-pc to any of those.  Then I got a question about removing obsolete packages, and I affirmed that.  It installed more stuff and then wanted to reboot.  When it did, it got this far:
GRUB loading.
error: the symbol 'grub_puts_' not found
grub rescue>
To fix this, following the advice of Vanishing, I inserted an Ubuntu CD, punched the reset button on the computer, and when I got a menu, I looked for the "Rescue a broken system" option.  I didn't see one, so I checked and found this was an option on the Alternative CD.  I didn't seem to have one for a recent version of Ubuntu, so I downloaded the ISO on another computer, burned it to CD, and booted from that.  I worked my way around to an option to "Reinstall GRUB boot loader."  I tried doing that to /dev/sda.  Then I rebooted.  This time, it went OK.  Now I saw one reason why it might not have been working right before.  It said this:
The disk drive for /media/DAILY is not ready yet or not present
Continue to wait; or Press S to skip mounting or M for manual recovery
DAILY was my external USB hard drive.  I think I must have had an entry for it in /etc/fstab in the previous installation.  I pressed S to skip it.  It went through various updates (to Firefox, VMware, etc.).  Then it was done.  I wanted to make some changes to the installation, but that would be the subject of a separate post.

Tweaking Ubuntu 10.04

I had upgraded from Ubuntu 9.10 to Ubuntu 10.04 (Lucid Lynx).  Now I wanted to make some adjustments.  For this purpose, I would be drawing upon the first and second lists of adjustments I had made when I had installed 9.10.

The first of those other things was to install a PAE-enabled 10.04 kernel, so that I would have access to all of my system's RAM.  I also found that VMware Workstation 7.0 was requiring me to enter my serial number.  I had not entered it after installing it on 9.10; I had just been using the trial serial number.  Now, unfortunately, Workstation was not cooperating:  it was saying "Unknown error entering serial number."  The solution to this problem was to run Workstation as root (i.e., type "sudo vmware" at the Terminal prompt) and enter the serial number there.

Since I was doing an upgrade of a previous installation, I did not have to reinstall packages, but I did have a problem with Software Sources.  I have described that one in a separate post.  (Even if I had needed to reinstall packages, the "installed-software" trick described in the lists of adjustments (above) would have made short work of it.)  On my laptop, I was doing the same upgrade, and there I made some problems for myself when I had to interrupt the upgrade.  Here on the desktop, the next task was (as described in separate posts) to try to get the printing and scanning features of my Brother MFC-7340 printer working from within Ubuntu.  After doing that, I tackled a problem that I had wanted to solve for years:  how to import the list of AutoCorrect entries that I had created in Microsoft Word into OpenOffice.org Writer, running on Ubuntu.  That took some time, but then I was able to get back to the project of working through those notes from previous installations.

The upgrade from Ubuntu 9.10 to 10.04 had preserved much of the configuration I had already set up.  So as I worked through the Ubuntu tweaking steps described in one of my previous posts, I had to deal with only a fraction of the issues addressed there.  One was to prevent icons for mounted drives from appearing on the desktop.  That called for Terminal:  “gconf-editor” > /apps/nautilus/desktop > unclick volumes_visible.  But it was already unclicked, and yet I did have icons for mounted drives visible on the desktop.  I went into Applications > System Tools > Ubuntu Tweak > Desktop Icon Settings and clicked Show desktop icons and left everything else unchecked, but this made no difference.  I tried again, this time using “sudo gconf-editor.”  Ah, yes.  The volumes_visible box was checked for root.  Unchecking it removed the icons from the desktop.

I had not noticed, but somewhere along the line, I had evidently installed nautilus-open-terminal via Synaptic, or possibly it came installed by default.  As its name suggested, this tool added a right-click (context menu) option in Nautilus, "Open in Terminal."  Unlike Windows Explorer, this option was only available for folders in the file listing in Nautilus -- in the right pane, that is, not in the left pane that would typically show the folder tree.  In that left pane, this and other options were absent.

Had another little problem.  During the upgrade to 10.04, the Firefox icon changed, on the left-side (formerly top) panel, to a red do-not-enter or not-allowed kind of icon; and in Applications > Internet, it changed to a grey question-mark box.  I fixed this by going to the panel, right-clicking on Applications > Edit Menus > Internet > Firefox > Properties, clicking on the icon, and selecting /usr/share/pixmaps/firefox.png.  Speaking of Firefox, I wanted Ubuntu to open Firefox and Google Chrome on startup.  I wanted to add these to a script that would run at startup, since I suspected that I would be coming up with other things that I wanted to have happen at startup too.  It seemed pretty technical – beyond my current ability, anyway – but it looked like I might be able to just write a script and put it into /etc./init.d.  I typed “sudo gedit” and then created a file called /etc./init.d/a_startup_script.sh.  I put, into it, the line that I got from e.g., right-clicking on Applications and choosing Edit Menus > Applications > Internet > Firefox > Properties:  “firefox %u.”  I saved it and typed “chmod +x /etc./init.d/a_startup_script.sh.”  Then I rebooted.  This achieved nothing.  So creating a general-purpose startup script remained a goal for the future.

I also went down Gizmo’s Freeware list of tweaks.  I had already done most of the ones I wanted, but there were a few others.  One was to install Windows TrueType fonts in Ubuntu.  I decided to extend their advice somewhat.  I took a look at System > Preferences > Appearance > Fonts.  I could see that a lot of Windows fonts were not present on the list there.  So in Windows XP, I went to C:\Windows\Fonts.  I selected and copied everything to another, temporary folder called UbuFonts.  In UbuFonts, I sorted by file type and deleted the ones that were not TTF files.  Back in Ubuntu, I typed “sudo nautilus” and went to /usr/share/fonts/truetype.  It already had a folder called msttcorefonts, but with only a fraction of the fonts that I had just copied from C:\Windows\Fonts to UbuFonts, and the font files there seemed older and smaller.  I made a backup copy of the msttcorefonts folder and then copied everything from UbuFonts into /usr/share/fonts/truetype/msttcorefonts.  Now System > Preferences > Appearance > Fonts had a much wider selection.  I changed the fonts to Tahoma 10 and the monospace to Courier 10.  Tahoma allowed me to see more information on each line onscreen.

Another tweak from Gizmo called for some playing around with Compiz.  This was a bad idea, as described in a separate post.  Another tweak of interest was to clean up the GRUB boot menu.  I typed “uname -r” and saw that I was using the 2.6.32-22-generic-pae kernel.  In Synaptic, I searched for linux-image, clicked at the top of the left-hand column to sort by those that were installed, and marked for removal all numbered items other than that kernel.  In this case, that included just two items:  linux-image-2.6.31-21-generic-pae and linux-image-2.6.32-22.generic (i.e., not pae).  I did another search for linux-headers and marked all non-2.6.32-22-generic-pae items there too.  In this case, trying to remove linux-headers-2.6.32-22 threatened to remove linux-headers-2.6.32-22-generic-pae as well; but I wanted to keep that, so I didn’t remove linux-headers-2.6.32-22.  On restart, I saw that GRUB now listed just the 2.6.32-22-generic-pae kernel and its recovery mode, along with memtest and Windows XP (it was a dual-boot machine).  I went back into Ubuntu without a problem.  I did later have a VMware problem that might have been related to this, though.

Gizmo also pointed me toward a number of recommended freeware apps.  These were for the KDE (not GNOME) desktop.  I thought it might be time to try KDE, if only to check out these programs.  One was the Wally wallpaper changer, which I installed through Synaptic.  Getting Wally (and the whole KDE desktop) involved a total of 91 files.  Other interesting pieces of Gizmo-recommended software I got through Synaptic:  gtk-recordMyDesktop and Dolphin file manager.  Downloaded directly from creators’ websites, I got WinkFreeFile Sync, and Parted Magic.  I did consider using Dropbox as well, because of its good reviews (by e.g., PC MagazineOnline Backup ToolsLaptop, and alternativeTo; but I decided that Windows Live Sync had important advantages even though I would have to run it in a virtual machine when I was booted into Ubuntu.

(Note:  a few days later -- possibly the first time I tried it after installing KDE -- Google Desktop search was no longer responding to its default Ctrl-Ctrl hotkey.  That is, its Quick Search Box was not coming up.  Something I saw on some webpage, as I was trying to fix that problem, made me wonder whether the KDE installation was to blame.  A tip that fixed it was to open the Google Desktop Search preferences and change the hotkey to Ctrl-F1.)

The last thing to do, in this round of tweaking, was to clean out unnecessary stuff from the drive on which I had installed Ubuntu, so that I could make a backup image in case I needed to reinstall – so that I could just restore the image, that is, instead of having to go back through all these steps.  This, I thought, called for something like the TreeSize utility that I had used in Windows to see where I might have files or folders taking up huge amounts of space.  Among what seemed to be several possibilities, I found an actual Linux version of TreeSize, so I downloaded that – but I also discovered Ubuntu’s Applications > Accessories > Disk Usage Analyzer, whose Treemap Chart was especially interesting.  These revealed that my Ubuntu installation was not presently very large, so I didn’t have to worry too much about shrinking it for this particular image.  It also revealed that by far the largest space hog, within that installation, was the Google Desktop index of stuff on my hard drive, at 5.2GB.  I did see that the Google Chrome cache was also taking 400MB.  I went into Chrome’s Settings (the wrench icon at the upper-right corner) > Options but didn’t see any way to control that, other than to just clear the cache.  I decided to leave it for now, and changed some other settings while I was there.  And that was it.  Ubuntu 10.04 was tweaked, at least for now.

Google Desktop on 64-bit Ubuntu 9.10

I could have downloaded Google Desktop in .rpm or .deb format for ease of installation, but decided instead to go with the repository approach.  I chose this approach in order to get automatic updates, and also to make it easier to install other Google software that might interest me.  There were a couple of repository options.  Before taking the manual approach to the repositories, I decided to try Google's automated installation script.  To run that script, I entered these two lines into Terminal, as instructed:

wget https://dl-ssl.google.com/linux/google-repo-setup.sh

bash google-repo-setup.sh 
That caused Ubuntu's Update Manager to fire up and offer to install a bunch of software updates.  I gave it my consent to proceed.  When it was done, I went into System > Administration > Synaptic and searched for google-desktop.  I marked google-desktop-linux for installation and clicked Apply.  Now I had a new Ubuntu menu item, Applications > Google Desktop.  I went into that and clicked OK, or whatever it was.

Now I noticed I had a Google Desktop icon in the system tray, or whatever they call it in Linux -- in, that is, the bottom right corner of the screen.  I right-clicked on that and set my Preferences.  In Preferences, I typed in "/media" as a folder to search, since I had some Windows XP partitions with data there.  Now the hard drive began churning away, presumably indexing the stuff in those partitions.

While that was doing its thing, I went back into Synaptic, searched for google, and clicked on Package, to arrange the options alphabetically.  I installed googleearth.  I noticed a google-chrome-beta, but decided I didn't need it right now.

I tried using Google Desktop.  It only searched the web.  I right-clicked on the system tray icon and changed the default search type to Desktop.  I was searching for "command economy."  It didn't find anything like that on my desktop.  I right-clicked on the icon again and chose Index > Index status.  It said it was only about 15% done with indexing, so I let it go for a while.  But when it was done, it had catalogued only a small number of my total files, so I guessed that it was not cataloguing subdirectories in /media.  I went into Google Desktop Help for Linux and searched around.  I didn't find an answer, so I posted a question.  Ultimately, I solved this (and other difficulties arising from 64-bit Ubuntu by downgrading to 32-bit Ubuntu.

Saturday, May 8, 2010

Overpopulation, Eugenics, and Reproductive Rights

It is widely assumed that people have a right of reproduction.  This right is often believed to include the right to have as many children as one wishes.  It is typically construed as a matter of personal choice, including the right to use birth control, for both sexes, as well as the woman’s right to choose to abort a fetus.  As such, it is juxtaposed most sharply against the official Roman Catholic Church viewpoint, in which one is obliged to have children, insofar as interference with conception is considered sinful.

Having Children, on the Individual Level

The assumed right to have children is commonly extended to a right to decide what sorts of children one will have.  This assumed right of perceived reproductive quality is commonly considered to include such measures as choosing high-quality sperm donorschoosing the sex of one’s child, using fertility treatments and other assisted reproductive technologies, and deselecting fetuses with congenital disabilities.  These sorts of “designer eugenic” measures, taken without coercion or financial incentives, have also been called “backdoor eugenics” and “laissez-faire eugenics” (Rothstein, Cai, & Marchant, 2009, p. 59).  The assumed right of perceived reproductive quality has been extended controversially, as in the McCullough-Duchesneau decision to deliberately create a child with a disability that the parents do not consider a disability.  Through genetic engineering, the assumed right of perceived reproductive quality is poised to give parents vastly greater and more precise control over the characteristics of their children. In one form or another, voluntary eugenic measures seem to be broadly embraced as means of giving future generations genes that will make their lives better and/or preventing them from getting genes that will make their lives worse (Rothstein et al., p. 61).

Like most rights, the assumed right to have children is at least sometimes construed as entailing certain responsibilities.  For instance, the case of Nadya Suleman, more notoriously known as “Octomom” because of her decision to seek and give birth to octuplets, has generated criticism arising from the medical risks and cost of their delivery and her financial inability to raise them without government aid.  The case has also led to condemnation of the doctor by California’s state medical board on several grounds, including “allegedly failing to refer Ms. Suleman for a mental health evaluation” (El-Rahman, 2010).

Dillard (2009, p. 373) poses the matter in terms of “the procreative rights of criminally unfit parents.”  Criminal unfitness, in Dillard’s analysis, means bringing children into this world in “situations where the law forbids them to be,” as where a court orders a crack cocaine addict not to become pregnant.  Short of criminality, Dillard (p. 380) suggests that a prospective parent must meet a test of fitness, understood as “the minimum (that is, the necessary, but not sufficient) moral and legal competency required for parents to maintain custody of their child.”  This test, he says, is “most likely the legal standard required for a state to terminate parental rights.”  Hence, “We can view a temporary no-procreation order as equivalent to a court temporarily depriving unfit prospective parents of the custody of their prospective children.”  For instance, such an order could be appropriate, Dillard says, when the parent has been repeatedly found unfit for previously born children and shows no sign of having changed (pp. 381-382).  Lawmakers have also become involved in preventing harm to future children in cases involving incest, unsafe pharmaceuticals and medical devices, surrogacy contracts, trusts (as where e.g., a guardian ad litem is appointed to represent the interests of the unborn), prisoner procreation, statutory rape, parental abuse, and failure to pay child support (pp. 390-396).

References to parental fitness, like references to (especially negative) eugenics, can be disturbing to those who have studied, observed, or experienced third parties’ abuses of the power to control choices related to reproduction.  This power has been exercised in such areas as racial purity laws in the United States and in Nazi Germany (Scales-Trent, 2001), forced sterilization of undesirables in the United States (Rothstein et al., 2009, p. 59), restrictions on adoption by gay or lesbian couples, and restrictions on marriage of people with mental disabilities (Matloff, 2009).  As Dillard's (2009) examples suggest, however, the fact that such restrictions can be taken to extremes does not justify elimination of all restrictions on the assumed right to have children.


Having Children, on the Global Level

The foregoing remarks have addressed the situations of individuals who may be unfit parents, or who are procreating beyond their ability to provide.  There is, however, an entirely different concern that also has potential impact on the assumed right of reproduction.  This concern has to do with population growth; it is oriented, not toward individual procreators, but rather toward humanity as a whole.  As such, it sidesteps questions of whether gay people, people with disabilities, or other special targets of attention should be governed by special rules in their decisions to procreate, adopt, and so forth.  It asks, instead, how continued population growth might impose upon everyone’s decisions.

Along those lines, in a different article, Dillard (2007, pp. 44-45) contends that, in the U.S. and elsewhere, the law does not provide a limitless right to have as many children as one might wish, but rather, “Properly stated, the right [of reproduction] authorizes individuals to engage in a range of behavior between a guaranteed act of procreation or replacement, and procreation for optimized replacement, and nothing more,” where “optimized replacement” means the possibility of adjusting the rate of procreation upwards or downwards to achieve an optimal population level, rather than rigidly maintaining population at its current level regardless of whether that level is optimal.  Citing Roe v. Wade, Dillard (pp. 50-51) suggests that “Not procreating is personal,” in the sense that abortion is ultimately up to the mother, but “procreating is interpersonal” because it involves not only the mother but also the interests “of the children that will be born, those of other persons in society whose lives those children will influence, and more impersonal or collective interests.”  Privacy, he says, is “the opposite and absence of others’ rights”:  “As more persons are added, their spheres of privacy contract” (p. 56).  Population expansion requires ever-expanding rules to protect ever-increasing numbers of people from one another.  It reduces the choices that will be available to people in the future; it restricts the rights of others to natural resources (pp. 58-60).

A series of books in the 1960s and 1970s drew enormous attention to the problem of environmental degradation.  Aligica (2009, p. 74) identifies those as including Rachel Carlson’s Silent Spring (1962), Paul Ehrlich’s Population Bomb (1968), The Limits to Growth (1972) by Meadows, Meadows, Randers, and Behrens, and Global 2000 Report to the President (1980) by the Council on Environmental Quality and the U.S. Department of State.  Opposing this, Kahn and Simon’s Resourceful Earth (1984) offered a point-by-point rebuttal.  Aligica poses the contrast between Global 2000 (p. 1) and The Resourceful Earth (p. 2) in these excerpts:

If present trends continue, the world in 2000 will be more crowded, more polluted, less stable ecologically, and more vulnerable to disruption than the world we live in now. Serious stresses involving population, resources, and environment are clearly visible ahead. Despite greater material output, the world’s people will be poorer in many ways than they are today. For hundreds of millions of the desperately poor, the outlook for food and other necessities of life will be no better. For many it will be worse. Barring revolutionary advances in technology, life for most people on earth will be more precarious in 2000 than it is now – unless the nations of the world act decisively to alter current trends.
versus
If present trends continue, the world in 2000 will be less crowded (though more populated), less polluted, more stable ecologically, and less vulnerable to resource-supply disruption than the world we live in now. Stresses involving population, resources, and environment will be less in the future than now… The world’s people will be richer in most ways than they are today… The outlook for food and other necessities of life will be better … life for most people on earth will be less precarious economically than it is now.
Whatever doubts may have existed in 2000, it now increasingly appears that what Aligica calls the Neo-Malthusians had it right.  Malthus (1798) observed that food supplies rise arithmetically at best, while population rises geometrically -- that, in other words, population would always expand to keep ahead of food supplies.  The postwar Green Revolution -- achieving critical momentum in the 1950s and 1960s -- now seems only to have postponed the point at which population, now growing very rapidly, would outstrip food supplies (Turner, 2009; United Nations Food and Agriculture Organization, 2009).  (Howe and Devereux (2004) have developed a six-step scale, from food security to extreme famine, to characterize food scarcity problems in specific locations.)

The problems posed by overpopulation are numerous and huge.  The oceans are increasingly devastated, to the point of no longer being able to recover.  Developing nations are experiencing millions of deaths each year due to pollution and contamination of food and water (Pimentel et al., 2007).  The planet is heating up and may become uninhabitably hot.  Kates (2005) identifies “a Malthusian catastrophe already unfolding in poor countries,” potentially occurring in developed countries as well, and “a serious risk of wholesale environmental collapse” as problems requiring urgent attention.

In general, Brander (2007), a business professor, feels that the Neo-Malthusian 100-year projection in Limits to Growth have not been very accurate so far, but nonetheless acknowledges serious concerns about overpopulation and environmental degradation – concerns, he said, that have been downplayed in recent years because of intellectuals' faith in technological progress.  Brander judges that, at present, it could go either way:  humanity in the 21st century can rise to the challenge, or it can overpopulate itself to oblivion.  Either way, though, he concludes that Malthus did correctly identify the basic problem.

Population problems are going to be especially pressing in developing nations.  Goldstone (2010) identifies several problematic prospects for those nations.  Notably, they will account for the large bulk of the population increase; the growth in population will be especially concentrated in relatively unstable (poor, young, and heavily Muslim) countries; and most of the world’s population will become urbanized.

This should not be taken to imply that the U.S. is safe from population-related concerns.  Many saw the projected population of 300 million, which is now the reality, as cause for deep concern back in the 1960s, when the population was around 200 million (e.g., Hoff, 2010, pp. 30, 39-40).  Projections generally seem to expect the U.S. population to grow at least until 2050, reaching the range of 400-450 million (e.g., Orgman & Guarneri, 2009).  Kolankiewicz (2010) contends that the U.S. has far exceeded its ecological carrying capacity.  Similarly, Kates (2005) lists a number of concerns (including deforestation, mass extinction, and water shortage) as grounds for endorsing a global population reduction to 2 billion and an American reduction to 200 million, with each nation “making its own trade-off between consumption and population size” (p. 267).  Powledge (2010, p. 265) states that food insecurity will be a global concern for the next 50 years and beyond.  This prospect appears likely to be especially problematic for lower-income households, given the expectation of substantial food price increases in coming decades (Hubert et al., 2010, p. S-2; see Ivanic & Martin, 2010).

Aside from the question of how people will be able to afford their food, there is also considerable evidence that, with some exceptions in certain subpopulations (e.g., young adults) and certain places (e.g., Manhattan), Americans generally prefer to live in circumstances of relatively low population density.  Numerous studies corroborate this.  For example, while Williams (2009, p. S84) notes that people view population density as both positive and negative, depending upon a variety of cultural and personal preferences for neighbors and social interactions, perceptions of safety, health supports, and other considerations (see also Hur, Nasar, & Chun, 2010, p. 57), he also observes (p. S90) that most people in the UK prefer, or aspire to, lower-density living.  Hur et al. (pp. 53, 57) found, similarly, a preference for openness (i.e., “vistas with open views and the lack of spatial enclosure”) in a study of homeowners in Franklin County, Ohio.  Helliwell and Barrington-Leigh (2010, p. 11) likewise found a strong positive link between subjective well-being and low population density in British Columbia and in the Atlantic provinces of Canada.  Across the U.S. as a whole, McGranahan (2008, p. 237) found, in a study of migration patterns and topographical features, that
[E]lements of preferred landscapes described by Ulrich (1986) – a mix of open land and forest, water, and topographic variation – have a strong bearing on recent migration in the rural areas of the U.S.  Migration is an important behavioral indicator of substantial preferences – people “vote with their feet” (Tiebout, 1956), often at considerable economic cost and at the expense of social ties.
Berry and Okulicz-Kozaryn (2009) find life dissatisfaction higher in big cities in Anglo-Saxon countries but lower in big cities in Asia.  Even so, among several large Asian cities, Lai (2009, p. 731) finds that Hong Kong, with its high population density, crime, and other urban difficulties, yields high levels of worry, stress, and depression for its older population.

Conclusion

Surely there should be places like San Francisco.  Surely people should be encouraged to enjoy them and make the most of them.  But on the whole, as the famous poem says, good fences make good neighbors.  Overall, steadily increasing population is not conducive to lifestyles that are more enjoyable or affordable.  There is substantial evidence that the people of the world (including the United States) have seriously exceeded the human capacity to use the Earth in a sustainable way – that is, without exhausting the availability of clean air and water, and with enough capacity to survive drought and hard times safely.  Having children in the present increases the likelihood that people in the future, potentially including one's own descendants, will experience lives that are short and/or nasty by today's standards.

Under such circumstances, it is neither moral nor reasonable to continue (intentionally or negligently) to add to the human population.  The point at which it will once again be moral and reasonable to do so depends upon how soon and how effectively humanity can get its numbers and its demands back in balance with its resources.  The question of choosing the characteristics of one's child is moot.  The assumption that everyone has a right to reproduce him/herself will be morally and logically untenable for at least the next ten years, and possibly for the next half-century or longer.  What's done is done, as far as the past is concerned; but future decisions need to be made with much greater awareness of people other than oneself.

This is very good news for a number of constituencies, including particularly the children who have been treated like cattle, to be herded into schools that will process them, but who cannot safely wander alone in their own neighborhoods for fear they will be lost to vicious predators.  When the ratio of adults to children increases, and especially if the number of unemployed adults increases, neighborhoods may once again become places where there is always someone around to keep an eye out, to make sure the kids are OK.  It is also good news for the cattle themselves, who at some point may be returned from industrial farms to actual pastures of their own.  And it is good news for people with disabilities, old people, and others who need viable neighborhoods in order to survive and thrive.  When every middle-aged adult can excuse him/herself from civic involvement with the rationale that s/he has to worry about his/her own family first, there aren't many people left to care about the community as a whole.

Much can change for the better, if people can be weaned from the idea that they are not real men and women until they have reproduced themselves.  This is an idea that can become as antiquated as the notion that you aren't a real man until you have gone skydiving or pulled some crazy stunt, or that you aren't a real woman until you have joined the official job market and have dedicated yourself to a corporation somewhere.

There will always be a need for reproduction of the species; but it can be done differently, and it can be done better.  The time has arrived to learn more about that.