Linux For Cynics One user's experiences with Linux

24Apr/140

Debian Announces Long Term Support for Debian 6.0

squeeze

The Debian project is pleased to announce that although regular security support for Debian GNU/Linux 6.0 (code name "squeeze") will be terminated on 31 May, long term support for the distribution is going to be extended until February 2016, i.e. five years after the initial release. This effort is driven by various interested parties / companies which require longer security support.

Squeeze-LTS will only support i386 and amd64, rather than the full range of architectures. Users of other architectures are encouraged to upgrade to Debian 7 ("wheezy"). Additionally, a few packages will not be supported in the LTS version of the release, primarily some web-based applications which cannot be supported for the additional timeframe. A tool will be provided to detect such unsupported packages.

The release will not be handled by the Debian security team, but by a separate group of volunteers and companies interested in making it a success (with some overlap in people involved). Companies using Debian who are interested in aiding this effort should contact team@security.debian.org. Importantly, the success of Squeeze-LTS will be used to judge the viability of LTS support for Debian 7 ("wheezy") and Debian 8 ("jessie").

Tagged as: , No Comments
10Jun/130

Debian 7 “Wheezy” Released from Testing to Stable

Debian Wheezy is now the stable version. Notable is the inclusion of a version using GNU HURD as the kernel.

Go download it and tell me how it is!

1May/130

Virtual Richard Stallman

vrms is a package that will analyze the set of currently-installed packages on a Debian-based system, and report all of the packages from the non-free and contrib trees which are currently installed.

Just run this command and you can find out what software you have on your system that doesn't respect your freedom!

$ vrms

Here's the output on my Debian laptop:

                Non-free packages installed on x200

firmware-iwlwifi                    Binary firmware for Intel PRO/Wireless 3945 and 802.11
skype                               Wherever you are, wherever they are

                Contrib packages installed on x200

flashplugin-nonfree                 Adobe Flash Player - browser plugin

  2 non-free packages, 0.2% of 1164 installed packages.
  1 contrib packages, 0.1% of 1164 installed packages.

It's like having a little rms right on your command line!

To find out more about Richard Stallman and his political views, go to his personal page: stallman.org.

24Apr/130

Install Wifi Firmware and WPA Support in Debian

Debian is a wonderful distribution but it is a bit strict on what it comes packaged with. Most wifi cards do not have open drivers, so you have to install them from the non-free repos. Here's now to install them and use them with wpa-supplicant.

First, we need to add the non-free Debian repositories. Add these lines to the /etc/apt/sources.list file:

deb http://ftp.us.debian.org/debian/ wheezy main contrib non-free
deb-src http://ftp.us.debian.org/debian/ wheezy main contrib non-free
 
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free

Once the non-free repo is added, update and install the driver I need. You might need different firmware:

$ sudo apt-get update
$ sudo apt-get install firmware-iwlwifi

Also get the wireless-tools package:

$ sudo apt-get install wireless-tools

So we have the driver, but now we need to use it!

Since the iwlwifi module is automatically loaded for supported devices, we need to reload this module to access installed firmware:

$ sudo modprobe -r iwlwifi ; modprobe iwlwifi

Now we see if the device has an available interface:

$ sudo iwconfig

Yep! Mine is called wlan0. Connecting to a wpa secured wifi will be covered in the next post.

17Apr/130

Change the Hostname (Computer name) in Ubuntu

Changing your computer's name (also called the system's "hostname") in Ubuntu is simple. You just have to change two files and restart the computer. These instructions also work for Debian and Ubuntu-based distros (like Linux Mint). The files in question are /etc/hosts and /etc/hostname

