Adept, Welcome to Your Installer (3 of ?)

The CLI Edition

Okay, so I must confess up front, I’m not going to give you any information about adept here. This is related to adept, though not actually about adept. This is about how to get behind the scenes of package management. I invite all you happy people to comment on this entry with your own tips and tricks. Let us please stick to deb-related stuff here (sorry RPM and Gentoo people, but focus helps learning).
By the way, since my target audience is Mary Sue home-maker and Joe Schmoe, I promise to do my best to expand my acronyms. To that end, “CLI” is “Command-Line Interface.” A command-line interface is a text-based interface where a user types in commands and the computer–like a good little kitty–does as it is told. To get to the command-line interface you can use a terminal emulator. I like Konsole, so let’s use that one. Go to the K menu and go to the “System” submenu, and locate “Terminal Program (Konsole).” Click on it and a new window will open that will look something like…

manchicken@larry:~$

Okay, so let’s talk about this in scenarios….
So, you want to install a program.
So, I’ve been hearing quite a few good things about this awesome children’s learning game GCompris. I want to install it to check it out for myself. To do this I start up my handy-dandy konsole and take to the commands. So, I already know what package I want to install, so let’s go ahead and install it now. You do this with apt-get. I’ll show you the command first, and break it down for you afterwards.

sudo apt-get install gcompris-sound-en

Okay, so sudo is a command that allows you to run everything that follows as root. You should always be careful when doing things as root. Make sure that when you do this that you know know what package it is that you’re installing. All main ubuntu software repositories use GnuPG signatures to verify the authenticity of the packages, so normal ubuntu repositories are pretty reliable.
Next up, apt-get is the remote package installer. It grabs packages from the repositories and it installs it on your computer. The install portion is instructing apt-get to install the package. And, of course, gcompris-sound-en is the package we’re installing.
So, now I’m installing the gcompris-sound-en package, which is the sound package for gcompris for the English language. I like sound, and I suspect you do as well. Here’s the output of the above command for me. This will very likely vary for you…

manchicken@larry:~$ sudo apt-get install gcompris-sound-en
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following NEW packages will be installed:
gcompris-sound-en
0 upgraded, 1 newly installed, 0 to remove and 15 not upgraded.
Need to get 1885kB of archives.
After unpacking 2699kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com edgy/main gcompris-sound-en 7.4-3ubuntu2 [1885kB]
Fetched 1885kB in 7s (245kB/s)
Selecting previously deselected package gcompris-sound-en.
(Reading database … 235936 files and directories currently installed.)
Unpacking gcompris-sound-en (from …/gcompris-sound-en_7.4-3ubuntu2_all.deb) …
Setting up gcompris-sound-en (7.4-3ubuntu2) …

So, to be exceedingly concise, what this is doing is opening the database, reading dependencies, locating the package to be installed, determining disk space requirements, informing me of disk space requirements, downloading the package, installing the package, configuring the package, and then closing the database. I’m sorry that I don’t have the time to explain in any more depth than that, but it would really take a while. Package management software is multi-faceted and complicated.
So, I’m going to explain one more scenario and then I’ll let you folks share. Sharing is good; don’t let anybody else tell you differently.
So, you have a program, you’d like to know what it is and where it came from.
I can’t tell you how many times I’ve wanted to know this information. This is a two part process how I do it. Others may have better ideas. Let’s all learn and share together.
What on earth is /usr/bin/dund? I’ve never heard of it before. Let’s learn! So, first, let’s find out what package it’s in. To do that we can use dpkg-query. dpkg is the debian package manager, and dpkg-query queries dpkg. Here’s the command…

dpkg-query -S /usr/bin/dund

Now, dpkg-query is the program we’re running. The -S flag tells it to look for a file name in the database and tell us where it came from. The /usr/bin/dund argument, of course, is the file we’re trying to look up. When I run that I get:

bluez-utils: /usr/bin/dund

That tells us that /usr/bin/dund comes from bluez-utils. Now we can use apt-cache to find information about the package. Here’s the command:

apt-cache show bluez-utils

This command tells apt-cache to show us details about the package bluez-utils. Below is the output.

