UBC Physics & Astronomy
ubuntu notes
Troubleshooting typical Ubuntu Problems
Ubuntu System Monitoring

Which version of Ubuntu am I running? lsb_release -a

Upgrade: sudo apt-get update; sudo apt-get upgrade     (upgrade is used to install the newest versions of all packages currently installed on the system)
Upgrade to new version: sudo apt-get update; sudo apt-get dist-upgrade

Ubuntuzilla

The official repositories for a particular version of Ubuntu are composed to contain the latest versions of software packages as of the date of release of that version of Ubuntu. After the release is made, newer versions of software packages do not get added to the repositories, with the exception of security fixes. So, for example, the latest version of Firefox during Ubuntu 8.04 (Hardy) release was 3.0, so the repositories will contain 3.0, even though Firefox 3.5 was released afterwards. Furthermore, even the security patches are usually several days to a week or more behind the official Mozilla releases, due to the time it takes to test and package the software.

It is frequently desirable to get more timely security updates for Mozilla software, or run the latest version, which may not be available in the repositories, due to the new features and improvements. This is where the Ubuntuzilla repository comes in.

Read below for specific instructions for using this repository to install Firefox, SeaMonkey, and Thunderbird.

If you are using Ubuntu Jaunty (9.04) or later:

The repository to add, if you're adding it manually to your sources.list, is

deb http://downloads.sourceforge.net/project/ubuntuzilla/mozilla/apt all main

and you can use the following command to add it to your sources.list in one step:

echo -e "\ndeb http://downloads.sourceforge.net/project/ubuntuzilla/mozilla/apt all main" | sudo tee -a /etc/apt/sources.list > /dev/null
If you wish, verify that the repository has been added, by looking at /etc/apt/sources.list in your favorite text editor.
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C1289A29
sudo apt-get update
sudo apt-get install firefox-mozilla-build
sudo apt-get install thunderbird-mozilla-build
sudo apt-get install seamonkey-mozilla-build

Installing an rpm-based application
  1. $ sudo apt-get install alien fakeroot
  2. Now, use alien in a fakeroot to convert the RPM package to a debian package:
    $ fakeroot alien -c RaidMan-9.00.i386.rpm
    You should get a message stating raidman_9.00-1_i386.deb created.
  3. Next, we need to tweak some of the scripts inside the package to work properly on Ubuntu. Make a directory structure to extract the debian package into, and extract the package along with its control scripts:
    $ mkdir -p raidman_9.00-1_i386/DEBIAN
    $ dpkg -x raidman_9.00-1_i386.deb raidman_9.00-1_i386/
    $ dpkg -e raidman_9.00-1_i386.deb raidman_9.00-1_i386/DEBIAN
  4. Open the post-install (postinst) script with your favourite editor:
    $ vim raidman_9.00-1_i386/DEBIAN/postinst
    Remove the following line chkconfig --add raid_agent
  5. Open the post-remove (postrm) script with your favourite editor:
    $ vim raidman_9.00-1_i386/DEBIAN/postrm
    Remove the following line chkconfig --del raid_agent
  6. Now repackage the extracted content back into the debian package:
    $ dpkg -b raidman_9.00-1_i386/ raidman_9.00-1_i386.deb
  7. Install the new package:
    $ sudo dpkg -i raidman_9.00-1_i386.deb
  8. With a bit of luck the install should go smoothly and the background RAID agent ought to start automatically. You can control the RAID agent with the /etc/init.d script like so:
    $ sudo /etc/init.d/raid_agent stop
    $ sudo /etc/init.d/raid_agent start

Installing NFS client utils: sudo apt-get install portmap nfs-common
Installing sshd: sudo apt-get install ssh
In order to get Firefox to send mailto links to Thunderbird:
   1. Open Firefox
   2. In the navigation bar type about:config
   3. In the page of items right click and select New >> String
   4. Insert name: network.protocol-handler.app.mailto
   5. Insert value: thunderbird

Medibuntu (Multimedia, Entertainment & Distractions In Ubuntu) is a repository of packages that cannot be included into the Ubuntu distribution for legal reasons (copyright, license, patent, etc).

