/srv/irclogs.ubuntu.com/2009/06/05/#ubuntu-classroom.txt

WastePo1atoHi.00:16
bodhizazenwe shall be compiling today :)00:48
bodhizazenso let's review how to connect to the shared ssh session shall we ?00:48
bodhizazenhttp://paste.ubuntu.com/188659/00:48
bodhizazencan people try to connect and let me know if there are problems ?00:48
bodhizazenplease note: the server has changed00:49
bodhizazenit is ssh.bodhizazen.net00:49
bodhizazenwb swoody00:53
swoodyty bodhizazen :)00:53
swoodylogging a lot, trying to get FreeBSD to boot :(00:54
bodhizazenFreeBSD, now that's hard core, lol00:55
swoodyhaha00:55
bodhizazen5 minute warning :)00:57
bodhizazennot many on the ssh session , LOL00:58
bodhizazenhttp://paste.ubuntu.com/188659/00:58
* jgoguen is there \o/00:59
bodhizazen>:)00:59
bodhizazenanyone needing assistance connecting ?01:00
bodhizazenare we ready to start then ?01:03
TuxPurpleyes :)01:03
jgoguenyup01:03
bodhizazenThis session is in follow up to the last when we discussed installing packages01:03
bodhizazenI will review installing from source today with a few tips01:04
bodhizazenFirst, advantages / disadvantages of installing from source ?01:04
bodhizazenadvantage - newer package possibly with bug fixes01:04
bodhizazendisadvantage - you will need to install dependencies manually01:05
bodhizazenyou will have to update manually01:05
bodhizazenand you may break things, lol01:05
jimi_hendrixbodhizazen, thats always amusing though :)01:05
bodhizazenLet's start with a review of the most basic package installation01:05
bodhizazenyou need to install a few tools01:06
bodhizazenapt-get install build-essential01:06
bodhizazen;)01:06
bodhizazenthen to install a package it is simple01:06
bodhizazendownload the source code01:06
bodhizazenextract the archive01:06
bodhizazencd into archive01:06
bodhizazen./configure01:06
bodhizazenmake01:06
bodhizazenmake install01:07
bodhizazensudo make install , sorry01:07
bodhizazennow lets go through that in some more detail01:07
bodhizazen1. download the source code01:07
bodhizazenlets look at dillo01:08
bodhizazenhttp://www.dillo.org/01:08
Kasm279so i heard the class is on compiling drivers today?01:08
bodhizazenyep01:08
bodhizazenfrom the home page, go to dl page01:09
bodhizazenhttp://www.dillo.org/download.html01:09
bodhizazenALWAYS LOOK ON THE PROJECT HOME PAGE FOR INFORMATIO01:09
bodhizazenincluding bugs, fixes, and dependencies01:09
jimi_hendrixbodhizazen, you may want to check the README too...01:10
bodhizazenwe are not there yet jimi_hendrix , patience01:10
bodhizazenwget http://www.dillo.org/download/dillo-0.8.5.tar.bz201:10
jimi_hendrixyes master01:10
Kasm279so, watsup right now?01:10
bodhizazennow most source code is actually c01:11
bodhizazenand needs to be compiled01:11
bodhizazensome applications are python or distributed as binaries01:11
Kasm279what about shell scripts?01:11
bodhizazensome is like nvidia, sorry excuses for linux programming run as an install script :)01:11
bodhizazenvmare is that way too01:11
bodhizazenback to dillo01:12
bodhizazenKasm279: the install scripts are the same, you still need to install teh dependencies01:12
Kasm279k01:12
bodhizazenunpack the archive, usually a tar.gz , sometimes a zip or other archive01:12
bodhizazentar -xzvf dillo*01:13
bodhizazenthis will make a dillo-0.8.5 driectory01:13
bodhizazenI personally keep these archives in ~/src01:13
bodhizazenmkdir -p ~src/dillo01:13
bodhizazenmv dillo-0.8.5 ~/src/dillo01:14
bodhizazennow lets look at the archive01:14
bodhizazencd ~/src/dillo/dillo-0.8.501:14
bodhizazenNow you may keep your archive anywhere, just so long as you cd into it :)01:15
Kasm279im wondering, what is dillo?01:15
bodhizazenin the archive there is almost always a README01:15
bodhizazenread the README now :)01:15
bodhizazenKasm279: http://www.dillo.org/01:15
bodhizazenjust an example01:15
bodhizazenThe most common reason installation fails is what ?01:16
bodhizazenanyone want to guess at that ?01:16
bodhizazenfailure to install the dependencies !!!!!!01:16
bodhizazenyou will get part way through the compile and it will fail with a cryptic message, this is almost always a problem with dependencies01:17
bodhizazendependenceies come in 2 flavors01:17
bodhizazen-dev and lib01:17
bodhizazenc uses headers01:17
bodhizazenthe headers are not in the ubuntu package01:18
bodhizazenthey are in the 8-dev01:18
bodhizazenso while your application may list foo as a dependency01:18
bodhizazenyou can not simple01:18
bodhizazenapt-get install foo01:18
bodhizazenyou almost always need01:18
bodhizazenapt-get install foo-dev01:19
bodhizazensometimes foo is provided as a shard library01:19
bodhizazenie libfoo01:19
bodhizazenin which case01:19
bodhizazenapt-get install libfoo01:19
bodhizazenwhen finding dependencies google is your friend01:19
bodhizazenas is searching for packages01:20
bodhizazenWant a trick ?01:20
bodhizazenuse apt-get01:20
bodhizazensudo apt-get build-dep bar01:20
bodhizazenwill download and install the dependencies for bar, including foo01:20
bodhizazen>:)01:20
bodhizazenOK, we are now done with dependencies01:21
bodhizazennow let us compile and install01:21
bodhizazenfirst configure01:21
bodhizazenb4 you configure use01:21
bodhizazen./configure --help01:21
bodhizazenthis will list the options01:21
bodhizazenyou almost ALWAYS want one option01:21
bodhizazen--prefix/usr/local01:22
bodhizazenthis installs teh application into /usr/local01:22
bodhizazenso01:22
bodhizazen /usr/lcoal/bin01:22
bodhizazenrather then /bin01:22
bodhizazenthis will significantly reduce breakage01:22
bodhizazenif you do not use this , you will create conflicts with apt-get01:23
bodhizazenor apt-get will over write libs etc01:23
bodhizazenor you will break apt-get (dpkg)01:23
bodhizazenso01:23
bodhizazen./configure --prefix=/usr/local --with-option2 --enable-foo01:24
bodhizazennext make01:24
bodhizazenmake01:24
bodhizazenthat will compile the app01:24
bodhizazenthen01:24
bodhizazensudo make install01:24
bodhizazento remove01:24
bodhizazensudo make uninstall01:24
bodhizazenif you are luck01:24
bodhizazenotherwise01:24
bodhizazenlocate bar01:24
bodhizazenand rm -rf all instances of bar . lol01:25
bodhizazento run app01:25
bodhizazen /usr/local/bar01:25
bodhizazenYou can use apt-get to build from source01:25
bodhizazenenable the deb-src repo01:25
bodhizazenthen01:25
bodhizazenapt-get source foo01:26
bodhizazenthen01:26
bodhizazensudo apt-get install dpkg-dev fakeroot01:26
bodhizazencd foo-0.1.001:27
bodhizazendpkg-dev fakeroot01:27
bodhizazendpkg-buildpackage -rfakeroot -uc -b01:27
bodhizazenwant to see some examples ?01:27
bodhizazenI have a shared session and we can compile a simple application01:27
bodhizazeneveryone on the ssh session ?01:28
bodhizazenanyone need help ?01:28
bodhizazenOK, to make things faster I already downloaded the porgram hello01:28
bodhizazenyou can see the tar ball in ~/src/hello01:29
bodhizazenlets extract01:29
bodhizazennow we have hello-2.401:29
bodhizazenso ..01:29
bodhizazenit says to see INSTALL for directions01:30
bodhizazenlets do it :)01:30
bodhizazenit is checking for dependencies and system configuration01:31
bodhizazennow it is ready01:31
bodhizazenit is making (compiling)01:31
bodhizazendone01:31
bodhizazennow insatall01:31
bodhizazenshall we test it ?01:32
bodhizazenOOPS01:32
bodhizazendo not forget to use sudo, lol01:33
bodhizazenand you can see it works :)01:33
bodhizazennow lets remove it01:33
bodhizazennow it is gone01:33
bodhizazenlets compile from the ubuntu repos :)01:34
bodhizazenThe application in the repos is called hello-debhelper01:34
bodhizazenapt-get source has retrieved the package01:34
bodhizazenno dependencies ....01:35
bodhizazenbuilding with dpkg-buildpackage -rfakeroot -uc -b01:35
bodhizazenfakeroot means we can build without being root01:36
bodhizazennow it builds a .deb in one directory higher01:36
bodhizazensee it ?01:36
bodhizazenhello-debhelper_2.2-3_amd64.deb01:36
bodhizazennow lets install01:36
bodhizazensudo dpkg -i hello-debhelper_2.2-3_amd64.deb01:37
bodhizazenand run ...01:37
bodhizazensee how dpkg put it in /usr/bin ?01:37
bodhizazenthis is why we used --prefix=/usr/local >:)01:38
bodhizazenremove ?01:38
bodhizazenall gone now :)01:38
bodhizazenWhere to do for additional information ?01:38
bodhizazenhttp://www.debian.org/doc/manuals/apt-howto/ch-sourcehandling.en.html01:39
bodhizazenhttps://wiki.ubuntu.com/PackagingGuide01:39
bodhizazenhttps://wiki.ubuntu.com/PackagingGuide/Complete01:39
bodhizazenhttps://wiki.ubuntu.com/PbuilderHowto01:39
bodhizazenQuestions ?01:39
bodhizazenKasm279 you were asking about install scripts and what not ?01:40
bodhizazenthese are usually nvidia, ati, or vmware01:40
bodhizazenthe general process is the same01:40
bodhizazenfirst install the dependencies01:40
bodhizazenthen download the install script01:41
bodhizazenread the README01:41
bodhizazenif there is one01:41
bodhizazen./install.sh --help01:41
bodhizazenif there is any01:41
bodhizazenthen01:41
bodhizazenchmod a+x ./install.sh01:41
bodhizazensudo ./install.sh01:41
bodhizazenthe install scripts will typically download and install the source code01:42
bodhizazennothing like compiling from source to silence a room, lol01:43
bodhizazenquestions ?01:43
bodhizazenso now you are all experts on compiling from source then :)01:44
bodhizazenwant to see apparmor in action ?01:44
bodhizazenBOO !!!01:45
mzzno need to shout01:46
bodhizazenOK, well I will hang for a few minutes then to see if there are any additional questions :)01:46
mzz(also, can I scroll up a shared screen session the usual way or does that disrupt what others see?)01:46
bodhizazenjust checking mzz :)01:46
bodhizazenyes mzz01:46
bodhizazenyou mau scroll at will01:47
mzzdrat, "copy: permission denied (guest)"01:47
bodhizazenLOL01:47
* mzz must be doing it wrong01:47
bodhizazendo you want me to past bin something01:47
mzznah, don't bother01:47
bodhizazenwhat client are you using ?01:47
jgoguenmine's better: stuff: permission denied (user guest)01:47
mzzoh, I use urxvt but I have its history disabled, because I normally use screen's (urxvt's doesn't really work if you're in a split screen session)01:48
bodhizazendam security01:48
bodhizazenpost a command here and I will run it01:48
bodhizazenthis session is logged01:48
bodhizazenand if you wish I can pastebin output01:48
bodhizazenw/ pastebin everyone can see01:49
mzznah, it's ok, I'll just read the actual documentation later01:49
bodhizazenmzz: well, this is what I am here for now, demo and questions01:49
bodhizazenso we have 10 min, ask away01:49
mzzcompiling stuff is easy, I'm only paying attention to the packaging-related bits01:50
bodhizazenAh01:50
bodhizazenpackaging for ubuntu is a bit more comples01:50
bodhizazenthe MOTU are giving session on packaging01:50
bodhizazenwe are building a moodle session to teach such things01:51
mzzsince nobody is saying much I'll share a slightly fakeroot-related story: be careful what you name the package you created here, because if a package with that name already exists you'll replace it01:51
mzzI accidentally created a package called "udev" at one point, and almost didn't realise what I had just done before rebooting, which would have been bad.01:52
bodhizazenLOL01:53
bodhizazenI was asking the same question - how to name a package01:53
bodhizazenhttps://help.launchpad.net/Packaging/PPA01:53
bodhizazenspecifically : https://help.launchpad.net/Packaging/PPA#Versioning01:53
bodhizazenAny requests for future sessions ?01:54
bodhizazenanyone want to tell us what I broke ?01:54
mzzwell, gnu hello had better be a well-behaved package with a working "make uninstall", but that may not always be the case01:55
bodhizazenmzz: I can show yo uapparmor if you want01:55
bodhizazenyes, you need to take great care in that01:56
bodhizazenthe good new is ...01:56
bodhizazenusually you can manually remove stuff01:56
mzz(I tend to install as "me" with --prefix pointing into my homedir to reduce the chance of catastrophic accidents)01:56
jgoguenhehe01:56
bodhizazenthat works01:57
bodhizazen /usr/local is if you want to share01:57
mzzthat doesn't always works, but if it does you can easily get rid of the package01:57
bodhizazenI always keep the source code to any installed package01:57
mzzoh, that's another point: "make uninstall" needs a configured source tree to run from, so you have to keep that around or recreate it (rerunning configure with the same args)01:58
mzzso be careful, use fakeroot or the like if at all possible01:58
mzztry with /usr if you dare :)01:59
bodhizazennaw, /usr is not so good02:00
bodhizazen~/bin02:00
mzzI meant your rm -rf02:00
bodhizazenadd ~/bin and /usr/local/bin to $PATH02:00
bodhizazenno, it will remove /usr02:00
mzzoh, ok, don't do that then :)02:00
bodhizazenit will also kill rm -rf /*02:01
bodhizazensee ?02:01
mzzerr, no02:01
mzz(the "*" is expanded by the shell, so if rm -rf /* is safe so is rm -rf /usr, right?)02:02
bodhizazenwell the only reason the system is still running is apparmor, lol02:02
bodhizazenno02:02
bodhizazenrm -rf /* will rmove everything by /02:02
bodhizazen*but*02:02
bodhizazenOK, thanks everyone02:04
bodhizazenI think the next planned session is next week02:04
bodhizazentopic ?02:04
bodhizazenor shall I choose ?02:04
mzzgo for it02:05
bodhizazenkthxbi02:07
=== MaWaLe is now known as Wajih
=== Wajih is now known as UBot-tn
=== UBot-tn is now known as MaWaLe
=== MaWaLe is now known as UBot-tn
=== UBot-tn is now known as MaWaLe
=== statik` is now known as statik
=== agateau_ is now known as agateau
=== yofel_ is now known as yofel
=== kklimonda_ is now known as kklimonda
=== MaWaLe is now known as UBot-tn
=== UBot-tn is now known as MaWaLe

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!