1. Open /etc/hosts with sudo (or gksu if you're going to use something like gedit)

$ gksu gedit /etc/hosts

The file will look something like this:

127.0.0.1       localhost
127.0.1.1       current_hostname

Instead of current_hostname you'll see the hostname / computer name. Change it to whatever you want the new name to be. Save and close the file.

2. Open /etc/hosts with sudo (or gksu if you're going to use something like gedit)

$ gksu gedit /etc/hostname

This file just contains the hostname / computer name. Change it to whatever you want the new computer name to be. Make sure it matches the name you put in /etc/hosts. Save and close the file.

3. Restart your computer.

Tagged as: , No Comments
10Apr/130

Determine What Version of a Package is Installed on Ubuntu or Debian

If you want to find out what version of a package you have installed, dpkg will give you information concerning a package, including the version, if you use the "--status" option, like so:

$ dpkg --status packagename

where packagename is the package in question.

Now, it gives a lot more than the version.
For example,

$ dpkg --status openbox

Returns:

Package: openbox
Status: install ok installed
Priority: optional
Section: x11
Installed-Size: 1316
Maintainer: Debian QA Group 
Architecture: i386
Version: 3.5.0-7
Provides: x-session-manager, x-window-manager
Depends: libc6 (>= 2.2), libglib2.0-0 (>= 2.24.0), libice6 (>= 1:1.0.0), libobrender27 (>= 3.5.0), libobt0 (>= 3.5.0), libsm6, libstartup-notification0 (>= 0.7), libx11-6, libxau6, libxext6, libxinerama1, libxml2 (>= 2.7.4), libxrandr2, libxrender1
Pre-Depends: dpkg (>= 1.15.7.2)
Recommends: openbox-themes, obconf
Suggests: menu, ttf-dejavu, python, libxml2-dev
Breaks: menu (<< 2.1.12)
Conffiles:
 /etc/menu-methods/openbox 454ed1e8309e6fc60b0d16894d541dfd
 /etc/xdg/openbox/menu.xml 96647f77053f8d73987a6e2b77b18e8f
 /etc/xdg/openbox/rc.xml da6375c910abc7dfb69f26b6bd7deb70
 /etc/xdg/openbox/environment 34bbf463555dbfb8f97fe957489d73b7
 /etc/xdg/openbox/autostart 2e828424c93a51d910382b53a9729166
Description: standards compliant, fast, light-weight, extensible window manager
 Openbox works with your applications, and makes your desktop easier to manage.
 This is because the approach to its development was the opposite of what seems
 to be the general case for window managers.  Openbox was written first to
 comply with standards and to work properly.  Only when that was in place did
 the team turn to the visual interface.
 .
 Openbox is fully functional as a stand-alone working environment, or can be
 used as a drop-in replacement for the default window manager in the GNOME or
 KDE desktop environments.
 .
 Openbox 3 is a completely new breed of window manager.  It is not based upon
 any existing code base, although the visual appearance has been based upon
 that of Blackbox.  Openbox 2 was based on the Blackbox 0.65.0 codebase.
 .
 Some of the things to look for in Openbox are:
 .
  * ICCCM and EWMH compliance!
  * Very fast
  * Chainable key bindings
  * Customizable mouse actions
  * Window resistance
  * Multi-head Xinerama support!
  * Pipe menus
Homepage: http://www.openbox.org

So, to only see the version, just pipe the output of dpkg -status to grep, for example:

$ dpkg --status openbox | grep 'Version'

will output something like this:

Version: 3.5.0-7

Note, dpkg --status packagename can be replaced with any of the following:

$ dpkg -s packagename
$ dpkg-query --status packagename
$ dpkg-query -s packagename
Tagged as: , No Comments
5Apr/139

Install Spotify on Debian Testing (Wheezy)

If you follow the instructions on the Spotify Linux Preview website to install Spotify on Debian Wheezy, you will get the following error from apt:

The following packages have unmet dependencies:
spotify-client : Depends: libssl0.9.8 but it is not installable

The problem is that Spotify is hardlinked with libssl0.9.8, and the Wheezy repos only have libssl1.0. This is a very easy problem to rectify. Just go to the libssl0.9.8 package page for Squeeze and download the appropriate package for your architecture.
download_libssl
Then install the package, like so:

sudo dpkg -i /path/to/package.deb

(of course replace "/path/to/package.deb" with the actual location of the libssl0.9.8 package you just downloaded)

Now you should be able to install spotify-client by following spotify's instructions:

# 1. Add this line to your list of repositories by
#    editing your /etc/apt/sources.list
deb http://repository.spotify.com stable non-free

# 2. If you want to verify the downloaded packages,
#    you will need to add our public key
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 94558F59

# 3. Run apt-get update
sudo apt-get update

# 4. Install spotify!
sudo apt-get install spotify-client
27Mar/1317

Improve Font Rendering in Debian

After installing Debian Testing (Wheezy), and started using Firefox (aka Iceweazel), one of the first things I noticed is that the default font rendering in Debian is not pretty.

Luckily, fixing this is very straight foward. Create a file called .fonts.conf in your home directory, and put the following contents in it:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
 <match target="font">
  <edit mode="assign" name="rgba">
   <const>rgb</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="hintstyle">
   <const>hintslight</const>
  </edit>
 </match>
 <match target="font">
  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>
 </match>
  <match target="font">
    <edit mode="assign" name="lcdfilter">
      <const>lcddefault</const>
    </edit>
  </match>
</fontconfig>

This will enable subpixel-hinting and font-smoothing. Now just restart X.org (log out, then back in again). Read more here: http://wiki.debian.org/Fonts

Here's the before and after (before is on the left):
fontrendering_beforeandafter

18Mar/130

List Installed Packages in Debian or Ubuntu

In order to display the list of installed packages, use this command:

dpkg --get-selections

Chances are you have a lot of packages installed, so use grep to find something particular, for example, to see any packaged with the word "gnome" in their name:

dpkg --get-selections | grep gnome

Or, if you want to see how many packages you have installed, you can use the wc program:

dpkg --get-selections | wc

The first number is the number of lines dpkg output, and since there is one line per package, it is the number of packages installed.

15Mar/139

Minimal Debian Install

Here's my guide to installing a lean Debian desktop. I went through these steps on a Thinkpad X200. Your needs may vary. Skip the parts that don't apply to you. This post will get you from zero to a working desktop. I will cover additional configuration and customization in another post.

Debian Net Install

First, get the net installer here: Debian Install Images. I went with the current Testing version, Wheezy. It should be suitable for most desktop users.

Because this is a net install, make sure you have an ethernet connection. Wireless won't do.

I'm assuming intermediate level experience with Linux in this guide so I won't go through each step of the installation. I'll leave paritioning and all that to you.

Once you get to the "Select and install software" step, select only SSH Server, Laptop Tools, and System Utilities.

Install sudo

If you did not supply a root password, sudo is already set up and you can skip this step. If you did provide a root password, you need to do it yourself. Time to install sudo and add yourself to the sudo group. This is not strictly necessary, but there are many benefits to using sudo over su. Let's say your username is dave.

$ su
# apt-get install sudo
# adduser dave sudo
# exit

Log out and back in again and there we go!

Wireless

This isn't necessary if you don't have a wireless card, naturally.

As for me, this is a laptop, so I need to install wifi drivers. I installed using an ethernet cord but that won't do in the long run.

First, we need to add the non-free Debian repositories. Add these lines to the /etc/apt/sources.list file:

deb http://ftp.us.debian.org/debian/ wheezy main contrib non-free
deb-src http://ftp.us.debian.org/debian/ wheezy main contrib non-free
 
deb http://security.debian.org/ wheezy/updates main contrib non-free
deb-src http://security.debian.org/ wheezy/updates main contrib non-free

I wanted to use vim to do so, but it wasn't added. So, I installed vim:

$ sudo apt-get install vim

Once the non-free repo is added, update and install the driver I need. You might need different firmware:

$ sudo apt-get update
$ sudo apt-get install firmware-iwlwifi

Also get the wireless-tools package:

$ sudo apt-get install wireless-tools

So we have the driver, but now we need to use it!

Since the iwlwifi module is automatically loaded for supported devices, we need to reload this module to access installed firmware:

$ sudo modprobe -r iwlwifi ; modprobe iwlwifi

Now we see if the device has an available interface:

$ sudo iwconfig

Yep! Mine is called wlan0

Configuring your wifi can be done now through the terminal using wpa-supplicant, or you can wait until we have a GUI. I'm going to show you how to use wpa-supplicant because it's harder.

Time to use wpa-supplicant (installed with wireless-tools) to connect to my wireless network. Let's setup wlan0 with the SSID and PSK. Edit /etc/network/interfaces and add these lines:

auto wlan0
iface wlan0 inet dhcp
    wpa-ssid YOUR-SSID-HERE
    wpa-psk YOUR-PASSWORD-HERE

Now let's see if it worked.

$ sudo ifup wlan0
$ sudo ifconfig wlan0
$ ping router-ip-here
$ ping google.com

Yep! all good.

Desktop

Okay so installing X is very easy:

$ sudo apt-get install xorg

We could startx now, but that would just give us an xterm. So let's choose a window manager. I'm avoiding full-blown Desktop Environments (such as GNOME or KDE) because this is supposed to be a light-weight install.

My favorite tiling WM is dwm, and my favorite floater is Openbox. I think I'll install them both, as sometimes things work in Openbox and not in dwm (such as screen sharing in Google Hangouts...I dont know why).

First the easy one, Openbox:

$ sudo apt-get install openbox

Because the scripts in /etc/X11/Xsession.d will eventually run x-window-manager, which is presumably set to openbox via the alternatives mechanism (/usr/sbin/update-alternatives --display x-window-manager), at this point you could type

$ startx

And start using Openbox right away, but I'm going to focus on dwm since it's my favorite.

Install your favorite window manager or desktop environment. I like dwm. But, because dwm is configured by modifying the source code and recompiling, it is best not to install it through the repositories (although that is an option if you don't care to change the defaults). The best way to use dwm is by using git, modifying the source, and compiling it yourself. Here's a guide. It can be summarized as the following:

Installing dwm "properly" means downloading the source, modifying it to our liking, and compiling it. This is because dwm doesn't use configuration files or scripts to customize it, the source itself must be changed.

So that means we'll need gcc, et al. If you're a programmer you'd get these things anyway:

$ sudo apt-get install build-essential

dwm requires x11 development libraries, as well as Xinerama development libs (if you want dwm to support mult-monitor). So install those too:

$ sudo apt-get install libx11-dev libxinerama-dev

Now let's get the dwm source code. I'm gonna use git.

$ sudo apt-get install git

And get the source from the suckless git repo:

$ git clone http://git.suckless.org/dwm

That will create a directory called dwm.

$ cd dwm

Now make a copy of the config.def.h file so your configuration doesn't get clobbered if you download the source again:

$ cp config.def.h config.h

Make any changes you want to config.h. I won't go into it here.
And finally, compile and install dwm!

$ make clean install

In order to use dwm, we need to make startx use it. So let's create and modify our ~/.xinitrc

$ vim ~/.xinitrc

And add this line to the end of it:

exec dwm

Done!

Now just run:

$ startx

minimal_dwm

Now we have a desktop.

Sound

Let's install alsa.

$ sudo apt-get install alsa-base alsa-utils

And get it started:

$ alsactl init

And now test it to see if we can actually hear anything:

$ aplay /usr/share/sounds/alsa/*

Should hear a woman's voice saying "Front center" etc.

Something else you might start hearing is an annoying beep. This is called the PC bell. Disable that damned PC bell.