Software Management Tools

From Chakra | Wiki
Jump to: navigation, search

Note:' Most of the images on this page are thumbnails. To see the full-sized image simply click the thumbnail.

Need... More... Stuff...

There's already lots of things you can do with your new Chakra installation, but odds are you're going to need or want something that isn't installed by default. Trouble is, if you're new to Linux you probably don't know what's available or how to get it, and that's what this tutorial is all about. I've divided it into two sections. On this page I'll show you where to get software for your Chakra system and how to install it, and on the next one we'll look at the major software categories and what's available in those categories.

The Good News

You're going to love Linux software management. Getting software is as simple as finding out the name of what you want, running a search for it in a package management utility, selecting it, and clicking install. No CDs, no wizards, no money (although free software projects love donations), and for the most part no license agreements. If there are several different software programs for the same purpose, it's very easy (and costs no money!) to install them all, try them out, and keep the one you like best.

Nice package!

When software is developed for Linux it's usually made available in the form of human-readable source code. Back in the early days you'd download the source code, compile it into machine-readable binary code, and install it manually. You can still do that, but most modern Linux distributions make it available in the form of packages. A package is a bundle of the pre-compiled binary code along some scripts and whatever else is needed to automate the installation on your specific distro. The end-user then downloads and installs the software using a package manager, which is a utility for installing, upgrading, and removing software packages. The Chakra team is working on creating their own package management software from scratch, but for the moment they're using Pacman, which was developed for Arch Linux.

Dependencies

Some software (lots of software, actually) needs other software in order to compile, install, and run. When a piece of software needs another piece of software, we call the piece of software it needs a dependency. In the old days you'd have to track down all the dependencies yourself and install them manually, but most modern package managers, Pacman included, will resolve the dependencies automatically and install them along with the software you're actually trying to get. So if you ask it to install something and it brings in several other things along with it don't worry; it's just installing the dependencies for you.

Repositories

Packages are typically kept in online repositories. Chakra maintains four main officially supported repositories:

  • lib32: As we mentioned, Chakra can only be installed on systems that support 64bit technology. However, some popular applications like Steam, Wine or Skype still depend on older technology, and you can find these available here.
  • core: The core system; this is the stuff you need to have a running, bootable Chakra system. It includes the linux kernel and graphics drivers, a series of libraries, and the Plasma 5 and Frameworks groups of packages.
  • desktop: All the applications and games that can enhance your desktop experience.
  • gtk: Chakra is focused on KDE/Qt technologies, but there are some very popular applications that are based on gtk (Gimp, Firefox, Chromium, Inkscape, Thunderbird) and they are provided here.

Then there's the testing repository, where software gets tested before being moved to the main repos. Some adventurous souls like to contribute to Chakra by running software from the testing repositories and reporting problems, but if you're new to Linux I would advise against it. Only the main repositories are enabled on a default Chakra installation, so no worries.

Mirrors

The repositories are hosted online by servers in various locations throughout the world; these are known as mirrors because if they're all up-to-date they ought to be identical. The more mirrors there are the less bandwidth is demanded of any one of them, and the faster users can generally download software. You can check the status of the mirrors on the Mirror Status page. Chakra now has over twenty of them and more are being added all the time. The best mirrors for you were setup during installation, but you can manually configure them by editing the /etc/pacman.d/mirrorlist file as root and removing (uncommenting) the # from the lines of the mirrors you want to use. Have in mind that the order is important, Pacman will always use them starting from the top.

The Root Account

The root user account is kinda like the administrator account on a Windows system, except that it's mandatory in Linux... which is one of several reasons why Linux is more secure than Windows. Chakra is a Linux distro mostly intended for home desktop use, and on most home computers the user is also the administrator, so the default setup on a Chakra installation is for the first regular user account (the one created at installation time) to have the same password as the root account. I think this is fine for a home desktop machine, but just be aware that the root account and your regular user account are separate, even though the passwords are the same.

It may seem like an inconvenience at first to have to provide a password every time you want to perform any kind of system administration task, but in fact it can really save your bacon. Let's say you open an e-mail that contains malware or some other funky stuff (and don't let anyone tell you that there isn't malware out there that targets Linux; there is). That malware probably won't be able to screw up your system, because you opened the e-mail as a regular user, the e-mail and all it contains has your regular user's permissions attached to it, and your regular user doesn't have the permissions to mess with anything that might bring the system down. That's just one example of how the Unix privilege separation makes your computer more secure. This is why even systems administrators on big enterprise systems will have a regular user account that they do most of their work from, only logging in as root when it's necessary to do so.

Regular users can't install software, so we need root privileges. We could log into the terminal as root, but we can also run a command with root privileges without actually logging in as root. All you have to do is prefix the command with sudo, and then enter your password when prompted. This would get kind of tedious if you were going to be working as root for any length of time, but if you're only going to be issuing one or two commands as root it makes more sense... that way you don't have to worry about remembering to log back out.

Managing Packages

The Terminal Emulator

