Ubuntu installation: Difference between revisions
Line 497: | Line 497: | ||
apt-cache show xxx | apt-cache show xxx | ||
; To find a package if you know a file name | ; To find a package on your system, if you know a file name | ||
dpkg -S xxx_file_name | dpkg -S xxx_file_name | ||
or | or |
Revision as of 15:19, 3 October 2009
Ubuntu
Ubuntu is a popular Linux distribution, best suited for desktop computers. It is based on Debian, therefore the packaging (*.deb) works rather well.
Disclaimers
- This page so far is by no means a configuration and installation guide, but it contains some extra information. Daniel K. Schneider decided to put some of his installation notes in this wiki, so he won't loose them.
- I am be no means a systems expert. As you can see from other entries in this wiki I deal with lots of stuff and lots of it I don't really master ...
- Feel encouraged to add stuff :)
Installation documentation
The best short guide I found (including Nvidia):
If you are looking for an other practical, short and excellent installation guide (and that includes how to add non-free software):
The Ubuntu site also has a lot of useful information (though sometimes a bit lengthy):
This wiki also has some interesting information
Ubuntu 10 8.04 LTS installation start in a nutshell
Step 1: get it
Download site
Decide what version you want. Basically there are 4 options for a desktop machine: 32 vs. 64 bit machines and normal vs. alternative distribution.
- 32 bit (most machines, also some third-party software may only run 32bits). Two sub-choices:
- ubuntu-8.04.1-desktop-i386.iso (this is your "normal" choice)
- ubuntu-8.04.1-alternate-i386.iso
- 64 bit (more expensive desktop machines)
- ubuntu-8.04.1-desktop-amd64.iso (also includes Xeon etc. processors)
- ubuntu-8.04.1-alternate-amd64.iso
Finally, there exist also vendor-packaged images that include additional goodies, e.g. graphics card drivers. E.g.
- DELL: ubuntu-8.04.1-dell-reinstall.iso
- Edubuntu: Download Edubuntu
The image you will download is an ISO ready to burn CD image (so you need a program to do this). Read burn the image.
- Memory errors and stupidness
I spent about a weekend burning various CDs (32bit normal, alternate, 64bit) because I thought first that downloaded ISO images were damaged during burning and then that my hardware couldn't handle it. Got SQUASHFS and other decompression errors.
That was a weekend lost. I simply had to replace the RAM. It was slightly defective (after all, the days before I did use my system, though I had some Firefox and Thunderbird crashes. Never occured to me to test the RAM. Bad RAM if intensively used such as in the install process will make it fail. PERIOD.
So if you insert a CD for testing and returns errors, do it again. If the file is not the same, then blame your RAM. Basically you can ignore the "burning horrors" below, unless you really have problem with downloading or burning. Just make sure to burn at relatively low speed....
- Burning horrors
It is likely that you might download a bad image (see step 3). Make sure that your image is correct with How to MD5SUM. E.g. if you download to a Unix machine, type something like:
md5sum ubuntu-8.04.1-desktop-i386.iso
This file name may change of course. The output should be a single line which you can match again the magic number, e.g.
c69e34e92d5402d1b87e6babc739f774
for the ubuntu-8.04.1-desktop-i386.iso image. These is an official list (if you don't trust your mirror).
Anyhow, if Ubuntu is happy (see also step 3) you don't need to worry about this.
Also to download, you may avoid using a browser, there exist FTP mirrors. Alternatively you can use a program like wget if you do this from a Unix machine. Copy the download link from the appropriate mirror and type e.g.
wget --no-cache http://releases.ubuntu.com/hardy/ubuntu-8.04.1-desktop-i386.iso
or (better) from a trusted mirror:
wget --no-cache http://mirror.switch.ch/ftp/mirror/ubuntu-cdimage/hardy/ubuntu-8.04.1-desktop-i386.iso
Now burning is another painful issue (see step three). I took the simple default CD version from some Ubuntu mirror and first used infra recorder on a Windows machine to burn the image (Menu Actions -> Burn Image..). Despite setting it to low burn speed it didn't work (i.e. failed the test in the Ubuntu installation). So I took another laptop and burned with Roxio. After 3 attempts (enabling all options like checking, very long file names, etc. it did seem to work at first (test passed). But during the install (some SQUASHFS error) and with a second test it failed again. So you actually may have two problems: CD is bad or the installation program (i.e. the SQUASHFS program) has a problem
Frustrating as experience. In any case set burning speed to something that is really low" (like 4 or 8), but never maximum !
If your CD seems to be ok and installation fails you first should check your RAM. Only then go for another install (e.g. download the fat DVD total Ubuntu-only reinstall DVD ISO from DELL or the alternative CD from Ubuntu.
- Finally, make sure to have an Internet number ready if you use your machine at work.
Step 2: save some stuff in your old Ubuntu install
(if you have one, else skip).
If you mount foreign file systems
- /etc/fstab
If you have a special video setup
- /etc/X11/xorg.conf
....
If you don't have your home on a different partition make a gtar archive tar zcf archiveXX.tgs directory
- save all homes (I don't keep any real data on my personal machine, but you may later retrieve some config files or navigator bookmarks.)
- You also may save /usr/local (but it's better to reinstall !)
Step 3: Format or repartition if you plan to continue using windows
- I don't want windows on this machine (erased it sometimes)
- You also may consider reformatting the hard disk (you can do this during the install process)
- If do want Windows, you may consider sharing a partition and this is a bit tricky (see docs elsewhere).
Step 4: Boot the PC with the CD and enter installation
- You may have to hit F12 or F2 (watch!) when the machine wakes up, select the CD-Rom Drive
- You then must select a language (English for example)
- You also should define your location and keyboard. Hit the F2 and F3 buttons at the bottom of the screen.
- You also should check the integrity of the CD. Bad files can be a total show stopper ! I suspect that errors can have two reasons: A bad CD (sometimes), damaged RAM, or some hardware incompatibility (bad trouble for you).
- Do not "try" Ubuntu without change unless you are afraid that Ubuntu is not compatible with your hardware. If your decision is made click on "Install Ubuntu"
... then wait a bit ... if nothing happens, it can mean that your RAM is damaged, your CD is bad or that your PC can not handle it.
Step 5: Try other versions if needed
Give up on the desktop version, if the installation fails after 2 half days or so. Take the alternative version. The interface is uglier, has less functionality, but it let's you repartition and format at early stage and make some more technical choices.
The problem is that you then have to install things more manually which is not really difficult but requires some reading...
Step 6: Make life a bit easier
In Ubuntu a desktop user can't seem to log in as root. It never asked me for a password during install. I must be root, since entering "sudo" plus a password for every command drives me crazy. The trick is simple:
sudo su
Then type:
passwd ... now you have root password :)
Alternative: Installation from the no-desktop distribution
So I finally got ubuntu-8.04.1-alternate-amd64.iso and wind up in a root terminal after boot.
Some stuff is already on the CD. First thing you want is the X11 system and a desktop. Reinsert the same CD and type the following. However I suggest taking this rather from an Ubuntu mirror (see packages)
apt-get install ubuntu-desktop /etc/init.d/gdm start
Then
startx
Then you can use the GUI to define you as user and configure the network.
Next thing is to select repositories. The easiest way is to use the "synaptic package manager" that can be found in the System->Administration menu. The click on "Settings->Repositories" and select either the fastest or one you trust. In the same software sources panel, you also may tick most checkboxes. Alternatively, edit the configuration file in /etc/apt.
Then you have to upgrade. That also was quite a nightmare, since apparently my (now that new) hardware was not fully compatible....
One thing that seems to be needed if you have the server version is:
apt-get install linux-restricted-modules-server
Ubuntu upgrades
8.04 to 8.10 to 9.4
Went fine, except for the video card settings. I just ignored this problem and then directly went to the next 9.4 upgrade.
The only problem I had was that all panels were moved to the left screen, and all widgets were found in a single panel (result of the 8.10 upgrade).
By default, Ubuntu update manager (or Synaptic Package Manager) does not suggest upgrades from "long term versions" like Ubuntu 8.04 "Hardy" LTS to versions like Ubuntu 8.10. You can change this behavior by configuring the update manager, e.g. with menu System->Administration->Update Manager.
Hash Sum mismatch issues
- If something like GPG error: http://mirror.switch.ch hardy-updates Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com> happens, you might change the server. Either,
- Edit /etc/apt/sources.list
- Or change with menu System->Administration->Software sources
NFS
- Installing mnt and mount points
It's a bad idea to keep your files on your personal PC. Since we have sun servers with daily backup I just mount partitions via NFS. This may not be included.
apt-get install nfs-common
mkdir /mnt/YYY
then edit /etc/fstab and enter line(s) like this
XXX.unige.ch:/export/home /mnt/YYY nfs defaults 0 0
Then mount these
mount -a
- Changing your user id
- If you installed from the standard distribution, your user is is not compatible with the one you have on an other machine, so you have to change it. You can use the user management tool in the System menu (click on "unlock").
- Create a new group first and use the gid from your server (type id- a on the server machine)
- To change your user id is more tricky, can't do this while you are in the desktop. An easy method is to use the usermod tool (after logging out from the GUI !!), e.g.to change user dks to uid=6000
usermod -u 6001 dks
or if you want to change the uid too:
usermod -g 6000 -u 6001 dks
Displays
Principles
Most Linux distribution's installer (at least the free ones) can't handle some slightly more fancy hardware automatically
Usually you have to do two things
- Configure the drivers from the ubuntu desktop (if your are lucky)
- Hand edit the /etc/X11/xorg.conf file to tweak things.
- Also read Ubuntu Twinview Monitors with an NVidia Graphics Card (T. Fitzgerald/3/2007)
- Remember to save every version (preferably on an other machine or in a wiki) that worked.
Example Nvidia Quadro FX + 2 digital monitors
By Daniel K. Schneider. I have a Quadro FX 3450 card, a 24 and a 20 monitors. This is an executive summary. Find better explanation on Google or in the
- The easy way (Ubuntu 8.01 Hardy)
If you have a GUI running (the default Ubuntu desktop)
- Menu System->Administration->Hardware drivers
- Enable the driver (this will download the nvidia-glx-new package
- Reboot
Then:
- Menu: System->Preferences
- Screen resolution (works with a 1920x1200 screen)
Then add your second monitor if you got one:
- Read Nvidia Multi Monitors first
- Install the nvidia settings tool, in a terminal type this (or get via the synaptic)
sudo apt-get nvidia-settings
Then use this tool to configure
- Menu System->Administration->Nvidia X Server settings
I do not want the default twin view, i.e. I want to be able to switch to a different workspace in one screen and keep the current one. So I went for two different screens
- XServer Display Configuration:
- Click on 'configure... and select twin view
- Than play with the options until it looks good
Hit apply and if required CTRL-ALT BACKSPACE to restart the XServer.
- I noticed that at some point it couldn't overwrite the /etc/X11/xorg.conf file. Look at the preview and then copy paste , i.e. open an editor under root :)
Anyhow this is a start, but some manual tweaking seems to be necessary
Warning:
- this tool will append to the current xorg file by default. I.e. you may several conflicting definitions if you don't watch out.
- On the other hand if you don't append, your keyboard definition is gone, i.e. you have to know how to type US style. Make backups !!
- If you can't login after a XServer restart, you simply may have a US
keyboard. Don't panic.
See below for tweaking and repairing ...
- The hard way
Depending on the day (if it's rainy or sunny or the particular Ubuntu version) installing an Nvidia driver can be an absolute nightmare. If things fail, it is probably a good idea to:
- Make a copy of your /etc/X11/xorg.conf file
- Remove everything that has to do with Nvidia
- E.g. even drastic and dangerous apt-get remove nvidia*
- it also can mean to remove manually files and other stuff (see various forums)
- Also the machine needs to completely halted at some point and be restarted in recovery mode (Hit ESC when linux starts loading)
- Make sure you can get a terminal (local or remote)
- Make sure you have another machine nearby, e.g. Windows with a putty (ssh client) installed.
- Hit ctrl-alt-F5 to enter a terminal mode or see above.
- Avoid removing power (reset) ... this can damage files, try ctrl-alt-delete first (or a halt from a remote terminal)
- Log files
- Look at the log files, in particular /var/log/Xorg.0.log and search for "(EE)".
- It's likely that your keyboard won't work. E.g. if you use special characters in your password you must know the layout of the US keyboard. That can be fixed again in the xorg.conf file.
- X also remembers stuff in your personal home directory and there are logs too.
Anyhow, if by miracle, things go well, here is the rough procedure:
(0) Make sure you got a nvidia card, type:
lspci | grep -i nvidia
(1) You need to download the Nvidia driver.
- Either from Nvidia. E.g. file NVIDIA-Linux-x86-1.0-9755-pkg1.run
- Or via apt (a package manager), this is the better solution if it works:
sudo apt-get install nvidia-glx-new
.. or maybe nvidia-glx (the older version)
(2) Save the xorg.conf file
cp /etc/X11/xorg.conf /etc/X11/xorg.conf.save1
(3 - manual install) Install the driver (in case you got it from Nvidia only. This is not recommended !)
sh NVIDIA-Linux-x86-1.0-9755-pkg1.run
(4) Run the X server configurator (but make sure you have a copy of your old xorg.conf file !!) nvidia-xconfig
There exist options which are described in the man page. Type
man nvidia-xconfig
(5) The result won't do it, but it's a start. You have to hand-edit and merge information from the old xorg.conf.save1 file !!!
You also can try to install the nvidia graphics control panel
apt-get install nvidia-settings
and run the config. utility (on the desktop as described above !)
gksu nvidia-settings
A particular nasty bug in older installation scripts (not Ubuntu 8.01 Hardy) is the name of the driver. If you use the ubuntu distribution, the driver's name may be "nv" and not nvidia. Remember this when your system wants to boot into low resolution mode.
- A working configuration
Here is a configuration that works with my Graphics card and two monitors: A Dell Precision 380 with a Quadro FX 3450 card, and two DELL monitors: a 24 (1920x1200) and a 20 (1600x1200).
# nvidia-xconfig: X configuration file generated by nvidia-xconfig # nvidia-xconfig: version 1.0 (buildmeister@builder57) Thu Jul 17 18:39:19 PDT 2008 Section "ServerLayout" Identifier "Layout0" Screen 0 "Screen0" 0 0 InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "CorePointer" EndSection Section "Files" RgbPath "/usr/X11R6/lib/X11/rgb" EndSection Section "Module" Load "dbe" Load "extmod" Load "freetype" Load "glx" EndSection Section "InputDevice" # generated from default Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/psaux" Option "Emulate3Buttons" "no" Option "ZAxisMapping" "4 5" EndSection Section "InputDevice" # generated from default Identifier "Keyboard0" Driver "kbd" Option "XkbModel" "pc105" Option "XkbLayout" "ch" Option "XkbVariant" "fr" EndSection Section "Monitor" Identifier "Monitor0" VendorName "Unknown" ModelName "Unknown" HorizSync 30.0 - 110.0 VertRefresh 50.0 - 150.0 Option "DPMS" EndSection Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" EndSection Section "Screen" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 Option "TwinView" "True" Option "MetaModes" "nvidia-auto-select, nvidia-auto-select" SubSection "Display" Depth 24 EndSubSection EndSection
Make sure that there are no syntax errors, and that you have and empty line at the end of this file.
- Fine tuning the desktop
- Put a panel on top of each screen (right click on the one panel you have and make a "new")
- Right-click, select properties to define position (top,bottom, left right)
- Do not use "Visual effects" (System->Preferences) or get sea sick !
- Add more stuff to the panels ... and you are back to work :)
If you have dual monitor system like the one described above:
- Right-click on an existing panel to add a new one
- Right-click on the new panel, select properties and untick "Expand"
- Then move the panel to the other screen, and tick "Expand again"
Each panel widget can be move to another panel (right-click->move). Then move it to the new panel.
Hot keys for the brave
So your GUI is stuck ....
To open a console terminal (no GUI):
CTRL-ALT F1 ... same for F2 to F6 (so you can have 6 different terminals)
To go back to the desktop:
CTRL-ALT F7
To see boot system messages
CTRL-ALT F8
To restart the X server (your GUI)
CTRL-ALT BACKSPACE
Packages
Basically, an end-user can do most of this stuff with a GUI tool, i.e. the synaptic package administrator. However it is good to know a few command line things for 2 reasons:
- You may have damaged your desktop when trying to install a new video driver
- It's sometimes faster. In particular when you see on some website that this and this package should be installed in this and that order ...
A list of command-line stuff (you must be root or add "sudo" in front of each). Sometimes there are equivalent commands for abt-get and aptitude. See the apt howto at Debian.
Installing packages from a package archive
- To fix the ubuntu archive mirrors
(if you can, you can also do this from the desktop package manager) Edit /etc/apt/sources.list
You should at least have:
deb http://archive.ubuntu.com/ubuntu/ hardy main universe multiverse restricted deb http://archive.ubuntu.com/ubuntu/ hardy-updates main universe multiverse restricted
... but the it's better to use a nearby mirror, e.g. for Switzerland:
deb http://mirror.switch.ch/ftp/mirror/ubuntu/ (... same for the rest ...)
To check if there are any partially installed packages. It will try to complete these installations.
dpkg --configure -a
To find a package XXX
aptitude search XXX
- Cleaning and such
To detect and fix dependency problems
aptitude -f install
To remove packages from the local cache
apt-get clean
To update the package list
aptitude update
To reinstall a package XXX that seems to be broken
apt-get --reinstall install XXX
- Upgrading
To upgrade conservatively
aptitude safe-upgrade
To upgrade with a an message showing packages
apt-get -u upgrade
To upgrade to a new release
apt-get -u dist-upgrade
- Removing
To really remove package XXXX
apt-get --purge remove XXXX
If a package doesn't want to go (e.g. something went wrong during install, e.g. a decompression error and a crash in the middle of the install) and an installer (or you) wants it go, look for the package in /var/lib/dpkg/status and make it install ok installed Followed by:
apt-get remove --purge XXXX apt-get update apt-get dist-upgrade (or whatever you planned to install)
Installing deb files
Sometimes, software is distributed as package for download, i.e. a *.deb file
To install it:
dpkg -i XXX.deb
If you run into dependency error messages you'll have to add packages (no problem) or remove packages (avoid !).
Example (for the eXe eLearning authoring system):
dpkg -i python2.5-exe_1.04.0.3532-ubuntu1_i386.deb
will give:
Unpacking python2.5-exe (from python2.5-exe_1.04.0.3532-ubuntu1_i386.deb) ... dpkg: dependency problems prevent configuration of python2.5-exe: python2.5-exe depends on python-zopeinterface (>= 3.0.0-6); however: Package python-zopeinterface is not installed. dpkg: error processing python2.5-exe (--install): dependency problems - leaving unconfigured
First thing to do is to try something like:
apt-get install python-zopeinterface
Information about packages
xxx is the package name
- Getting information about a package
apt-cache search xxx
apt-cache showpkg xxx
apt-cache show xxx
- To find a package on your system, if you know a file name
dpkg -S xxx_file_name
or
apt-file search filename
- To list all packages and search for a name.
dpkg -l | grep xxx
Printers
Printers don't necessarily work automatically either:
A good bet is to use this application:
Before you do so, it is like that you need a a PPD file (a file that defines properties of your postscript printer). Get it from:
Example Infotec
Example for Infotec ISC 1032 (A low end color copy and printer machine)
- Look at the entry:
- Get the PPD file (and copy it anywhere) ** http://openprinting.org/foomatic-db/db/source/PPD/Infotec/PS/Infotec-ISC1032_PS.ppd
- Then, start http://localhost:631/admin in your browser and when asked upload the PPD file
- Finally configure the printer (e.g. define paper size, trays and stuff).
- If CUPs printing doesn't work, use "HP JeDirect" and port 9100.
X Windows
We run a few sun servers and I prefer to run emacs (GUI) on a remote machine instead of mounting all these file systems. Also I prefer to have a root terminal open instead of typing 'sudo' all the time. If you want allow for this:
- Reconfigure the window manager (gdm)
- Edit /etc/gdm/gdm.conf and change:
DisallowTCP=true
- Then, you'll need to restart your X session (Ctrl + Alt + Backspace)
- Allow remote hosts to connect
- Then you can allow certain hosts to connect e.g. to allow root on your own machine type
xhost + localhost
- To allow somebody on a different machine, type:
xhost + xxx.yyy.zzz
- It's important not to to type 'xhost +'. Since anyone may then connect to your screen. However, type xhost + something is boring, so it's more practical to edit /etc/X0.hosts. Just put the names or IP numbers of authorized machines there.
- If it doesn't work
You can install nmap to scan ports (X is on 6000).
- If you don't have nmap:
sudo apt-get install nmap
p* Then type (as user):
nmap -v -A localhost
In some cases you may have to define the display of your machine on your client machine. On your client machine type something like:
export DISPLAY=xxx.yyy.zzz:0
or
setenv DISPLAY xxx.yyy.zzz:0
Or more practical, log into the the client machine like this:
ssh -XY
Java
By default Ubuntu comes with some Java 1.4 compatible version that is free. For some applications though, you need Java 5 or 6 from Sun
- Read this: https://help.ubuntu.com/community/Java
- Summary: You can get Sun Java as Ubuntu package, if you have multiverse enabled.
- You also then should consider making the Sun version the default (also explained in the above doc).
Sound
Sound may not work either.
- Install all the ALSA stuff (e.g. via the synaptic package manager)
- Then test with Menu System->Preferences-Sound
- Then set the right default volume with Menu Applications->Sound and Video->ALSA Mixer GUID (in particular PCM ! It may be as simple as that ...)
Sound trouble ?
If sound doesn't work search the Ubuntu forums: http://ubuntuforums.org/. A particular good overview posting was:
To list you sound hardware, type:
aplay -l
If there are none, type:
lspci -v
... and search through the list until you find something like:
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)
This means that you do have a sound card, but that the drivers or something else is missing....
Anyhow it may take some time (between a few minutes and a few days) to find a solution. Often, the only thing you'd have to do is to add a line to /etc/modprobe.d/alsa-base (needs root permissions). I have for my DELL/Sigmatel:
options snd-hda-intel model=ref
Then, reboot !
Note: To list all drivers on your machine, type:
lsmod
If I understand right, drivers are kernel modules.
Non-standard software
Some organization maintain their own Debian/Ubuntu package servers.
Mediabuntu
Read this:
Skype
E.g. to install Skype, you could
- Add the Skype repository like this in the Synaptic Package Manager (through settings->Repositories->Third-Party Software)
deb http://download.skype.com/linux/repos/debian/ stable non-free
- Reload or update the package information and search for "skype"
- Install the skype package.
Opinions
Add yours ...
DKS
- Daniel K. Schneider uses Ubuntu since March 2007, because he got fed up with Mandriva updates not working correctly. I hate all OS's (Unix, Mac, Win) but prefer to work on Unix because it's fairly stable and appropriate for what I do. I also do have Windows machines (a Dell XP II and Acer tablet PC) for doing stuff that needs Win. (E.g. wordprocessing with Framemaker, X3D, Games). Our servers (e.g. for this wiki) run under Solaris. More difficult to install, but reliable on the other hand.
- Indeed (it's now August 2007 and I went through a major upgrade) I find that Ubuntu and its packaging system is far more robust. Though I once failed with a non supported package, i.e. Cinelerra that I got from another site. It installed, but crashed on start. Have to try again at some point.
- If your applications crash (e.g. Firefox) check your bloody RAM. It may be defective and you can loose 3 days of work trying
to reinstall when there is absolutly no need. Ubuntu is solid !
- Other remarks: The official Ubunto Gnu Emacs installation is the "Leim" version, i.e. it can be used to edit UTF-8 text (I am writing my wiki entries with this).
Links
(there are many others)
- Official
- http://www.ubuntu.com/ (home page)
- https://help.ubuntu.com/ (help pages)
- http://ubuntuforums.org/
- Other