Difference between revisions of "Ubuntu notes"

From Jon's Wiki
 
(28 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
This page is a very terse distillation of things I've had to fiddle with. Most of these solutions have come from wading through [http://www.ubuntuforums.org/ Ubuntu Forums].
 +
 +
;UPDATE May 2011: Most of this is now ancient history
 +
 
== Enable Sensible Repositories ==
 
== Enable Sensible Repositories ==
  
 
A vaguely useful apt sources.list:
 
A vaguely useful apt sources.list:
  
  <nowiki> deb    http://nz.archive.ubuntu.com/ubuntu/ edgy         main restricted universe multiverse </nowiki>
+
  <nowiki> deb    http://nz.archive.ubuntu.com/ubuntu/ hardy         main restricted universe multiverse </nowiki>
  <nowiki> deb-src http://nz.archive.ubuntu.com/ubuntu/ edgy         main restricted universe multiverse </nowiki>
+
  <nowiki> deb-src http://nz.archive.ubuntu.com/ubuntu/ hardy         main restricted universe multiverse </nowiki>
 
   
 
   
  <nowiki> deb    http://nz.archive.ubuntu.com/ubuntu/ edgy-updates  main restricted universe multiverse </nowiki>
+
  <nowiki> deb    http://nz.archive.ubuntu.com/ubuntu/ hardy-updates  main restricted universe multiverse </nowiki>
  <nowiki> deb-src http://nz.archive.ubuntu.com/ubuntu/ edgy-updates  main restricted universe multiverse </nowiki>
+
  <nowiki> deb-src http://nz.archive.ubuntu.com/ubuntu/ hardy-updates  main restricted universe multiverse </nowiki>
 
   
 
   
  <nowiki> deb    http://security.ubuntu.com/ubuntu    edgy-security main restricted universe multiverse </nowiki>
+
  <nowiki> deb    http://security.ubuntu.com/ubuntu    hardy-security main restricted universe multiverse </nowiki>
  <nowiki> deb-src http://security.ubuntu.com/ubuntu    edgy-security main restricted universe multiverse </nowiki>
+
  <nowiki> deb-src http://security.ubuntu.com/ubuntu    hardy-security main restricted universe multiverse </nowiki>
 
   
 
   
  <nowiki> deb http://archive.canonical.com/ubuntu   edgy-commercial main </nowiki>
+
  <nowiki> deb     http://archive.canonical.com/ubuntu  hardy          partner </nowiki>
 
   
 
   
  <nowiki> deb    http://packages.freecontrib.org/plf  edgy-plf      free non-free </nowiki>
+
  <nowiki> deb    http://medibuntu.org/repo/ hardy free non-free </nowiki>
  <nowiki> deb-src http://packages.freecontrib.org/plf  edgy-plf      free non-free </nowiki>
+
  <nowiki> deb-src http://medibuntu.org/repo/ hardy free non-free </nowiki>
 +
 
 +
'''Note:''' Can replace security.ubuntu.com with nz.archive.ubuntu.com for faster transfers, with slightly less up-to-date-ness.
 +
 
 +
=== In the Event of Bad Signature Errors: ===
 +
 
 +
sudo apt-get update -o Acquire::http::No-Cache=true
 +
 
 +
And if that doesn't feckin work, mv your /etc/apt/sources.list file somewhere temporarily, run an apt-get update to clear the indexes, then put it back and run another apt-get update again.
 +
 
 +
== One Line APT Keys command ==
 +
 
 +
Medibuntu requires its GPG key:
 +
 
 +
sudo apt-key advanced --keyserver subkeys.pgp.net --recv 2EBC26B60C5A2783
  
Note: Can replace security.ubuntu.com with nz.archive.ubuntu.com for faster transfers, with slightly less up-to-date-ness.
+
== Connect to a Windows VPN ==
 +
 
 +
Finally, some clever Ubuntu Gnome folks have written a network manager plugin for doing Windows VPN connections over PPTP. The extremely cool network manager is also available for KDE:
 +
 
 +
sudo apt-get install network-manager-pptp network-manager-kde
  
 
== Crazy Wireless Drivers ==
 
== Crazy Wireless Drivers ==
Line 23: Line 45:
 
If you are lucky enough to have bought a HP or Compaq laptop recently, you've probably got a Broadcom wireless chipset. Broadcom are lazy [[wankers]] and don't release their driver code.
 
If you are lucky enough to have bought a HP or Compaq laptop recently, you've probably got a Broadcom wireless chipset. Broadcom are lazy [[wankers]] and don't release their driver code.
  
'''Solution:''' Use ndiswrapper 1.8. Blacklist the built-in bcm43xx and download these [http://wiki.jon.geek.nz/wifi-drivers-x32.tar.gz Win32 Broadcom 4318 drivers].
+
'''Solution (before 8.04):''' Use ndiswrapper 1.8. Blacklist the built-in bcm43xx and download these [http://wiki.jon.geek.nz/wifi-drivers-x32.tar.gz Win32 Broadcom 4318 drivers].
  
 
  sudo apt-get install ndiswrapper-utils-1.8 ndiswrapper-common
 
  sudo apt-get install ndiswrapper-utils-1.8 ndiswrapper-common
  
== Google Earth Permission ==
+
== ATI Radeon Xpress 200M ==
 +
 
 +
Works in 8.04. In earlier versions, getting this chip to do 3D reliably is a pain in the arse. The fglrx driver does not work with Linux on laptops with the ATi Radeon Xpress 200M unless the BIOS is changed to use Sideport + UMI set to 128 MB. '''LAME.'''
 +
 
 +
=== Current Recipe ===
 +
 
 +
Get the latest Debian module building tools with this incantation:
 +
 
 +
sudo apt-get install module-assistant build-essential fakeroot dh-make
 +
sudo apt-get install debhelper debconf libstdc++5 linux-headers-$(uname -r)
 +
 
 +
Download the latest [http://ati.amd.com/support/drivers/linux/linux-radeon.html ATI driver binary] and tell it to build Ubuntu packages, then install them:
 +
 
 +
bash ati-driver-installer-8.34.8-x86.x86_64.run --buildpkg Ubuntu/edgy
 +
sudo dpkg -i *fglrx*8.34.8*.deb
 +
 
 +
Get the module assistant to build and install the fglrx kernel module thus:
 +
 
 +
sudo module-assistant prepare
 +
sudo module-assistant update
 +
sudo module-assistant build fglrx
 +
sudo module-assistant install fglrx
 +
sudo depmod -a
 +
 
 +
Configure your X server (or edit /etc/X11/xorg.conf by hand):
 +
 
 +
sudo aticonfig --initial
 +
sudo aticonfig --overlay-type=Xv
 +
 
 +
and make sure you have this in xorg.conf as well:
 +
 
 +
Section "Extensions"
 +
    Option  "Composite" "Disable"
 +
EndSection
 +
 
 +
;See also: Getting the [[ATI|laptop ATI 200M chipset]] to play nice with the plasma telly, and getting the [[NVidia 8800GT]] to work at all with gutsy.
 +
 
 +
== SSH Authentication With Keys  ==
 +
 
 +
Turn off ssh login prompts and do everything with keys. This will reduce the attack surface on port 22. First, create a key using the following command:
 +
 
 +
ssh-keygen -t dsa -f ~/.ssh/mykey
 +
 
 +
This will ask for a pass-phrase and create a pair in your .ssh directory as two files, mykey containing the private key and mykey.pub containing the public key. Then for each host you log in to, scp your public key to your home folder and append it to the ~/.ssh/authorized_keys file, thus:
 +
 
 +
<b>me@home$</b> scp ~/.ssh/mykey.pub me@remotehost:~
 +
<b>me@home$</b> ssh remotehost
 +
Password:
 +
<b>me@remotehost$</b> cat ~/mykey.pub >> ~/.ssh/authorized_keys
 +
 
 +
Then, in your Gnome Sessions configuration under Startup Programs, add this:
  
Permission denied running googleearth?
+
ssh-add /home/me/.ssh/mykey
  
sudo chown -R username ~/.googleearth ~/.local/share/applications/googleearth.desktop
+
Note that you will need your full home path, not the ~ shortcut. Now, you can enter your pass-phrase once at the start of every session, and log in to your hosts without prompting for passwords. Once you have it working, you can then disable ssh password prompts.
  
== Connect to a Windows VPN ==
+
== Playing DVDs ==
 +
 
 +
For some reason DVD playing in hardy is lame. To fix, install VLC and bung this in /usr/share/applications/vlcdvd.desktop:
 +
 
 +
[Desktop Entry]
 +
Version=1.0
 +
Name=DVD Player (VLC)
 +
Comment=Play a DVD main menu with VLC
 +
Exec=vlc --fullscreen %f
 +
Icon=vlc
 +
Terminal=false
 +
Type=Application
 +
NoDisplay=true
 +
Categories=AudioVideo;Player;
 +
MimeType=x-content/video-dvd;
 +
 
 +
Then update the desktop database
 +
 
 +
sudo update-desktop-database
 +
 
 +
Then choose ''DVD Player (VLC)'' in Nautilus - Edit -> Preferences -> Media tab.
 +
 
 +
== LM Sensors ==
 +
 
 +
To get '''sensors''' to work properly you need to run:
 +
 
 +
sudo sensors-detect
 +
 
 +
first and follow the onscreen directions.
 +
 
 +
== Other stuff ==
 +
[[Epiphany browser]] [[Using Screen]] [[Koha/Install]] [[PostgreSQL]]
  
Finally, some clever Ubuntu Gnome folks have written a network manager plugin for doing Windows VPN connections over PPTP. The extremely cool network manager is also available for KDE:
+
== References ==
  
sudo apt-get install network-manager-pptp network-manager-kde
+
* [http://www.ubuntuforums.org/ Ubuntu Forums]

Latest revision as of 01:59, 13 May 2011

This page is a very terse distillation of things I've had to fiddle with. Most of these solutions have come from wading through Ubuntu Forums.

UPDATE May 2011
Most of this is now ancient history

Enable Sensible Repositories

A vaguely useful apt sources.list:

 deb     http://nz.archive.ubuntu.com/ubuntu/ hardy          main restricted universe multiverse 
 deb-src http://nz.archive.ubuntu.com/ubuntu/ hardy          main restricted universe multiverse 

 deb     http://nz.archive.ubuntu.com/ubuntu/ hardy-updates  main restricted universe multiverse 
 deb-src http://nz.archive.ubuntu.com/ubuntu/ hardy-updates  main restricted universe multiverse 

 deb     http://security.ubuntu.com/ubuntu    hardy-security main restricted universe multiverse 
 deb-src http://security.ubuntu.com/ubuntu    hardy-security main restricted universe multiverse 

 deb     http://archive.canonical.com/ubuntu  hardy          partner 

 deb     http://medibuntu.org/repo/ hardy free non-free 
 deb-src http://medibuntu.org/repo/ hardy free non-free 

Note: Can replace security.ubuntu.com with nz.archive.ubuntu.com for faster transfers, with slightly less up-to-date-ness.

In the Event of Bad Signature Errors:

sudo apt-get update -o Acquire::http::No-Cache=true

And if that doesn't feckin work, mv your /etc/apt/sources.list file somewhere temporarily, run an apt-get update to clear the indexes, then put it back and run another apt-get update again.

One Line APT Keys command

Medibuntu requires its GPG key:

sudo apt-key advanced --keyserver subkeys.pgp.net --recv 2EBC26B60C5A2783

Connect to a Windows VPN

Finally, some clever Ubuntu Gnome folks have written a network manager plugin for doing Windows VPN connections over PPTP. The extremely cool network manager is also available for KDE:

sudo apt-get install network-manager-pptp network-manager-kde

Crazy Wireless Drivers

If you are lucky enough to have bought a HP or Compaq laptop recently, you've probably got a Broadcom wireless chipset. Broadcom are lazy wankers and don't release their driver code.

Solution (before 8.04): Use ndiswrapper 1.8. Blacklist the built-in bcm43xx and download these Win32 Broadcom 4318 drivers.

sudo apt-get install ndiswrapper-utils-1.8 ndiswrapper-common

ATI Radeon Xpress 200M

Works in 8.04. In earlier versions, getting this chip to do 3D reliably is a pain in the arse. The fglrx driver does not work with Linux on laptops with the ATi Radeon Xpress 200M unless the BIOS is changed to use Sideport + UMI set to 128 MB. LAME.

Current Recipe

Get the latest Debian module building tools with this incantation:

sudo apt-get install module-assistant build-essential fakeroot dh-make
sudo apt-get install debhelper debconf libstdc++5 linux-headers-$(uname -r)

Download the latest ATI driver binary and tell it to build Ubuntu packages, then install them:

bash ati-driver-installer-8.34.8-x86.x86_64.run --buildpkg Ubuntu/edgy
sudo dpkg -i *fglrx*8.34.8*.deb

Get the module assistant to build and install the fglrx kernel module thus:

sudo module-assistant prepare
sudo module-assistant update
sudo module-assistant build fglrx
sudo module-assistant install fglrx
sudo depmod -a

Configure your X server (or edit /etc/X11/xorg.conf by hand):

sudo aticonfig --initial
sudo aticonfig --overlay-type=Xv

and make sure you have this in xorg.conf as well:

Section "Extensions"
    Option  "Composite" "Disable"
EndSection
See also
Getting the laptop ATI 200M chipset to play nice with the plasma telly, and getting the NVidia 8800GT to work at all with gutsy.

SSH Authentication With Keys

Turn off ssh login prompts and do everything with keys. This will reduce the attack surface on port 22. First, create a key using the following command:

ssh-keygen -t dsa -f ~/.ssh/mykey

This will ask for a pass-phrase and create a pair in your .ssh directory as two files, mykey containing the private key and mykey.pub containing the public key. Then for each host you log in to, scp your public key to your home folder and append it to the ~/.ssh/authorized_keys file, thus:

me@home$ scp ~/.ssh/mykey.pub me@remotehost:~
me@home$ ssh remotehost
Password: 
me@remotehost$ cat ~/mykey.pub >> ~/.ssh/authorized_keys

Then, in your Gnome Sessions configuration under Startup Programs, add this:

ssh-add /home/me/.ssh/mykey 

Note that you will need your full home path, not the ~ shortcut. Now, you can enter your pass-phrase once at the start of every session, and log in to your hosts without prompting for passwords. Once you have it working, you can then disable ssh password prompts.

Playing DVDs

For some reason DVD playing in hardy is lame. To fix, install VLC and bung this in /usr/share/applications/vlcdvd.desktop:

[Desktop Entry]
Version=1.0
Name=DVD Player (VLC)
Comment=Play a DVD main menu with VLC
Exec=vlc --fullscreen %f
Icon=vlc
Terminal=false
Type=Application
NoDisplay=true
Categories=AudioVideo;Player;
MimeType=x-content/video-dvd;

Then update the desktop database

sudo update-desktop-database

Then choose DVD Player (VLC) in Nautilus - Edit -> Preferences -> Media tab.

LM Sensors

To get sensors to work properly you need to run:

sudo sensors-detect

first and follow the onscreen directions.

Other stuff

Epiphany browser Using Screen Koha/Install PostgreSQL

References