Ubuntu

From Hackepedia
Revision as of 19:20, 4 July 2010 by Franks (talk | contribs)
Jump to navigationJump to search

I was trying to compile hello world in C:

$ gcc -Wall -o hello hello.c 
hello.c:1:19: error: stdio.h: No such file or directory
hello.c: In function ‘main’:
hello.c:5: warning: implicit declaration of function ‘printf’
hello.c:5: warning: incompatible implicit declaration of built-in function ‘printf’

If you plan on doing any programming on ubuntu:

$ sudo apt-get install build-essential

This will install libc-dev, gcc, g++, make and dpkg-dev for C and/or C++ programming. If you intend on programming, you will probably want the development man pages installed. For example, I couldn't find the simple functions:

$ man scanf
No manual entry for scanf
$ sudo apt-get install manpages-dev


Sound

$ aplay -l

If it lists your card, awesome. Instead, mine showed:

 aplay: device_list:205: no soundcards found...

so on to the next step:

$ lspci -v 

Hopefully you see an Audio device: entry. In my case I saw:

00:10.1 Audio device: nVidia Corporation MCP51 High Definition Audio (rev a2)

Subsystem: Dell Unknown device 01f4 Flags: bus master, 66MHz, fast devsel, latency 0, IRQ 11 Memory at fe024000 (32-bit, non-prefetchable) [size=16K]

So I just need the proper module installed:

$ sudo apt-get install linux-ubuntu-modules-2.6.22-14-386

Replace 2.6.22 with the kernel you are using.

$ modprobe snd-hda-intel

Replace snd-hda-intel with the driver for your sound card.

My sound now works!

Note: I'd love an easy way to see what is using your sound driver and release it when necessary

Nvidia

If you're using an nvidia graphics card, you're probably forced to use the proprietary nvidia drivers. If you do "apt-get dist-upgrade" and your kernel gets upgraded, you will find when you reboot you are stuck running VESA instead of the nvidia drivers. You have to rerun the nvidia installer to build the necessary modules for your kernel.


CD-ROM

If pushing the physical button and "sudo eject" isn't working, try

$ eject -rv
$ eject -sv

10.04 with VirtualBox

If you upgrade to 10.04, you may find the screen stays blank or the computer freezes. This maybe be resolved by added the # to the following line in /etc/fstab while in recovery mode:

#none /proc/bus/usb usbfs devgid=123,devmode=664 0 0

reboot.

Cleaning up old files

$ dpkg --list |grep "^rc"

If you're comfortable cleaning these files out:

$ dpkg --list |grep "^rc" | cut -d " " -f 3 | xargs sudo dpkg --purge

Setting default browser

 $ sudo update-alternatives --config x-www-browser