Dev Week -- Getting set up for Ubuntu development -- dholbach -- Tue, Jan 31st, 2012
1 [16:01] <dholbach> alright my friends 2 [16:01] <dholbach> welcome back to session 2 at UDW 3 [16:01] <dholbach> for those of you who just joined: please make sure you also join #ubuntu-classroom-chat so you can ask questions there 4 [16:01] <dholbach> also make sure you prefix them with QUESTIONS:, ie: 5 [16:01] <dholbach> QUESTION: What kind of music do you like? 6 [16:02] <dholbach> This session will be about getting your development environment set up. 7 [16:02] <dholbach> but let's first clear out our queue of questions from the last session 8 [16:02] <dholbach> ok, it seems ClassBot forgot the questions - let me get them from the backlog - one sec 9 [16:03] <dholbach> <UbuntuFlo> QUESTION: â€‹â€†dholbach: what version of ubuntu are you working with (private/job)? are you always using the actual development-version? 10 [16:03] <dholbach> UbuntuFlo, I usually upgrade to the development version early on. 11 [16:03] <dholbach> Incidentally we have a session this week about how you can easily install the dev version without having to break your current system - so stay tuned for that :) 12 [16:03] <dholbach> <Aj2012> QUESTION: Ubuntu ships with few default set of libraries. Where can I find the recommendation about them? I feel that if my application rely more those, then ultimately it would result in fewer dependency and less more packages to download while installing my app. 13 [16:04] <dholbach> Aj2012, we will have a session later today with an Ubuntu Technology overview which should answer a lot of this question already 14 [16:04] <dholbach> additionally I could suggest to check out developer.ubuntu.com with documentation about libraries you can most easily use 15 [16:05] <dholbach> <alco> QUESTION: what's the best way of requesting a mentor? I tried firstname.lastname@example.org but didn't get a reply 16 [16:05] <dholbach> alco, unfortunately our mentoring team is defunct at the moment - we got more requests in than we could handle 17 [16:05] <dholbach> that's the bad news 18 [16:05] <dholbach> the good news is: we have better documentation than ever (links later on) 19 [16:05] <dholbach> AND: 20 [16:05] <dholbach> you can join #ubuntu-motu where we have lots of very helpful people who can get you started 21 [16:06] <dholbach> <kanliot> QUESTION: anything wrong with using netbeans? 22 [16:06] <dholbach> kanliot, nothing wrong at all - the Java bits might require some specific packaging and the user to install Java libraries afterwards (if you want to package your Java application) 23 [16:06] <dholbach> but if Java is what you are comfortable with: use it :) 24 [16:07] <dholbach> Ok, I hope I got all questions in the queue, so let's get cracking getting our development environment set up. 25 [16:08] <ClassBot> Ceno asked: Where can I read a log of the 3 o'clock session? 26 [16:08] <dholbach> Ceno, we will put up the logs later on at https://wiki.ubuntu.com/UbuntuDeveloperWeek 27 [16:08] <dholbach> if you need them earlier, check out irclogs.ubuntu.com 28 [16:08] <dholbach> There are a number of things you need to do to get started developing for Ubuntu. This article is designed to get your computer set up so that you can start working with packages, and upload your packages to Ubuntuâ€™s hosting platform, Launchpad. 29 [16:08] <dholbach> Hereâ€™s what weâ€™ll cover: 30 [16:08] <dholbach> - Installing packaging-related software. This includes: 31 [16:09] <dholbach> - Ubuntu-specific packaging utilities 32 [16:09] <dholbach> - Encryption software so your work can be verified as being done by you 33 [16:09] <dholbach> - Additional encryption software so you can securely transfer files 34 [16:09] <dholbach> - Creating and configuring your account on Launchpad 35 [16:09] <dholbach> - Setting up your development environment to help you do local builds of packages, interact with other developers, and propose your changes on Launchpad. 36 [16:09] <dholbach> So as I mentioned earlier: it's advisable to run the current development release if that's what you are working on 37 [16:09] <dholbach> but if you don't have it running right now: no big deal 38 [16:10] <dholbach> you can easily just retrace your steps later on 39 [16:10] <dholbach> and as I said: there's a session about running the development release later this week 40 [16:10] <dholbach> There are a number of tools that will make your life as an Ubuntu developer much easier. 41 [16:11] <dholbach> If you run 11.10 or 12.04, run this command: 42 [16:11] <dholbach> sudo apt-get install packaging-dev 43 [16:11] <dholbach> If you run an older release, run this command instead: 44 [16:11] <dholbach> sudo apt-get install gnupg pbuilder ubuntu-dev-tools bzr-builddeb apt-file 45 [16:11] <dholbach> This will obviously take some time, but I'll just keep on talking :) 46 [16:11] <dholbach> This command will install the following software: 47 [16:12] <dholbach> - gnupg â€“ GNU Privacy Guard contains tools you will need to create a cryptographic key with which you will sign files you want to upload to Launchpad. 48 [16:12] <dholbach> - pbuilder â€“ a tool to do a reproducible builds of a package in a clean and isolated environment. 49 [16:12] <dholbach> - ubuntu-dev-tools (and devscripts, a direct dependency) â€“ a collection of tools that make many packaging tasks easier. 50 [16:12] <dholbach> - bzr-builddeb (and bzr, a dependency) â€“ distributed version control with Bazaar, a new way of working with packages for Ubuntu that will make it easy for many developers to collaborate and work on the same code while keeping it trivial to merge each others work. 51 [16:12] <dholbach> - apt-file provides an easy way to find the binary package that contains a given file. 52 [16:12] <ClassBot> google_ asked: can we use ubuntu in virtual box for ubuntu development? 53 [16:13] <dholbach> google_, yes, definitely - it's one of the "safe" ways to run the development release 54 [16:13] <dholbach> Tomorrow 18:00 UTC will be a session called "Running the development release" 55 [16:13] <ClassBot> lukestuts asked: Can you recommend a good introduction to packaging and setting up your own PPA? 56 [16:13] <dholbach> lukestuts, yes - I'll share some links at the end of the session 57 [16:13] <ClassBot> Kvrmurthy asked: What topics are covered till now? 58 [16:14] <dholbach> Kvrmurthy, in the session I did before I covered the basics of Ubuntu development (an overview over all the moving parts) and now we'll set up our development environment 59 [16:14] <ClassBot> dnewkirk asked: While we need to be testing packages and fixes in the actual release, how valuable is this before, say, beta? The toolchain changes of course, but it seems problematic as the alphas have a lot of turmoil especially for non-LTS releases... 60 [16:15] <dholbach> dnewkirk, testing all the time is super important - of course I wouldn't ask my dad, mom, sister or brother to do it - they have other things to do and want a stable system 61 [16:15] <dholbach> but for those of us who enjoy Ubuntu and want to spare some time contributing to it, it makes sense to go and test as early as possible :) 62 [16:15] <dholbach> ... in a safe way, like a VM, as I mentioned earlier 63 [16:15] <ClassBot> kbmonkey asked: I run 11.04, but enabled backports and installed packaging-dev. This will do just the same? 64 [16:16] <dholbach> kbmonkey, if there's a package called packaging-dev and you can install it, you should be all set 65 [16:16] <ClassBot> fantasti1001 asked: can anyone who doesn't use ubuntu be ubuntu developer? 66 [16:16] <dholbach> fantasti1001, it's a bit tough to develop Ubuntu if you don't use it - I'd say that if you use a VM to develop, you are an Ubuntu user though 67 [16:16] <dholbach> alright, let's crack on :) 68 [16:17] <dholbach> = Create your GPG key = 69 [16:17] <dholbach> If you have a GPG key already created, skip these instructions, you just need one. 70 [16:17] <dholbach> GPG stands for GNU Privacy Guard and it implements the OpenPGP standard which allows you to sign and encrypt messages and files. This is useful for a number of purposes. In our case it is important that you can sign files with your key so they can be identified as something that you worked on. If you upload a source package to Launchpad, it will only accept the package if it can absolutely determine who uploaded the package. 71 [16:17] <dholbach> To generate a new GPG key, run: 72 [16:17] <dholbach> gpg --gen-key 73 [16:18] <dholbach> GPG will first ask you which kind of key you want to generate. Choosing the default (RSA and DSA) is fine. Next it will ask you about the keysize. The default (currently 2048) is fine, but 4096 is more secure. 74 [16:18] <dholbach> Afterward, it will ask you if you want it to expire the key at some stage. It is safe to say â€œ0â€, which means the key will never expire. The last questions will be about your name and email address. 75 [16:18] <dholbach> Just pick the ones you are going to use for Ubuntu development here, you can add additional email addresses later on. Adding a comment is not necessary. Then you will have to set a passphrase, choose a safe one (a passphrase is just a password which is allowed to include spaces). 76 [16:18] <dholbach> Now GPG will create a key for you, which can take a little bit of time; it needs random bytes, so if you give the system some work to do it will be just fine. Move the cursor around, type some paragraphs of random text, load some web page. 77 [16:19] <dholbach> ... or just continue listening to this session - just leave the terminal sitting there and doing its thing. :) 78 [16:19] <dholbach> = Create your SSH key = 79 [16:19] <dholbach> Again: if you have a SSH key already generated, skip these instructions. :) 80 [16:19] <dholbach> SSH stands for Secure Shell, and it is a protocol that allows you to exchange data in a secure way over a network. It is common to use SSH to access and open a shell on another computer, and to use it to securely transfer files. For our purposes, we will mainly be using SSH to securely upload source packages to Launchpad. 81 [16:20] <dholbach> If gpg is still sitting there creating your GPG key, just open another terminal window or tab. 82 [16:20] <dholbach> To generate an SSH key, enter: 83 [16:20] <dholbach> ssh-keygen -t rsa 84 [16:20] <dholbach> The default file name usually makes sense, so you can just leave it as it is. For security purposes, it is recommended that you use a passphrase. 85 [16:21] <dholbach> Any questions so far? 86 [16:22] <ClassBot> kanliot asked: WHY DOES ssh need a key? what does it protect? 87 [16:22] <dholbach> kanliot, to establish a safe connection (like SSH does), you need a public and private key to do proper encryption 88 [16:22] <dholbach> ssh is for example used if you push branches to Launchpad 89 [16:23] <dholbach> Alright... everything clear so far? All going according to plan? 90 [16:23] <dholbach> If not, hop into #ubuntu-classroom-chat and ask your question there. :) 91 [16:23] <ClassBot> jacopoL asked: Are there any requirements about using your real name instead of a nickname when uploading to Launchpad? 92 [16:24] <dholbach> jacopoL, I believe there's no strict requirement for using your real name, but it's what very close 100% in Ubuntu development do 93 [16:24] <ClassBot> gaurav__ asked: Can I change my GPG key in future if I want to? 94 [16:24] <dholbach> gaurav__, yes, you can add email address IDs to it, you can revoke it, add a new one, etc 95 [16:25] <dholbach> ah, coming back to the real name question: 96 [16:25] <dholbach> I think it's usually good and natural to publish good work you do under your own name - for example can it be a great referral when looking for jobs, etc 97 [16:26] <dholbach> Moving on... 98 [16:26] <dholbach> = Set up pbuilder = 99 [16:26] <dholbach> pbuilder allows you to build packages locally on your machine. It serves a couple of purposes: 100 [16:26] <dholbach> - The build will be done in a minimal and clean environment. This helps you make sure your builds succeed in a reproducible way, but without modifying your local system 101 [16:26] <dholbach> - There is no need to install all necessary build dependencies locally 102 [16:26] <dholbach> - You can set up multiple instances for various Ubuntu and Debian releases 103 [16:26] <dholbach> Setting pbuilder up is very easy, just run: 104 [16:26] <dholbach> pbuilder-dist <release> create 105 [16:26] <dholbach> in our case: 106 [16:27] <dholbach> pbuilder-dist precise create 107 [16:27] <dholbach> This will take a while as it will download all the necessary packages for a â€œminimal installationâ€. These will be cached though. 108 [16:27] <dholbach> so again: if you have pbuilder already installed, skip this part - also: if it takes longer, just leave the terminal open and the tool doings its thing 109 [16:28] <dholbach> The great thing is: we are going to have a session about pbuilder later this week: Thu 2nd Feb - 16:30 UTC - "Building locally with pbuilder" 110 [16:28] <ClassBot> arcimboldo asked: is it possible to use pbuilder on a debian to compile ubuntu packages? 111 [16:28] <dholbach> arcimboldo, yes and vice versa 112 [16:29] <dholbach> Let's go back to 113 [16:29] <dholbach> = Your GPG key = 114 [16:30] <dholbach> Once the command is done, you will get a message similar to this one: 115 [16:30] <dholbach> pub 4096R/43CDE61D 2010-12-06 116 [16:30] <dholbach> Key fingerprint = 5C28 0144 FB08 91C0 2CF3 37AC 6F0B F90F 43CD E61D 117 [16:30] <dholbach> uid Daniel Holbach <email@example.com> 118 [16:30] <dholbach> sub 4096R/51FBE68C 2010-12-06 119 [16:30] <dholbach> In the case above 43CDE61D is the key ID. 120 [16:30] <dholbach> Next, you need to upload the public part of your key to a keyserver so the world can identify messages and files as yours. To do so, enter: 121 [16:30] <dholbach> gpg --send-keys <KEY ID> 122 [16:31] <dholbach> If you get an error message about no specified keyserver, do this instead: 123 [16:31] <dholbach> gpg --send-keys --keyserver keyserver.ubuntu.com <KEY ID> 124 [16:31] <dholbach> This will send your key to one keyserver, but a network of keyservers will automatically sync the key between themselves. Once this syncing is complete, your signed public key will be ready to verify your contributions around the world. 125 [16:31] <ClassBot> laza36 asked: â€‹â€†Are there gpg keys that are too old? I have one that was certified, but it's from 1999 126 [16:32] <dholbach> laza36, the encryption used 1999 might be a bit weak by now - I would suggest some reading on the internets 127 [16:33] <ClassBot> Ceno asked: can one person registered in launchpad have multiple GPG keys associated with him? 128 [16:33] <dholbach> Ceno, yes :) 129 [16:33] <dholbach> which leads us to our next topic :) 130 [16:34] <dholbach> = Get set up to work with Launchpad = 131 [16:34] <dholbach> With a basic local configuration in place, your next step will be to configure your system to work with Launchpad. Here's what we will do: 132 [16:34] <dholbach> - Find out what Launchpad is and create a Launchpad account 133 [16:34] <dholbach> - Upload your GPG and SSH keys to Launchpad 134 [16:34] <dholbach> - Configure Bazaar to work with Launchpad 135 [16:34] <dholbach> - Configure Bash to work with Bazaar 136 [16:35] <dholbach> Launchpad is the central piece of infrastructure we use in Ubuntu. It not only stores our packages and our code, but also things like translations, bug reports, and information about the people who work on Ubuntu and their team memberships. You will also use Launchpad to publish your proposed fixes, and get other Ubuntu developers to review and sponsor them. 137 [16:35] <dholbach> ... where "sponsor" means: upload packages in your stead, until you have upload rights yourself :) 138 [16:35] <dholbach> You will need to register with Launchpad and provide a minimal amount of information. This will allow you to download and upload code, submit bug reports, and more. 139 [16:35] <dholbach> Besides hosting Ubuntu, Launchpad can host any Free Software project. 140 [16:36] <ClassBot> vikram360 asked: how do i get past the postfix configuration window when installing pbuilder, neither the keyboard not the mouse seem to be working for me. 141 [16:36] <dholbach> vikram360, hum, I didn't have that happening to me - can you just press Enter to continue with the installation - can anyone help vikram360 in #ubuntu-classroom-chat? 142 [16:36] <ClassBot> burli_13 asked: â€‹â€†how I should handle keys in general? I have several computers an I make a fresh installation every release. Should I create new keys for each computer? Or can I use one key everywhere? 143 [16:37] <dholbach> burli_13, GPG key I copy over (just copy ~/.gnupg/) for SSH I create ssh keys for every machine 144 [16:37] <dholbach> Launchpad can easily deal with multiple SSH and GPG keys though 145 [16:37] <ClassBot> nava asked: what is best programming language for writting app for ubuntu ? (which do you suggest ?) 146 [16:37] <dholbach> nava, I personally use Python for almost everything 147 [16:38] <dholbach> but it depends - if you want something dealing very closely with hardware, you might want to use C 148 [16:38] <dholbach> for web apps, you might want to use PHP (Python is possible there too) 149 [16:38] <dholbach> there's many options 150 [16:38] <dholbach> developers.ubuntu.com might help also :) 151 [16:38] <ClassBot> nava asked: i hear canonical is writing a sdk for ubuntu tablet,tv, phone and also desktop is it true ? if yes what is ubuntu sdk language ? 152 [16:38] <dholbach> nava, you know much more than I do :) 153 [16:39] <dholbach> I don't know what's in the cards - the only thing I do now, is that developer.ubuntu.com is a beautiful site with lots of good docs about writing apps for Ubuntu :) 154 [16:39] <dholbach> and it's up and running NOW :) 155 [16:40] <ClassBot> alco asked: which is the most appropriate Python version for Ubuntu devel today? 2.7? 3.x? 156 [16:40] <dholbach> alco, 3.x and 3.7 are both installed on a default system, with 2.7 still being used in lots of places, the future is 3.x though 157 [16:40] <dholbach> alright, let's crack on :) 158 [16:41] <dholbach> If you haven't set up an Launchpad account yet, go to https://launchpad.net/+login 159 [16:41] <dholbach> Launchpadâ€™s registration process will ask you to choose a display name. It is encouraged for you to use your real name here so that your Ubuntu developer colleagues will be able to get to know you better. 160 [16:41] <dholbach> When you register a new account, Launchpad will send you an email with a link you need to open in your browser in order to verify your email address. If you donâ€™t receive it, check in your spam folder. 161 [16:41] <dholbach> I doubt we have the time to go through all the steps now, but here's where you can upload your GPG and SSH keys once you have your account set up: 162 [16:42] <dholbach> https://launchpad.net/~/+editpgpkeys 163 [16:42] <dholbach> https://launchpad.net/~/+editsshkeys 164 [16:42] <dholbach> (it's all rather self-explanatory and will just take a few minutes all in all) 165 [16:42] <dholbach> Bazaar is the tool we use to store code changes in a logical way, to exchange proposed changes and merge them, even if development is done concurrently. It is used for the new Ubuntu Distributed Development method of working with Ubuntu packages. 166 [16:42] <dholbach> To tell Bazaar who you are, simply run: 167 [16:42] <dholbach> bzr whoami "Bob Dobbs <firstname.lastname@example.org>" 168 [16:43] <dholbach> bzr launchpad-login subgenius 169 [16:43] <dholbach> whoami will tell Bazaar which name and email address it should use for your commit messages. With launchpad-login you set your Launchpad ID. This way code that you publish in Launchpad will be associated with you. 170 [16:43] <dholbach> Note: If you can not remember the ID, go to https://launchpad.net/~ and see where it redirects you. The part after the â€œ~â€ in the URL is your Launchpad ID.) 171 [16:43] <ClassBot> vrubium asked: how can i guarante that an app for ubuntu is compatible wiht debian? 172 [16:44] <dholbach> vrubium, if you have written the app already, you can set up a debian virtual machine and test it in there 173 [16:44] <dholbach> if you plan to write it, it might make sense to check that all the libraries and modules you use are in Debian as well 174 [16:45] <dholbach> Now let's go and configure our shell 175 [16:45] <dholbach> Similar to Bazaar, the Debian/Ubuntu packaging tools need to learn about you as well. Simply open your ~/.bashrc in a text editor and add something like this to the bottom of it: 176 [16:45] <dholbach> export DEBFULLNAME="Bob Dobbs" 177 [16:45] <dholbach> export DEBEMAIL="email@example.com" 178 [16:45] <dholbach> Now save the file and either restart your terminal or run: 179 [16:45] <dholbach> source ~/.bashrc 180 [16:45] <dholbach> (If you do not use the default shell, which is bash, please edit the configuration file for that shell accordingly.) 181 [16:46] <dholbach> If all the steps above succeeded, you're done and you're up and running. 182 [16:46] <dholbach> :-) 183 [16:47] <dholbach> Any questions up until now? 184 [16:48] <ClassBot> Kvrmurthy asked: in bzr whoam i @example means "@launchpad" or my email "@gmail"? 185 [16:48] <dholbach> ClassBot, the email address you want to use for Ubuntu development 186 [16:48] <ClassBot> jrzabott asked: Do you have a tutorial in somewhere in the web, to configure the softwares, the enviromente, launchpad bazaar and etc, and a tutorial, right? 187 [16:49] <dholbach> yes, finally: links to docs! 188 [16:49] <dholbach> there's one link you need: http://developer.ubuntu.com/packaging/ 189 [16:49] <dholbach> also if you want to stay on top of what's going on in the Ubuntu development world, follow: 190 [16:49] <dholbach> http://twitter.com/ubuntudev http://identi.ca/ubuntudev http://facebook.com/ubuntudev http://gplus.to/ubuntudev 191 [16:50] <dholbach> (one of them should be enough ;-)) 192 [16:50] <ClassBot> kanliot asked: is there a specific ubuntu wiki page for this lecture? 193 [16:50] <dholbach> kanliot, the link above should get you all set 194 [16:50] <ClassBot> Ceno asked: bazaar is version control , similar do git right? Imagining we already have a software project using git what would be the best approach? ditch git and use bazaar instead? put our project in github and treat it as an upstream project? 195 [16:50] <ClassBot> There are 10 minutes remaining in the current session. 196 [16:51] <dholbach> Ceno, yes, bazaar is a version control system like git and many others - one of the great advantages of it (and I'm talking here as a almost 100% user of Bazaar, so take it with a grain of salt): its ease of use and its tight integration with Launchpad 197 [16:52] <dholbach> if you're happy with what you're using right now for your software development, keep on using it - there's no obligation to switch 198 [16:52] <dholbach> but try it out and see for yourself - I never felt like I was missing anything :-) 199 [16:52] <dholbach> In addition to the links above, I would like to mention #ubuntu-motu and firstname.lastname@example.org again 200 [16:53] <dholbach> these are places where you can very easily find helpful and clever people and after a while: good friends 201 [16:53] <dholbach> don't hesitate to ask your questions 202 [16:53] <dholbach> Any more questions before I turn the mic over to mhall119? :) 203 [16:54] <ClassBot> Atlantic777 asked: what about building .deb packages if we don't use debian-like distro? Should we just install an Ubuntu-dev into VM and make the package there? 204 [16:55] <dholbach> Atlantic777, a virtual machine is probably the easiest approach, a chroot might work for mere package building too 205 [16:55] <ClassBot> laza36 asked: â€‹â€†How can/is there some way/need that I test my SSH and gpg key that I just imported into launchpad? 206 [16:55] <ClassBot> There are 5 minutes remaining in the current session. 207 [16:55] <dholbach> laza36, ssh <launchpad id>@bazaar.launchpad.net 208 [16:56] <ClassBot> Kvrmurthy asked: export DEBFULLNAME="Bob Dobbs" 209 [16:56] <dholbach> Kvrmurthy, hum 210 [16:56] <dholbach> it was part of the commands supposed to be added to the bottom of your ~/.bashrc file 211 [16:56] <ClassBot> Ceno asked: this session has covered how to set up the environment. will there be a session explaining how to make a source package from our code and then send it to launchpad? 212 [16:57] <dholbach> Ceno, yes, there'll be Ubuntu Distributed Development tomorrow at 19:00 UTC 213 [16:57] <dholbach> there will also be many session about fixing bugs in Ubuntu this week, where it will also be used 214 [16:57] <ClassBot> jincreator asked: If I submit bug, request merge, ... and no answers from everyone for long time, what can I do? 215 [16:57] <dholbach> jincreator, join in #ubuntu-motu and ask 216 [16:58] <ClassBot> Kvrmurthy asked: export DEBFULLNAME="Bob Dobbs" export DEBEMAIL="email@example.com" is this part of installation in ubuntu? or answer to somebody's question? 217 [16:58] <dholbach> Kvrmurthy, ah yes - it's supposed to go at the bottom of your ~/.bashrc file 218 [16:58] <dholbach> alright my friends 219 [16:58] <dholbach> you all are awesome 220 [16:58] <dholbach> thanks a lot for joining Ubuntu Developer Week 221 [16:59] <dholbach> Bookmark http://developer.ubuntu.com/packaging/ - follow @ubuntudev - join #ubuntu-motu - let's help making Ubuntu better and the world a better place.