Installing Ubuntu 12.04 on Lenovo
David Booth <email@example.com>
I never finished writing this up. Portions marked @@@@ are
placeholders, most often for screenshots that I intended to add but got
This W530 came with Windows 7 pre-installed, so I am intending to leave
Windows 7 installed, and set up Ubuntu in a dual boot
The laptop is new and I did not bother to go through the Windows 7
initial configuration process.
Initial hardware was Lenovo Thinkpad W530, purchased
Separately purchased, and added later:
- 2.6GHz Intel Core i7-3720QM Quad-Core
- 8GB of 1600MHz DDR3 RAM
- nVIDIA Quadro K1000M Graphics (2GB)
- 500GB 7200rpm Hard Drive
- 15.6" Full HD Anti-Glare LED-Backlit Display
- 1920 x 1080 Native Resolution
- SuperMulti DVD Burner
- 802.11a/b/g/n Wi-Fi, Bluetooth 4.0
- Windows 7 Professional (64-bit)
- 2x8GB = 16 GB RAM (for a total of 24GB, because the W530 has 4
- 512GB SSD, Crucial M4
Ubuntu 12.04 Installation
1. Download and burn a Ubuntu 12.04LTS CD.
2. Plug in ethernet cable to W530, for network access without
3. Insert the Ubuntu CD, then power up and boot into Ubuntu from
it. I had to use the paper
trick to open the drive when the power was off, in order to
insert the CD.
4. Run "Install Ubuntu 12.04 LTS" from the Ubuntu desktop:
5. Select your language (English), and on the "Preparing to install
Ubuntu" screen, select both "Download updates while installing" and
"Install this third-party software".
6. At the first "Installation type" screen, select "Something else" and
Continue. The screenshot below shows three options because I
re-ran this in order to get the screen shot, but first time you run it
there will only be two options:
7. This should bring you to another "Installation type" screen that
lists the existing disk partitions. Problem: There are three partitions
shown and the largest is listed with "unknown" space used:
The "unknown" is what bothers me. This is the partition that I
need to resize, in order to make space for Ubuntu, but I cannot resize
that partition if the space used is "unknown". When I select that
partition and click "Change", there is no option to change the
In contrast, when I select the /dev/sda3 partition, I see an option to
resize it (which I do NOT want to do -- that's the wrong partition to
resize). I am only showing you this screen shot so that you can
see what the other one should have looked like:
To reiterate, do NOT resize the /dev/sda3 partition. Click
"Cancel" to dismiss the "Edit partition" dialog.
I am not sure what the existing partitions are, but by opening a
terminal window (Ctrl-Alt-T), and using the command "df -m" I can see the
partition assignments and the space used (in MB) in the last three
Filesystem 1M-blocks Used Available Use%
667 667 0
1500 366 1135 25%
39672 421767 9% /media/Windows7_OS
11628 2373 84%
After searching a long time, I found a reply to this
post that says:
"If the installer is not reporting
usage value for an ntfs partition, it is better to resize it from
Windows. Viewing it from Windows will give you a better idea of how
much free space is left on it.
So I guess that's what I'll try. :(
Use Windows’ partition manager (type “partitions” into the search box
to find it)."
8. Shut down Ubuntu by clicking the gear icon in the upper right and
selecting "Shut Down...":
If the CD does not eject automatically, then use the paper clip trick
again to eject it.
9. Boot up to Windows 7 and run through the Windows 7 configuration
process that it goes through the first time you boot it. This may
take several reboots as Windows does whatever it does for updating
10. Run the Windows 7 Disk Management utility. To do so, click
the Windows 7 icon in the lower left of the screen, and type
"partitions" in the search box
Then click "Create and format hard disk partitions" in the menu, to run
11. Select the Windows7_OS partition/volume, right-click and select
It will bring up a dialog telling you that it is asking the drive about
the available space, and when that finishes it will bring up a dialog
that you can use to shrink this partition:
Problem: It says that this
partition can only be shrunk down to about 200GB! Since most of
my work will be under Ubuntu, I would be wasting nearly half of my
drive capacity if I only shrunk the partition that much. I found this
article that says "On partitions that store Windows operating
systems, there may be certain files on the disk that can prevent you
from shrinking a volume." This appears to be the case. This
article gives long, complicated instructions for getting
around the problem on Vista -- I don't even know if the same procedure
would work on Windows 7. But at this point I decided that it
isn't worth the trouble. I'm going to bail out and wipe out that
entire partition and just run Ubuntu using that whole partition.
In theory, I should be able to restore Windows 7 from the
Lenovo_Recovery partition someday if I want to, but I have not tested
that theory. To be safe, I think I will try installing the SSD
and installing Ubuntu on that, temporarily leaving the Windows 7
partition in place. That sounds like a safer route. After I
get Ubuntu running from the SSD, I can remove the Windows 7 partition
entirely if I want.
12. Make a Windows7 Recovery DVD. I followed instructions in the Thinkpad
Manual to do this. I selected only the option for a
Boot disk -- not for a data disk. I assume that this operation
copied files from the Lenovo_Recovery partition, but I really don't
13. Remove the existing hard drive, and replace it with the SSD.
Again, I followed instructions in the Thinkpad
Manual to do this. However, I noticed that the
original hard drive had a plastic tab attached, which allows the drive
to be pulled out:
The SSD drive did not have one, and I was concerned that it may be
difficult to get it back out again, given how it is friction-fit, and
it provided nothing to grab. Therefore, I added my own plastic
tab made of packing tape:
The loose end of the packing tape is doubled back on itself, so that no
sticky surfaces are exposed.
I decided, for the moment, to leave the old hard drive out entirely, to
be certain that I did not accidentally install Ubuntu on it or
otherwise create any dependency on it when installing Ubuntu.
Installing Ubuntu 12.04 on the SSD
14. With the SSD installed, repeat steps 2-5 above, to boot from the
Ubuntu CD, select language (English), click "Install Ubuntu" and
specify that you want to download updates while installing, and to
install third-party software.
15. Select "Erase disk and install Ubuntu", and Continue. Since
the original hard drive has been removed, I know this can only install
on the new SSD, which is what I want.
16. Click "Install Now":
17. Select timezone and Continue:
18. Select keyboard layout:
19. Specify computer name, login name, password:
20. Take your photo:
21. Wait while it installs:
22. Click "Restart Now", remove the installation CD (as the screen
says), and hit the Enter key to let it reboot from the SSD
installation. After it reboots, you should get your Ubuntu login
23. (Optional) Install Gnome Desktop. I find the default desktop
environment (Unity) that comes with 12.04 to be dumbed down to the
point of being incredibly frustrating, much like MS Windows.
(E.g., where the hell is a button or menu to open a command
window???) Therefore, I would rather revert to the Gnome Desktop
environment that was standard in Ubuntu 10.04. To get this, I
instructions. FIrst, use Ctrl-Alt-T to open a command window
(since there is no button to do so), and issue the command "sudo
apt-get install gnome-panel":
apt-get install gnome-desktop-item-edit
24. Logout, then at the new login prompt, click the round button next
to your name:
then select "GNOME Classic (no effects)" or "GNOME Classic" before you
25. Install updates. Run the Update Manager:
Applications->System Tools->Update Manager.
26. Verify that some key features work:
27. Verify that network printing does not work. Run
Applications->System Tools->System Settings
- Wireless - yes
- USB drive - yes
- Backlit keyboard - yes (Ctrl-Space cycles through 4 settings:
off, low, high, off-but-webcam-light-on)
- Add network printer - NO. I guess I'll try to fix that next.
- Webcam - yes
- Second display - NO.
Will try instructions at
Click Add New Printer
Select "Network", and notice the error message saying "FirewallD is not
running. Network printer detection needs services mdns, ipp,
ipp-client and samba-client enabled on firewall."
28. Fix network printing. Following instructions in this
post, open a terminal window (Ctrl-Alt-T) and run "sudo
This pops up a window for adding a printer:
Click "Add", and "Network Printer". If your desired printer
shows up in the list, you're in luck. In my case it didn't:
So I need to manually enter some information to locate it. In my
case, the printer I wish to use is on another Linux/Ubuntu computer on
the same network. I don't know that computer's IP address, so I
went over to it, opened the list of printers (via
System->Administration->Printing, because that computer is
running Ubuntu 10.04), right-clicked on the printer and selected
"Properties", which allowed me to see that it was using the ipp
protocol and also see its IP address.
Back on my new ThinkPad W530, click "Find Network Printer", type in the
network printer's IP address where it asks for "Host" (note that it did
not work for me when I tried entering the host name -- I had to use the
then click Find, select the desired printer connection at the bottom,
and click Forward:
Enter a desired short name for the printer, and Apply:
Then print a test page. Problem:
the test page printed only the text commands instead of the
result of the PDF commands:
To make sure the printer was working correctly, I printed a test page
from a different networked computer, and it printed the familiar Ubuntu
29. Install Foomatic printer driver software. Comparing the
printer configurations on the W530 with an older Ubuntu laptop, it
looks like the W530 is not using the same printer driver, which it
apparently calls "Remote Printer". (To see this: In a command
window, run "sudo system-config-printer", then right-click on the
printer, and select Properties.) Run Applications->Ubuntu
Search for "foomatic" in the upper right corner, select @@ [Did not
finish getting this fixed] @@
40. Get the external monitor working (second display). I followed instructions from a blog post by Chris Pearce:
In the terminal enter:
sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get install nvidia-current
Then reboot to change BIOS settings:
At the Lenovo BIOS screen press
"Enter" to interrupt normal startup, F1 to enter BIOS setup utility.
Change Config > Display > Graphics DeviceDiscrete Graphics.
This means the hardware will attempt to use only the Nvidia graphics
card, not the Intel integrated graphics. Press F10 to save and boot the
After that, the second display worked!
Problem discovered later:
Brightness controls no longer work, so I cannot save battery while
flying by turning down the brightness. Also, I cannot change the
Manuel sugggests instead installing nvidia-current-updates
sudo dpkg -l | grep nvidia
Manuel suggests removing everything nouveau-related, because they are
the open source nvidia drivers, and not mature enough, and instead use the drivers from NVidia. This also mentions problems with nouveau. But when I try to remove the nouveau drivers, I get dependency problems:
sudo apt-get remove nvidia-experimental-310
sudo apt-get remove nvidia-settings-experimental-310
sudo apt-get remove nvidia-settings-updates:i386
sudo apt-get install nvidia-current-updates
sudo apt-get install nvidia-settings-updates
# dpkg -l |grep nouveauThe correct one to remove seems to be libdrm-nouveau2, since if I try to remove all of them at once, I get dependency problems:
ii libdrm-nouveau1a 2.4.39-0ubuntu1 Userspace interface to nouveau-specific kernel DRM services -- runtime
ii libdrm-nouveau2 2.4.39-0ubuntu1 Userspace interface to nouveau-specific kernel DRM services -- runtime
ii libdrm-nouveau2:i386 2.4.39-0ubuntu1 Userspace interface to nouveau-specific kernel DRM services -- runtime
ii xserver-xorg-video-nouveau-lts-quantal 1:1.0.2-0ubuntu3~precise2 X.Org X server -- Nouveau display driver
# apt-get remove -m libdrm-nouveau2Previously I had tried to remove all at once, but it failed:
apt-get remove libdrm-nouveau1a libdrm-nouveau2 xserver-xorg-video-nouveau-lts-quantal
Now install the NVidia drivers:
The following packages have unmet dependencies:
libaudio2:i386 : Depends: libxt6:i386 but it is not going to be installed
libmaven2-core-java : Depends: libdoxia-java (>= 1.1) but it is not going to be installed
libqtgui4:i386 : Depends: libsm6:i386 but it is not going to be installed
openssh-client : Depends: adduser (>= 3.10) but it is not going to be installed
ssh : Depends: openssh-server
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
the settings can be seen at: Applications->System
Tools->Administration->NVIDIA X Server Settings, but I did not
change any of them. If that doesn't work, they can also be seen
with the "nvidia-settings" command. However, when I run
nvidia-settings, I get this warning telling me to run nvidia-xconfig:
sudo apt-get install --reinstall nvidia-current-updates
But there is no nvidia-xconfig program installed. So instead, I
tried clicking "Save Current Configuration", without making any changes:
After rebooting, when I run Applications->System
Tools->Administration->NVIDIA X Server Settings, I no longer get that error dialog. So I also tried:
Problem: With the BIOS set to the
Display->Discrete Graphics setting, I am unable to change the screen
resolution or brightness.
Using X configuration file: "/etc/X11/xorg.conf".
VALIDATION ERROR: Data incomplete in file /etc/X11/xorg.conf.
Device section "Default Device" must have a Driver line.
Backed up file '/etc/X11/xorg.conf' as
Backed up file '/etc/X11/xorg.conf' as '/etc/X11/xorg.conf.backup'
New X configuration file written to '/etc/X11/xorg.conf'
I then changed the BIOS setting back to NVIDIA Optimal, and the
brightness control now works and I can change display resolution. Problem: The external display does not work.
I also tried changing the BIOS Display setting to Integrated Graphics,
but the external display still did not work. Thus far, the only
way I have been able to get the external display
working is to change the BIOS Display setting to Discrete
Graphics. :( Therefore, my plan is to use Discrete
normally, and change to NVIDIA Optimal when I wish to save battery life
(such as flying).
Problem: In BIOS->Display->Integrated Graphics mode, the display is only 640x480.
My colleague Manuel recommends this:
(05:56:46 PM) david: any ideas what woudl happen if i re-installed nouveau?
(05:57:31 PM) manuel: no. i would recommend this:
(05:58:20 PM) manuel: log out of X, then go to a console, delete the xorg.conf file (should be in /etc/X11/), and run nvidia-settings as root
(05:58:44 PM) manuel: could also be nvidia-xconfig (i don't remember which one of the is the command line tool)
(05:58:58 PM) manuel: it'll generate a clean config file for the nvidia driver
50. Install Oracle Java7. Follow these instructions to "Install Oracle Java 7 in Ubuntu via PPA":
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
apt-get install oracle-java7-set-default
apt-get install oracle-jdk7-installer
60. Install other packages:
70. Install encrypted private directory. This creates an
encrypted subdirectory called Private in your home directory. The
encrypted version is stored in ~/.Private .
- java6 (for use with tomcat6)
- For tomcat to work, also set JAVA_HOME in /etc/default/tomcat6 . ls /usr/lib/jvm to see available java versions.
- See also instructions below for increasing jvm heap size.
- google-talkplugin (for google hangout)
- ia32-libs (for 32-bit support needed by some apps, such as webex?)
- Thunderbird add-on google-search-for-thunderbird
- perldoc -- install via "apt-get install perldoc", because it isn't in the Ubuntu Software Manager
- libexpat1-dev (needed by XML::Parser, needed by clmailer.pl)
- Perl modules (via cpan):
- XML::Parser (needed by clmailer.pl)
- exiv2 (for converting photos)
- rapper (raptor2-utils) for RDF translation
- zlib1g-dev (for perl XML processing & RDF -- install this before the others below)
- libxml2-dev (for perl XML processing & RDF)
- libxml-perl (for perl XML processing & RDF)
- CANCEL: librdf-perl (Redland RDF library) -- not sure if I need it.
- librdf-trine-perl (for perl RDF)
- gthumb (for image thumbnails)
- InSync (for Google Drive synchronization) I have the beta, which is still free. The latest costs.
sudo apt-get install ecryptfs-utils
71. Set up address list encryption/decryption. See instructions in rgad.perl .
72. Disable overly scrollbars.
echo export LIBOVERLAY_SCROLLBAR=0 >> ~/.xprofile
73. When accidentally logged in using "Gnome Classic" instead of "Gnome
Classic (no effects)", ALT-TAB no longer works for changing
windows. I tried to fix it by installing CompizConfig Settings
Manager and enabling "Application Switcher", but that caused the system
to hang when using ALT-TAB. However, enabling "Static Application
Switcher" seemed to work. But I intended to be using "Gnome
Classic (no effects)" anyway. I wish I could disable the "Gnome
Classic" option to avoid accidentally using it in the future.
74. Video player. Tried to install ubuntu-restricted-extras, but
it says I must first remove Libav codec library (libavcodec53) and
Libav utility library (libavutil51). So I uninstalled those, then
installed ubuntu-restricted-extras. @@ to be continued @@
On my previous Dell Studio 15 laptop under Ubuntu 10.04 I got DVD video
playing to work using these instructions:
75. Install vmware. (See also old virtualbox notes in personal/notes/virtualbox-install.txt .) Download VMware Player for Linux 64-bit. Install Windows 7 Ultimate initially,
'/downloads/ms-windows-7/X17-59463 (1).iso', do not use the license
key, then install the Windows 7 upgrade,
'/downloads/ms-windows-7/Win7UltimateUpgrade32bit.iso', and then use
the license key.
I had trouble getting it to boot from the new ISO. It always
wanted to boot from hard drive (HD). I finally got it to boot
from ISO using these instructions: http://code-journey.com/2009/vmware-boots-too-fast-to-enter-bios-or-choose-boot-source-biosbootdelay/
by adding the following line to /vmware/Windows7/Windows7.vmx :
bios.bootDelay = "5000"
I had to replace the smart quotes with regular quotes around "5000". That
allowed me to get to the BIOS using F2 when it was starting to boot.
Then I changed the boot order for the CD -- moved it above the HD --
but then I still had to "hit any key" in time when booting or else it
would still boot from HD. Select "Custom Install" during
@@ to be continued @@
80. Sesame. Sesame stores its data in /usr/share/tomcat6/.aduna ,
so to secure the data we need to make sesame store its files in my
encrypted ~/Private directory , using a symbolic link:
Set rx permissions to allow tomcat6 to follow the symlink into my Private directory:
# cd ~/Private
# mkdir tomcat6
# mkdir tomcat6/aduna
# chown -R tomcat6.tomcat6 tomcat6/
# ls -l
drwxr-xr-x 3 tomcat6 tomcat6 4096 Mar 12 11:32 tomcat6
# chmod -R o-rwx tomcat6/
# ls -l
drwxr-x--- 3 tomcat6 tomcat6 4096 Mar 12 11:32 tomcat6
# ln -s /home/dbooth/Private/tomcat6/aduna/ /usr/share/tomcat6/.aduna
# chmod go+rx ~/Private/
Add user and role in /etc/tomcat6/tomcat-users.xml . Uncomment the last
several lines, and change them to the following (putting in a more
secure password though):
root@dbooth-w530:/var/log/tomcat6# ll -d ~/Private/
drwxr-xr-x 4 dbooth dbooth 4096 Mar 12 12:08 /home/dbooth/Private/
tomcat to listen only to requests from localhost. In
/etc/tomcat6/server.xml , modify the appropriate <Connector ...>
<user username="tomcat" password="tomcat" roles="admin,manager-gui"/>
<!-- dbooth 4/7/14: added address="127.0.0.1" to limit tomcat access
to requests from localhost, per instructions at
<Connector address="127.0.0.1" port="8080" protocol="HTTP/1.1"
Increase tomcat6 memory using -Xmx option. According to this post, the proper place to specify java heap size for tomcat6 is in /etc/default/tomcat6:
##### dbooth 8/22/13: Increased heap space:
# JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC"
JAVA_OPTS="-Djava.awt.headless=true -Xmx2g -XX:+UseConcMarkSweepGC"
# service tomcat6 restart
Download Sesame 2.6.10. Follow links for latest download from here to here to here.
For an unknown reason, tar gives an error: "tar: A lone zero block at
32914" when unpacking, even though it seems to work.
tar xzvf openrdf-sesame-2.6.10-sdk.tar.gz
Deploy the sesame and openrdf war files. In the tomcat manager
scroll down to "Select WAR file to upload", and from
/downloads/sesame-2_6_10/openrdf-sesame-2.6.10/war select and deploy
both openrdf-sesame.war openrdf-workbench.war (one at a time).
The local OpenRDF UI can now be accessed. Set the server to http://localhost:8080/openrdf-sesame .
82. To get the latest Sesame code (though I currently do not use it in the RDF Pipeline Framework), go to the sesame page on bitbucket,
copy the https: URI on the right,
https://bitbucket.org/openrdf/sesame.git , and paste it into a git
command to clone the repository into the current directory (so cd
mkdir /downloads/sesame85. Configure RDF Pipeline server.
git clone https://bitbucket.org/openrdf/sesame.git
. . .
Total time: 47 minutes 56 seconds
Transfer installed packages
The goal of this section is the transfer a list of packages from one
Ubuntu system to another. See
your Ubuntu system to another computer in 3 simple steps.
30. On the old system, generate the list of installed packages:
Transfer files from a previous Ubuntu system.
2. Graphics card