Package: bluez-utils
Priority: optional
Section: admin
Installed-Size: 876
Maintainer: Ubuntu Core Developers
Original-Maintainer: Debian Bluetooth Maintainers
Architecture: amd64
Version: 3.7-1ubuntu4
Replaces: bluez-sdp (< = 1.5-2), bluez-pan
Depends: libbluetooth2 (>= 3.0), libc6 (>= 2.4-1), libdbus-1-3, libusb-0.1-4 (>= 2:0.1.12), module-init-tools, makedev (< < 3.3.8.2-0) | udev, lsb-base (>= 3.0-3), dbus
Recommends: bluez-passkey-gnome
Suggests: bluez-firmware
Conflicts: bluez-sdp (< = 1.5-2), bluez-pan
Filename: pool/main/b/bluez-utils/bluez-utils_3.7-1ubuntu4_amd64.deb
Size: 290770
MD5sum: 96a2a998d8121cafaa4e5f48c0eb24b0
SHA1: d6ea9d05c2be90f6d58637ee13c3c73c33d44fd4
SHA256: 2930de56b51148f7bb694cfa8e111d62c1d6f5aa989b4769bffdb1f443aaf290
Description: Bluetooth tools and daemons
This package contains tools and system daemons for using Bluetooth devices.
.
BlueZ is the official Linux Bluetooth protocol stack. It is an Open Source
project distributed under GNU General Public License (GPL).
.
More information is available at http://bluez.sourceforge.net/
Bugs: mailto:ubuntu-users@lists.ubuntu.com
Origin: Ubuntu
Task: ubuntu-desktop, kubuntu-desktop, edubuntu-desktop

Oh, wow. Now we know what this is. It is a bluetooth protocol package. I think this output is pretty self explanatory. I could explain all of these lines as well, but as previously mentioned, it would take more time than I’m willing to dedicate to this one post. If you have specific questions, ask in the comments and we can learn together.
Okay, so I’m done now. I really hope this has been helpful, and I truly encourage you to comment and share and learn. With this software you have freedom and you can help your neighbor. Let’s exercise this freedom and help our neighbors. Nighty night all you happy people.

Adept, Welcome to Your Installer (Part 2 of ?)

Okay, as promised, here’s the second installment of the adept rundowns. Let’s do this in order. First I’ll do Installer, then I’ll do Manager, then Updater, and since Updater and Batch are essentially the same, I’m going to skip Batch. Also, remember that my bird-brain can only hold so much information at one time, so I may make some mistakes. If you notice a mistake and post a (polite) comment informing me of this mistake, I’ll do my best to correct myself. If you do find such a mistake, feel free to stop by my coop any time to receive your reward of one free cookie with purchase of $10 glass of milk. So, on to the low-down.
By the way, did you remember to call your mother?
K Menu, with Add/Remove Programs highlighted.Okay, so you all know that I am the ultimate Adept fanboy, and that’s not just because I’m knee deep in its code either. Oh no no no. It’s because Adept has some crazy-cool functionality. Let’s talk Adept Installer, shall we? If you missed the last post, you can look at this thumbnail to help you find it in the K menu.
Now, lately I’ve had a hankering for tea lately, so I’ve decided that we’re going to install KTeaTime. This program helps you know how long to steep your tea for just the right cup. I want to warn you though, according to the description here, it only works with KDE, so pick another package (perhaps another one having to do with tea?) if you don’t want to risk it. You can always uninstall it later 🙂
Adept Installer with KTeaTime selectedOkay, so let’s locate the package. I just navigate to the “Others” group, with the filter bar (in the toolbar) is only filtering for KDE programs. Then, scroll in the “Application (Others)” column until you see KTeaTime–this column is sorted alphabetically.
After reading the description–very important to read the description!–I check the checkbox just to the left of the gear icon (icons may vary depending on your theme) and notice that what was the disabled “Next” button lights up to an “Apply Changes” button. So let’s click the button.
Installer DownloadingYou’re going to see three screens, and I’ll go into a bit of depth on them. So, this screen is showing you that it’s checking your sources list. It does this for each operation you do. For this one package it should only show one of those. Continuing on…
Installer InstallingRighto, so now apt is preparing the database, downloading the file, installing the file, and updating the database. This is all very important stuff. If you click the “Show Details” button it’ll show you the output of the apt process in the background. If you were seeing weird errors, this window could help.
Installer CompleteYay! The installation is completed! Now you should be able to go and brew a cup of tea. Let’s check out the K menu…
KTeaTime in the menu
Yeah! Rock on! Sweet tea-steeping goodness is mine for the taking!
Now that you too can install sweet sweet Free Software programs using our beloved Adept Installer, post a comment telling us all what you’re installing!

