(The updated version of this series can be found here (gone).)
Debian won’t force you to use the commandline; it will entice you with the most opulent provision for those who dare to learn the magic of the Linux commandline.
Debian organizes the software offerings into packages and carefully tracks their dependencies. You could justly accuse the Debian managers of overly fragmenting their packages, but it does give the advantage of precise control. The best way is to use the commandline. That makes it a little tough on those just learning Linux, so you get a little hand-holding for now.
You could do just about the whole job of package management and updates from the graphical interface. In the XFCE main menu, select System > Synaptic. You’ll need to provide your root credentials to do anything with this, so be careful. Synaptic offers frequent warnings and information windows. Make it a habit to read them. You are unlikely to understand everything you see at first, but give yourself time and eventually it will all make good sense to you. One of the secrets of learning Linux is realizing that you might read the same thing a dozen times before it starts to stick. Virtually everyone who persists will get it sooner or later.
Synaptic opens up a bit small by default, so hit the second button on the upper right corner of the window frame to expand it full size. It is organized like a lot of listing applications: a left-hand column of categories, an upper window of listed items and a lower window for details of those items. There are several packages I recommend everyone add that are not installed by default.
One of them is the Chromium browser. This is the Open Source version of Google Chrome. You can have the latter if you wish, but it comes with some stuff added by Google that makes it both a little more slick and also a little more likely to betray your trust. It’s just smart security to keep on hand more than one browser. Not only do various websites prefer one or another browser, but different browsers by design offer different types of control to the user. The major reason for choosing Debian in particular, and Linux in general, is to take back control of your computer. Let’s install Chromium.
First, let’s make sure the package list is up to date. Along the top of Synaptic is a toolbar with large icons. The first one on the left says “Reload” with some appropriate symbol; you should click that first. Most of the interface is “grayed out” and a pop-up window informs you what is happening, downloading the fresh lists of what’s available. When Synaptic is ready, everything goes back to normal.
You can scroll down the list window interminably and in alphabetical order, or you can shorten your search. The icon that looks like a magnifying glass allows you to search for key words. Click that and in the dialog that opens up, type in “chromium” (without the quotation marks, of course). The top window will have a much shorter list now. Typically, the first item in the list is exactly what we seek. Notice the naming convention for the package: “chromium-browser”. There will be several variations on that name, but we are going to depend on the system to handle the packages on which Chromium depends. Click on the little square in the left-hand column of the list and a pop-up window allows you to select one of several options. We want to “Mark for installation” — it won’t install immediately because you may want a lot of other stuff. However, another window will pop up informing you of what dependencies will be added. Just make the obvious choices, click the buttons and the window will close.
We pretend for the moment that we are done. Back up to the toolbar with large icons we see “Apply” — click this and watch as more little pop-up windows inform you of what is happening. When the pop-up offers you the option of closing it (the button at the bottom becomes active saying “Close”), do so.
You’ll notice also the button between “Reload” and “Apply” is marked “Mark All Upgrades.” If you open Synaptic, say every week, you can click this after reloading and it should tell you if something significant is chosen. This is one way of keeping your system updated, but it lacks some of the fine-toothed control you’ll learn to love later. Enough for now that you know it can be done this way and most of the time there are no hiccups. The most frequent difficulty comes when certain kinds of packages require a little extra work from you to update. That’s why we have the commandline. You can do it from Synaptic, but it’s simply not as reliable that way, nor can it be made as reliable as the commandline.
Linux is like any other Unix: it’s a commandline system. Some time ago a pretty face was added, but it runs on top of the underlying operating system. Linux itself seldom demands much from your hardware and does so at the lowest level possible. Linux behind-the-scenes is rock solid and reliable because of simplicity itself. Adding a graphical user interface (GUI) inevitably requires talking to a wide range of hardware in a wide range of configurations, and some of them are frankly very poorly done. So while an awful lot of work as gone into the Linux GUI, there will always be some problems. By the way, we call this GUI “X” — short for the X Server. When things don’t happen to work perfectly, you can still get an awful lot done on the commandline interface (CLI). Debian in particular offers a very well thought out set of CLI packaging. In theory, you could do almost everything without X at all, and still have everything the GUI offers — music, videos, office applications, email and even surf most of the Internet. Your author has gone months when the only system available was not powerful enough to run a GUI, and did all computing from a Debian CLI.
When you start reading Linux tutorials, you’ll see references to commandline, CLI, terminal and console. For the most part, they are all the same. That is, you open a window which offers a commandline. There are several different types. However, the term “console” typically refers to operating without X at all.
You recall at the bottom of your XFCE desktop was a disappearing toolbar. One of the items on there by default looks like an old style computer monitor with a black screen. If you hover your mouse over this, it may say something about the commandline. Click on that. What you’ll see is a very plain window with some text displayed in the upper left corner. The text may be cryptic to you, but it indicates the user account followed by the system’s name for itself (“host name”). Then there is a sort of symbol marking what is called the “prompt” — the spot after which anything you type will show up. You could type in something crazy and accidentally mangle the way it operates, so I’ll ask you to be patient and type only what you see in this lesson until we have time to introduce more about the CLI itself.
For now, let’s learn how to manage packages the same as we did with Synaptic. Debian worked out a fine system some years ago called “apt”. There are a series of commands with options related to using that term. First, let’s type in the equivalent of reloading the package list. Type letter for letter what you see, and realize that you can use the BKSP, DEL, right and left arrow keys and edit what you type:
apt-get update
Notice the space in there, because this tells the apt-get
command what to do. Hit ENTER. You’ll see the system processing the command, checking the various places where it looks for package lists. Then the command prompt will return and wait for the next command. So we type this and hit ENTER:
apt-get upgrade
Instead of updating the lists, we are telling apt to check if anything needs upgrading. Depending on random circumstance, it’s likely you may see a response with a list of things showing in an indented block of text, and an option to select yes (y) or no (n). Obviously you should hit “y” and let it upgrade any packages that need it. It’s highly unlikely to cause any problems at this point.
Otherwise, we need to proceed with adding another few packages you’ll probably want but don’t know you’ll need. Those who surf the Internet may have noticed that, despite all our efforts to move away from some types of media display, a very large portion of the Internet still clings to bad ideas. One of those is the Adobe Flash Player. You can decide you don’t want it and no one will blame you, but most people find it almost necessary because too much of what they want on the Net is still in the Flash format.
Debian’s apt will allow you to search the list of packages using specific search terms. The command is a little different, but you’ll probably figure out what it means. We want apt to search the cache of package listing for something related to the Flash Player, but the list would be very long still. I’ll give you little hint based on the package naming conventions:
apt-cache search flashplugin
Calling it “flashplugin” narrows it down quite a bit. In this shorter list, you will see an item labeled flashplugin-nonfree
. This simply tells you that Flash Player is not “free” in the sense of Open Source, where you would be free to change the code. Adobe controls their code tightly, so we have to accept it as is. So we want to install this, but right now I want to show you something useful for operating on the commandline. You don’t always have to type everything out by hand.
Part of the X server protocols is something we call “mouse-paste” — you can drag your mouse/pointer across a section of text displayed almost anywhere and the mouse picks it up in its own buffer, separate from the clipboard (cut, copy and paste) offered in almost every GUI. The mouse buffer will hold that text and you can paste it by clicking the middle button. If you have only two buttons, click them both simultaneously and it should work the same. Thus, you can drag your mouse across the package name “flashplugin-nonfree” and hold it in the mouse buffer. Then type this much:
apt-get install
Leave a space at the end of that. Now place your mouse close to the cursor where you typed that and click the middle button. It should paste the package name behind the stuff you typed so you can hit ENTER and it will try to install the package. (Hint: If you are reading instructions like this on the same computer where you are using those instructions, you can mouse-paste the commands, however long and complex, from the browser to your terminal.) You’ll get a brief warning about licensing, but as you probably know, you don’t have much choice if you want Flash Player. Just pay attention to the prompts. During installation of software of this sort, where some outside agency controls the licensing, you’ll run into all sorts of notices, some requiring you to say “OK” specifically. When you see such a screen and there’s an “OK” at the bottom, just hit the TAB key to activate that and then ENTER. Otherwise you’ll get prompts for y
and n
, or similar options.
At the very least you should find the processing of Flash Player installation to be a little entertaining. It’s pretty convoluted but the thing downloads and double checks itself for all its parts, then installs. Once it’s done, you’ll get the prompt back. You now have Flash Player and all your browsers should be able to find it.
You can use the menu of this terminal window to close it, but the older orthodox method is to type exit
at the prompt, then hit ENTER. It will go away. That’s all for this lesson.
(Note to readers: These tutorials are being collected for a book I’ll be offering for free. I’ve already made a few minor edits to previous posts in this series, so double check if you have critiques.)
Ah Debian. The Distro I keep saying I will try some day only to see Xubuntu work so well on my machines which kills any desire to play. Glad you are typing this up. Makes for a great read.
It’s sort of a draft for a new book, but I’ve already discovered the need to make some major changes.