Gutsy Gibbon Problem _:Entry in K-menu...
After upgrading to Gutsy from Feisty, "_: Entries in K-menu:" appeared in Kicker next to most of the menu entries.
It seems to be a problem on any system that is non-US (or specifically sets their location to Canada)

I solved it nicely by:
-click K-menu, System Settings
-click Regional and Language.
-click SelectSystemLanguage button
-change from "English (Canada)" to "English (United States of America)"
-click Set System Language
-Log Out
-(I also restarted the x-server, thought I do not know if that is necessary)
It should be fixed now.

Installing Mathematica Fonts
This really only applies when connecting to our (old, V4.0) mathematica server.
  1. Copy the Type1 fonts dir to /usr/local/share/fonts/
  2. Edit /etc/X11/xorg.conf to add the lines:
    Section "Files"
       FontPath    "/usr/local/share/fonts/AFM"
       FontPath    "/usr/local/share/fonts/Type1"
       FontPath    "/usr/local/share/fonts/X"
    EndSection
  3. Restart the X server (Alt-Ctrl-Backspace).

Kubuntu missing /etc/X11/xorg.conf
A xorg.conf has priority above the new autodetection system. This is the way you can make a xorg.conf file:
- start the computer in Recovery Mode
- choose: drop to root shell
- type: Xorg -configure

Now your system will make a file: /root/xorg.conf.new
- do what the terminal says. If you see a gray graphical screen + mouse arrow, then it's good. 
Close with Ctrl-alt-backspace.

- type: reboot
- restart normally.
- copy /root/xorg.conf.new in /etc/X11/xorg.conf
- restart the computer.

Manually Setting Network Parameters

Configuring DHCP address for your network card

If you want to configure DHCP address you need to edit the /etc/network/interfaces and you need to enter the following lines replace eth0 with your network interface card

sudo vi /etc/network/interfaces

# The primary network interface – use DHCP to find our address
auto eth0
iface eth0 inet dhcp

Configuring Static IP address for your network card

If you want to configure Static IP address you need to edit the /etc/network/interfaces and you need to enter the following lines replace eth0 with your network interface card

sudo vi /etc/network/interfaces

# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.3.90
gateway 192.168.3.1
netmask 255.255.255.0
network 192.168.3.0
broadcast 192.168.3.255

After entering all the details you need to restart networking services using the following command

sudo /etc/init.d/networking restart

Setting up Second IP address or Virtual IP address in Ubuntu

If you are a server system administrator or normal user some time you need to assign a second ipaddress to your Ubuntu machine.For this you need to edit the /etc/network/interfaces file and you need to add the following syntax.Below one is the only example you need to change according to your ip address settings

sudo vi /etc/network/interfaces

auto eth0:1
iface eth0:1 inet static
address 192.168.1.60
netmask 255.255.255.0
network x.x.x.x
broadcast x.x.x.x
gateway x.x.x.x

You need to enter all the details like address,netmask,network,broadcast and gateways values after entering all the values save this file and you need to restart networking services in debian using the following command to take effect of our new ipaddress.

After entering all the details you need to restart networking services using the following command

sudo /etc/init.d/networking restart

Setting your ubuntu stytem hostname

Setting up your hostname upon a ubuntu installation is very straightforward. You can directly query, or set, the hostname with the hostname command.

As an user you can see your current hostname with

sudo /bin/hostname

Example

To set the hostname directly you can become root and run

sudo /bin/hostname newname

When your system boots it will automatically read the hostname from the file /etc/hostname

Setting up DNS

When it comes to DNS setup Ubuntu doesn’t differ from other distributions. You can add hostname and IP addresses to the file /etc/hosts for static lookups.

To cause your machine to consult with a particular server for name lookups you simply add their addresses to /etc/resolv.conf.

For example a machine which should perform lookups from the DNS server at IP address 192.168.3.2 would have a resolv.conf file looking like this

sudo vi /etc/resolv.conf

enter the following details

search test.com
nameserver 192.168.3.2