Adept, Welcome to Your Installer (Part 1 of ?)

Just a word for those of you tuning in, this will be a multi-part post on Adept, what it is, who uses it, and how one uses it.
Yes, I’m talking about Adept. What’s Adept you ask? Well, check out the write-up on Adept on kde-apps.
Who uses Adept you ask? Well, the simple answer is that all the people who rock and love their mothers use adept. Well, maybe that’s a little unfair, perhaps I should expand. Just don’t forget to call your mother.
K Menu, with Add/Remove Programs highlighted.Adept is the installer program used by default on Kubuntu, a KDE-focused Ubuntu distribution. It interfaces with apt, and does so pretty damned well. So there are four major interfaces you may see from Adept. One is the installer. This is the one that you see on your K menu.
With the installer, you can intuitively locate and install programs. This interface provides you with very useful information about prospective packages that you may be looking to install. This interface lets you search, view by category, and even filter by desktop.
Adept Installer
Secondly, we have the Adept Manager. This interface gives you a comprehensive list of the packages in your selected repositories. You can and filter to your hearts content. There’s a lot going into adept for Feisty, I’ll tell you that right now. There are so many features of this interface, even I’m unaware of a great deal of them.
Adept Manager
Next up, the Adept Updater. This consists of not just the big interface you see below, but also the little system tray icon that lets you know when you have an update. All you do is click that icon, it refreshes from your sources, and then lets up upgrade–with full control–all packages available for update. And if it were time for an upgrade–like when Feisty is ready–it’ll give you a nice wizard to step you through the upgrade process.
Adept Updater
Last but certainly not least, the Adept Batch process. This little fella lets you programmatically fire off an adept install. With an interface so similar to the updater, I didn’t put a photo up for this one.
So, over the next few [INSERT TIMEFRAME HERE]s, I’ll be going more in-depth into what you can do with this amazing program. This is a program that is good to get acquainted with soon, and use well.

A GNU Emacs guy's challenge to vi guys

Alright, so any hacker with air in their lungs has heard of these debates where someone argues vi sucks, and someone else claims that GNU Emacs is slow or sluggish, then the vi guy says that vi is easier to use, and the GNU Emacs guy says that no, GNU Emacs is in fact easier to use. I suppose the title of this entry may even perpetuate these.
Well, let me get one thing clear… I don’t care what editor you use. Just stop bitching about how you don’t like the one I use. That is the one and only comment you’ll see to that degree for this post. Now onto something worth reading.
So, here are a list of features that I know how to do in GNU Emacs, but many of my buddies who use vi ask me how to do. My answer is usually a joking “you use GNU Emacs,” but I’m curious to see how many of these things you can actually do in vi. I’m going to focus on features specifically tailored to software development so as to avoid the “it’s too bloated” scorn of vi users. So, here’s the list of features…

  • In emacs, with tramp-mode, you can edit files remotely with a local running instance of emacs. This allows you to even compile and debug a program on the remote host, still using your local emacs session (only with ssh in tramp-mode).
  • In emacs you can manage your version control for your files from inside of the editor. Check in, diff, etc. All works.
  • In emacs, ediff is an insanely cool diffing program inside of emacs. It lets merge, diff, and diff entire directories of files.
  • In emacs, you can use a database directly from your editor. With two buffers in a split window, you can bind one buffer to your database interface buffer, and execute queries directly from one buffer to another buffer, even live SQL from inside a source file.
  • In emacs, many languages (not all; I’m talking about you, Ruby) have debuggers that are well integrated into emacs. Perl, C, Java, Python, lisp, all just a handful of such languages. Lets you control the debugger from inside emacs, not just a command-line embedded in the buffer.

Once again, this is not a flame at vi users. I’m just curious if/how you can do these things in vi so the next time I get an “how do you do that in vi?” I can answer. Please comment (politely) to this post. Thanks for spreading the knowledge.