Dariusz on Software Quality

15/11/2012

Chrooted Debian / Ubuntu mini HOWTO

Filed under: en — Tags: , — dariusz.cieslak @

First question: why do you need local Debian-based install inside your Debian distro? Sometimes you want to check some experimental packages and don’t want to break your base system or start some service in isolated environment without virtualisation effort. Then chroot comes as an effective solution for you!

First of all you have the debootstrap program that is used to do all the job you need:

sudo apt-get install debootstrap

Then you select your favourite distro version and download URL:

sudo debootstrap –arch i386 squeeze /home/debian-chroot http://ftp.debian.org/debian

And you jump to your newly-installed system:

sudo chroot /home/debian-chroot

And: voila! Done!

13/08/2012

Downgrade Ubuntu/Debian using apt preferences

Filed under: en — Tags: — dariusz.cieslak @

There are people who prefer bleeding-edge software versions, other prefer stability over new features. I’m an advanced Linux user, however I fall into the latter category of users. Recently I discovered my current mixed-version Ubuntu is not as stable as I would like and I decided to revert to older version of Ubuntu (lucid).

Debian apt system allows to set preferences for packages and this method can be used to downgrade packages. First of all you have to declare sources of software of desired distro (lucid) in my case:

$ grep ^deb /etc/apt/sources.list
deb http://pl.archive.ubuntu.com/ubuntu/ lucid main restricted
deb http://pl.archive.ubuntu.com/ubuntu/ lucid-updates main restricted
deb http://pl.archive.ubuntu.com/ubuntu/ lucid universe
deb http://pl.archive.ubuntu.com/ubuntu/ lucid-updates universe
deb http://pl.archive.ubuntu.com/ubuntu/ lucid multiverse
deb http://pl.archive.ubuntu.com/ubuntu/ lucid-updates multiverse
deb http://security.ubuntu.com/ubuntu lucid-security main restricted
deb http://security.ubuntu.com/ubuntu lucid-security universe
deb http://security.ubuntu.com/ubuntu lucid-security multiverse

Then we can declare we prefer lucid even if current package in the system if newer:

$ cat /etc/apt/preferences.d/downgrade-to-lucid
Package: *
Pin: release a=lucid
Pin-Priority: 1010

Package: *
Pin: release a=lucid-updates
Pin-Priority: 1011

Package: *
Pin: release a=lucid-security
Pin-Priority: 1012

As you can see I added updates and security source pacages into account to have such updates already in my system.

12/01/2012

Configure locales under Ubuntu

Filed under: en — Tags: , , — dariusz.cieslak @

If you used to Debian you probably know that “dpkg-reconfigure locales” brings you locale selection tool. It’s not the case for Ubuntu. How to replace Debian’s behavior? Read below:

# grep pl_PL.UTF-8 /usr/share/i18n/SUPPORTED > /var/lib/locales/supported.d/local
# dpkg-reconfigure locales
   Generating locales...
     pl_PL.UTF-8... done
   Generation complete.

Above example show how to add pl_PL.UTF-8 locale.

09/11/2011

Building packages from sources using Debian/Ubuntu

Filed under: en — Tags: , — dariusz.cieslak @

Sometimes you want to install latest version of selected software package while keeping base system stable. Then installing from source is a safe option to proceed.

First, you have to include sources from fresh system version, below is example taken from Ubuntu, I selected natty (/etc/apt/sources.list):

deb-src http://pl.archive.ubuntu.com/ubuntu/ natty main restricted

Then you should refresh package list:

sudo apt-get update

and install dependencies:

sudo apt-get build-dep ccache

and finally build the new version of a package (note that no root account is needed for that step):

apt-get -b source ccache

As a result there’s a *.deb package, install it:

sudo dpkg -i ccache*.deb

That’s all!

18/05/2011

“No recommends” on Debian/Ubuntu by default

Filed under: en — Tags: — dariusz.cieslak @

Sometimes you want to install some packages quickly and you know exactly what components you need. Then installing uneccessary 20 MB (recommended/suggested packages) when you need just 200 kB package is just waste of your time and disk space. Here’s good news: you can easily tell apt not to install recommend (and/or suggested) packages to make installation faster:

echo 'APT::Install-Recommends "0"; APT::Install-Suggests "0";' \
    > /etc/apt/apt.conf.d/no-recommends

Older Posts »

Powered by WordPress