Configure services on Ubuntu
More useful info..

First install sysv-rc-conf if its not already installed. Then run it.
sudo apt-get update
sudo apt-get install sysv-rc-conf
sudo sysv-rc-conf


How do I install .deb file?

To install package called package.deb type the following command:
$ sudo dpkg -i package.deb


Install acroread under 64bit kubuntu

Run:
echo "deb http://packages.medibuntu.org/ gutsy free non-free" | sudo tee -a /etc/apt/sources.list

Followed by
wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add - && sudo apt-get update

Then.

gksudo aptitude install acroread acroread-plugins acroread-escript

Regarding realplayer. You can try the method below.

Download RealPlayer10 from www.real.com/linux

To install realplayer save the file to your home folder

mark the file executable:

Inside your terminal type:
chmod a+x RealPlayer10GOLD.bin
Next:
sudo ./RealPlayer10GOLD.bin
enter password

To complete the path where you want to install realplayer type:
/opt/RealPlayer

You should now begin copying files accept the default, and allow the installer to configure system wide symbolic links, If asked to specify the prefix for symbolic links just press enter.


Nvidia driver install on 64-bit Kubuntu
  1. You need to do this with kdm stopped.  It is also preferable to have a network connection although not absolutely necessary.  Either remotely ssh into the computer or press Ctl-Alt-F1 to get an alternate terminal session. Then run the following:
    tat@kintyre:$ sudo /etc/init.d/kdm stop
    
  2. Check for any existing nvidia drivers:
    tat@kintyre:$ dpkg -l | grep -i nvidia
    
    ii  nvidia-glx-new  100.14.19+2.6.22.4-14.10  NVIDIA binary XFree86 4.x/X.Org 'new' driver
    ii  nvidia-kernel-common  20051028+1ubuntu7  NVIDIA binary kernel module common files
    
  3. Remove any existing nvidia drivers:
    tat@kintyre:$ sudo apt-get remove nvidia-glx-new
    tat@kintyre:$ sudo apt-get remove nvidia-kernel-common
    
  4. Install the new nvidia drivers (assumes you downloaded the latest nvidia driver file, eg. NVIDIA-Linux-x86_64-169.12-pkg2.run to /usr/local/src/nvidia).
    tat@kintyre:$ cd /usr/local/src/nvidia
    tat@kintyre:$ sudo chmod +x NVIDIA-Linux-x86_64-169.12-pkg2.run
    tat@kintyre:$ sudo ./NVIDIA-Linux-x86_64-169.12-pkg2.run
    
    Just take all the defaults and you should be OK.  It will dynamically build the kernel modules needed. I also selected to install the 32-bit gl libraries when prompted (the default).

  5. Re-start kdm:
    tat@kintyre:$ sudo /etc/init.d/kdm start
    

gcc & build-essential sudo apt-get install gcc build-essential

Howto: Create a list of installed packages

dpkg --get-selections > installed-software
If you wanted to use the list to reinstall this software on a fresh ubuntu setup,
dpkg --set-selections < installed-software
followed by
dselect
You can find the locations of the files within a package from the list by using the dpkg -L command, such as:
dpkg -L php5-gd

Run Multiple Debian Versions Simultaneously

Happily, at the moment it's still early on in the Debian release cycle, so not too many packages are missing from, or outdated in, stable. However, it can be really useful to grab packages from upstream when needed without necessarily upgrading your whole system to testing. This is quite straightforward to do with apt, but it isn't all that well-documented.

First, add the testing sources to /etc/apt/sources.list:

deb http://ftp.us.debian.org/debian testing main non-free contrib

Run apt-get update. If you get an error message like this:

E: Dynamic MMap ran out of room edit /etc/apt/apt.conf to contain this line:
APT::Cache-Limit "10000000";
and rerun the update.

Now edit /etc/apt/preferences to include these lines:

Package: *
Pin: release a=stable
Pin-Priority: 700

Package: *
Pin: release a=testing
Pin-Priority: 650
apt-get prefers options with higher pin values, so this prioritizes stable over testing.