Back in the early days of computing they didn't have graphical interfaces; you logged into a text-only terminal and worked from there. You can still do that on modern Linux system, but you can also get a terminal login from within the comfort of your graphical desktop environment using a terminal emulator.

Konsole

The KDE terminal emulation program is called Konsole. To launch it open your Application Menu, and from "Favorites" click on Terminal/Konsole to open it:

Konsole.png

When you first open Konsole you're presented with a command prompt, followed by a flashing cursor. The prompt should start with your username, followed by the name of the computer we're working from. The tilde symbol (~) tells you that you're working from within your home directory. The last symbol you see there is known as the prompt. Right now it's a dollar sign ($), indicating a regular user prompt. A pound sign (#) would indicate a root user prompt.

Running Upgrades

There's a good chance when you boot into Chakra for the first time that there are upgrades for your installed software. They might be security patches for the core system, or newer versions of the apps and/or the desktop environment. The way to keep your system up to date is by using pacman or octopi as described below.

One thing Chakra definitely does NOT feature is automatic upgrades. This is a good thing; I wouldn't dream of running upgrades without first looking over the list. Not that I think the upgrades are going to break anything, but it's good to know what's going on. Always read the output that shows up in the terminal window after your upgrades are done; there might be something you have to do after the upgrades are complete. If I'm upgrading to a new version of an app that I have running at the moment, I'll usually close that app. Also, don't forget that the Chakra repositories get new versions of your apps shortly after they're released, so (for example) it may be kinda stupid to run upgrades if you have a big presentation tomorrow and there's a new version of Kpresenter in your upgrade list; the app might have had some stuff moved around or some completely new features, and who wants to contend with an unfamiliar new version when people are watching?

Pacman

Pacman by itself is strictly a command-line tool and doesn't feature a graphical interface at all. This also serves as a very good introduction to the command-line interface, because Pacman is extremely easy to use. Just one command and with a few easy-to-remember options and you'll be in business.

With the Pacman package manager you only need one command: "pacman"! You specify what you want Pacman to do by tacking on command options. A detailed explanation of Pacman and all of it's options is beyond the scope of this lesson, but you can check out the Pacman page of the excellent Arch Wiki for more details. In this section I'm just going to show you how to use Pacman to install software.

Upgrading your System

The command is:

sudo pacman -Syu

Searching for packages

For searching the repo's you can use the simple "pacman -Ss partial_package_name" and it will return any package that has part of that name or has it in it's description.

pacman -Ss firefox

Installing packages

If you know the exact names of the packages you want to install it's quick to just get them with a "pacman -S" command.

sudo pacman -S firefox

Installing Development Tools with Pacman

To demonstrate the use of Pacman for installing software, we'll pick up a few development tools. We'll need them a little later in this tutorial, when I show you how to download and install software from the Chakra Community Repositories. So far we've been working with pre-built binary packages, but the stuff in the community repos has to be built from the original source code into binary and then wrapped up into an installable package... a process that will take place on your computer. Don't worry, the process is automated, but your computer is going to need some development tools installed in order to build and package that software. Different software needs different build tools, so we'll need an assortment. Everything we need is in the official repos.

The reason we need to access Pacman from the command-line for this job is that we're going to be installing a meta-package. A meta-package isn't really a package at all; it's a script that installs a whole bunch of packages in one shot. We're going to install a meta-package called base-devel, which installs a basic set of development tools.

The command to install software using Pacman is "pacman -S {package_name}. So to install base-devel using Pacman you'll enter:

[gene@chakra-pc ~]$ sudo pacman -S base-devel

The "sudo" prefix gives you root privileges for this command only, "pacman" is the program we want to run, the "-S" option tells pacman to synchronize with the online mirror, and "base-devel" is the software package we want to install. You'll be prompted for the root password, and then it'll give you a list of all the individual packages the metapackage is going to install, and asks you to select which ones you want. Just press enter to take them all. You'll then be presented with a list of programs that are about to be installed along with how much hard drive space this is going to eat. Then you have to confirm that you really want to install all this stuff; type "y" for yes, hit "Enter", and let it run. This is a lot of stuff, and it'll take a few minutes.

Installing Multiple Packages with One Command

The base-devel package is just what the name implies: a good set of basic development tools. But it ain't everything, and there are a few others that are required to build quite a few different programs. I can think of three other build tools that you should probably install right off the bat: cmake, scons, and automoc4. Once again they're all in the official repos, so we can install them all using a single pacman command:

[gene@chakra-pc ~]$ sudo pacman -S automoc4 cmake scons

Octopi

Pacman is a great and powerful package manager, but it is a command line tool and maybe not everyone prefers working like that. Here enters Octopi to rescue those that like to use a Graphic User Interface to install packages.

Main Window

Octopi1.png

In the main window you will see the list of applications that are available in the repositories. You can scroll through the list to find your favourites, or use the search bar on the top toolbar. Once you find what you are looking for, right click on it and you will be given an option to install it, or remove it if it is already installed.

On the top right section you can see the available groups of packages. These are some groups of packages that were chosen by the Chakra team to make it easier to find and install specific packages.

Tabs

In the middle section of the main window there is a series of tabs:

  • Info: Shows any related information in regards to the package you have chosen above. The same information can be retrieved with pacman using 'pacman -Sii packagename'
  • Files: When a package is already installed, you can see here the list of files it installs on your systems and the locations you can find them. The same information can be retrieved with pacman using 'pacman -Ql packagename'
  • Transaction: When you select something to be installed or removed, Octopi doesn't do that on the fly, but it adds it to the queue so you can chose when to implement the changes. In this list you can see what is in the queue at any moment.
  • Output: Since octopi still uses pacman to handle the commands, in this tab you will see the related konsole output.
  • News: You can find here all the latest news from Chakra, as they are available on the news section of the website.
  • Usage: This is like a legend, with basic information on how to use Octopi. Make sure to read through it before using it for the first time!

Toolbar and statusbar

Now let's have a closer look at the toolbar on top.

Octopi-toolbar.png
  • Sync Icon: Synchronizes your system's database with the main Chakra repositories on your mirror.
  • Upgrade: This will download and install any available package updates to your system. When updates are available, you will be notified on the bottom statusbar with a red explanation mark. As you can see, here I have 163 package updates available! Clicking on that icon will show you the available updates.
Octopi-statusbar.png

Alternatively, you can install octopi-notifier from the repositories. If you have it launch on each boot it will sit on the system tray and notify you when there are updates available.

  • Commit: Pressing this tells Octopi to go ahead and proceed with the changes you have selected, like for example installing or removing a package.
  • Cancel: This clears any selected changes you might have chosen to do.
  • Mirror-check: Clicking this will tell you if your repositories are synced to the main Chakra server. Since Chakra pushes updates very often, this will very often report that your mirror is not synced, especially for the desktop repository. A better way to check if your mirrors are synced is the [htts://chakraos.org/?mirrors| Mirror Status] page as it was mentioned above in the mirrors section.
  • CCR: The alien face icon is for installing applications from the Chakra Community Repository, for which I talked in more detail just below.

CCR

I'm talking about the Chakra Community Repositories. Most common-usage stuff is included in the official repositories, but there's a lot of more specialized apps that aren't there yet. This is where the community repositories come in. Anyone can contribute packages to CCR (I've made a few contributions myself), and if there's something you want that isn't there or in the official repos you can put in a request for it at the CCR sub-forum under "PKGBUILD Requests". Even GTK apps and their GTK dependencies are allowed here. If you like an app you can vote for it to be added to the official repos, and if it gets enough votes it'll be moved to the official package repos. As Chakra and Arch Linux share the same technologies, it is very easy to import packages that already exist there. There is a very useful tutorial on the wiki on how to upload a package to the CCR when it exists in Arch Linux repositories or the AUR and you can also use the aur2ccr application that can be installed from the repositories.

PKGBUILD Scripts

CCR doesn't actually have packages, it has PKGBUILD scripts that automate the process of building a package from source code. The software itself isn't in the repository; when you run a PKGBUILD it downloads the source code from the upstream source, compiles it into a machine-readable binary, and then creates a package that can be installed using the Pacman package manager. It also uses the Pacman package manager to install any dependencies that are in the official Chakra repositories.

CCR With the Terminal

Let's try using the command-line tools to install stuff from CCR.

The command to download, build, and install a package from the community repos is simply "ccr {package_name}. You don't need (or want) root privileges for this, so you won't use the "sudo" prefix. Just run the command "ccr" folowed by the package you want to install:

[gene@chakra-pc ~]$ ccr chrome

You're going to be prompted several times during this process. If CCR has to pull some dependencies from the official repos using Pacman it'll prompt you for the root password. When it builds the packages that come from CCR it'll do that as your regular user; it's dangerous to do it as root! It'll ask if you want to modify the PKGBUILD script for each CCR program; just enter "n" for no and it'll move on. Then you'll have to enter the root password again so it can use Pacman to install the packages. Once the process is complete you'll be able to launch your application.

Upgrading CCR Software

Just like the stuff in the official repositories, software in CCR gets upgraded as newer versions come out. At least that's how it's supposed to work; how quickly it gets done or whether it gets done at all is dependent on whoever is maintaining the package... don't forget that this is not an officially supported repo! To upgrade your CCR software use the following command:

[gene@chakra-pc ~]$ ccr -Syu

And enter your password when prompted. You need the password because the ccr program will also call up Pacman and check the official repos for upgrades at the same time. There's no automatic notification tool for CCR updates; you just have to check once in a while.

To be honest, I find it easier to work with CCR using the command line. Use whatever tool feels most comfortable for you.

Not the End

Now that you know where to get Chakra software and how to use Chakra's software management tools, you're probably itching to get some apps installed. The next lesson is a guide to finding the right app for the job.

Back | Next | Index