To install a single package from testing, use apt-get install packagename/testing. However, this doesn't grab any dependencies, so you may not be able to run the upgrade. The alternative is to use apt-get install -t testing packagename, which will try to meet the dependencies if possible.

Note, however, that sometimes it's not. For example, if the upgrade will break other packages, you may just have to make do without it!

Switch from Ubuntu to Kubuntu
After a successful install of Kubuntu its easy to revert to Ubuntu:
    
    sudo apt-get install ubuntu-desktop

When it asks what dm to use; kdm or gdm; select gdm… continue…
When done its time to remove the Kubuntu packages;

    sudo apt-get remove kubuntu-desktop kubuntu-artwork-usplash

It will remove some of the Kubuntu packages and with autoremove the
rest of the Kubuntu packages can be removed now;

    sudo apt-get autoremove

When done reboot (or restart x) and you have your Ubuntu ready for usage.
Replace Kubuntu with Xubuntu;

    sudo apt-get install xubuntu-desktop
    Select gdm as dm
    Remove Kubuntu as explained earlier

If you wish to keep the Kubuntu packages simply skip the remove step.
If you wish to revert from Ubuntu to Kubuntu ;

    sudo apt-get install kubuntu-desktop
    Select kdm as dm
    sudo apt-get remove ubuntu-desktop
    sudo apt-get autoremove

If you revert to Kubuntu make sure to select kdm as dm, all others require gdm.
Want to switch from gdm to kdm or vice versa while having both installed?

    sudo dpkg-reconfigure gdm
    and select your preferred dm
    or
    sudo dpkg-reconfigure kdm
    and select your preferred dm

Its not very hard to switch from one environment to another, and sometimes
its easier to use the cd you have laying around and switch after install.

Error re: missing firmware bin file

Problem Setup

So for example, suppose you did this:
apt-get install linux-image-2.6.29-1-686

or

dpkg -i linux-image-2.6.29-1-686_2.6.29-1_i386.deb

and you see the following warning messages:

W: Possible missing firmware /lib/firmware/e100/d102e_ucode.bin for module e100
W: Possible missing firmware /lib/firmware/e100/d101s_ucode.bin for module e100
W: Possible missing firmware /lib/firmware/e100/d101m_ucode.bin for module e100

and then you reboot your system and boot with the 2.6.29 kernel that you just installed. You will immediately notice that you have lost your Ethernet interfaces i.e. your internet/Ethernet no long works. Let’s see what is missing from our system:

# apt-get install apt-file

and synchronize the database with the following command:

# apt-file update

Note that the above command may take up to 2 or 3 minutes to complete. So be patient.

Now simply put the name of the file which are missing from the above message:

# apt-file search /lib/firmware/e100/
firmware-linux: /lib/firmware/e100/d101m_ucode.bin
firmware-linux: /lib/firmware/e100/d101s_ucode.bin
firmware-linux: /lib/firmware/e100/d102e_ucode.bin

So looks like we are missing the files that are provided the package called “firmware-linux”. You can just substitute your message of what files/firmware are missing (/lib/firmware/e100/d102e_ucode.bin) in the above command and see which package contains those files.

Solution

Reboot your system and go boot from your older kernel, which had ethernet working and do the following:

a) Add the non-free repository in your sources.list file

# nano /etc/apt/sources.list

deb http://ftp.us.debian.org/debian testing main contrib non-free
deb-src http://ftp.us.debian.org/debian testing main contrib non-free

b) Install the package “firmware-linux”

apt-get update
apt-get install firmware-linux

Now reboot your system with 2.6.29 kernel and you should see your ethernet back. Addtionally you can find the list of all the missing (non-free) firmware here.

c) If you are not able to find the linux-firmware package and mostly likely you will not if you are using Debian Lenny, you need to add the following line to your /etc/apt/sources.list file:

deb http://www.backports.org/debian lenny-backports main contrib non-free

and then again give the following commands:

apt-get update
apt-get install firmware-linux





webmaster@phas.ubc.ca [Dept. Home Page] last updated: 07/10/12