Using Debian package archive as a configuration tool

Introduction

How often do you need to install your favorite Linux distribution in a single year either virtually or using real hardware? How frequently it happens that you just want to test new release of certain Linux distribution so you install it on different partition or simply virtually using your current system as a host. How often do you need to deploy a server which is a complete clone of the one you configured yesterday. The installation part of any Linux system today is a very straightforward process. Nonetheless, the hardest and the most tedious part comes with a fine tuning, customization and configuration of your system’s services as well as your own user environment. You can simply copy your custom system configuration files from one system to another but engaging in this concept this task can become quite disorganized, time consuming and most importantly error-prone.

In this article, we are going to take a different approach which involves a creation of a Debian package archive containing all required custom user and configuration files. First part of this article describes a rather simple way on how to create a Debian package archive containing all custom files followed by its installation. In the second part, we will look at the way on how to create our own very basic Debian Repository and use it to deploy a simple website including Apache webserver installation and configuration on a freshly installed Linux system.

Part1

In this section, we create and install simple Debian package. The package will accommodate some sample user data to serve as an example.

Creating a Debian Package

It took you a while to configure your desktop to have it the way it best suits your needs and convenience. In your custom environment, you may for example include some bash scripts, create several aliases using .bashrc file or changed default behavior of a vim text editor by altering .vimrc file. Furthermore, you may also have customized numerous system configuration files such as /etc/network/interfaces and so on. All this hard work can be saved within a Debian package and installed and removed from any system with a single dpkg command. As a first step we need to create a bare minimum skeleton for a Debian package. This is a fairly simple task as it only involves a single DEBIAN/control file. So let us start by creating a directory named “myenv”. This directory will hold all data for our own version 1.0 Debian package.

$ mkdir myenv

In the next step, we need to create a control file:

$ cd myenv
$ mkdir DEBIAN
$ vi DEBIAN/control

Read more

php virtual box web interface - localhost

phpVirtualBox installation on Debian Linux and Apache2 web server

phpVirtualBox allows you to manage locally or remotely your virtual machines running under VirtualBox via web-based interface. This config will describe an installation and basic configuration of phpVirtualBox on Debian Linux.

First, we need to install apache2 and php support:

# apt-get install libapache2-mod-php5 apache2 unzip wget

Next, we need to download phpVirtualBox. Please update your download link if necessary:

$ wget http://downloads.sourceforge.net/project/phpvirtualbox/phpvirtualbox-4.3-2.zip

Next, we will unzip and move the phpVirtualBoxcode into root directory of our apache2 webserver directory.

# unzip phpvirtualbox-4.3-2.zip
# mv phpvirtualbox-4.3-2/ /var/www/html/vbox

Read more

How to extract files from Debian package archive DEB

Very useful tool to extract files from Debian package archive DEB (*.deb) is ar command. First, let’s download a sample debian package hello_2.10-1_amd64.deb:

$ wget http://ftp.us.debian.org/debian/pool/main/h/hello/hello_2.10-1_amd64.deb

Now, that we have downloaded our sample Debian package we can use ar command to list its content. This can be achieved by t option:

$ ar t hello_2.10-1_amd64.deb 
debian-binary
control.tar.gz
data.tar.xz

Read more

How to list all files installed by the DEB package on Ubuntu/Debian Linux

The typical question after we install a new package on our system is that what are the actual files ware installed and what is their location. This may be even less obvious if the final executable name intended to start your program has slightly different name than the package its self. In the following example we are going to install a dummy package hello using apt-get command:

# apt-get install hello
...
(Reading database ... 7528 files and directories currently installed.)
Preparing to unpack .../hello_2.9-2+deb8u1_amd64.deb ...
Unpacking hello (2.9-2+deb8u1) ...
Setting up hello (2.9-2+deb8u1) ...

Read more

How to re-compile nginx webserver on Debian Linux

Let’s say you wish to do some changes to nginx source code in
order to add or remove some features before the actual nginx
package installation. In this config we will show how to recompile
nginx package on Debian linux.

First install package building tools:

# apt-get install dpkg-dev

Next, we need to install all nginx build dependencies:

# apt-get build-dep nginx

Read more

How to use jigdo downloader to download Debian Linux installation ISO images

Using jigdo downloader is a smarter and greener way of downloading data from the Internet mirrors. In comparison to a regular download where you point your browser or wget command to a single mirror URL, jigdo allows for multiple mirrors where the main feature is to re-use a previously download ISO image of a lower version to use as base and thus only new packages not downloaded previously are downloaded.

For this reason using jigdo is often faster way of downloading debian ISO images. To start using you first need to install it on your system:

# apt-get install jigdo-file

Once the jigdo-file package is downloaded your can start using jigdo do download official Debian instillation images. All you need is the URL of the *.jigdo file of the image you intend to download. In the example below we download Debian Jessie KDE iso image. First start jigdo:

$ jigdo-lite
Jigsaw Download "lite"
Copyright (C) 2001-2005  |  jigdo@
Richard Atterer          |  atterer.net
Getting mirror information from /etc/apt/sources.list

-----------------------------------------------------------------

Read more

Configuring Ubuntu style sudo privilege authorization on Debian Linux

The following lines will describe a procedure on how to mimic Ubuntu’s sudo privilege authorization system on Debian Linux. Sudo allows users to run programs with the authorization privileges of another user by supplying their own password for authentication.

If you have not done so yet, first install sudo package:

# apt-get install sudo

Once sudo is installed run:

# visudo

which allows you to edit the content of /etc/sudoers file. Change the content of this file as show below:

Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

root    ALL=(ALL:ALL) ALL
%admin ALL=(ALL) ALL
%sudo   ALL=(ALL:ALL) ALL

Read more

steam client installation updating debian 8 jessie linux

Installation of Steam Client on Debian Jessie 8 Linux 64-bit

This article describes an installation of the Valve Steam Linux client on Debian 8 Jessie 64bit. The article assumes that you have already installed your VGA drives required to run Steam client. Let’s start with steam client download:

$ wget http://media.steampowered.com/client/installer/steam.deb

Once you have client downloaded install the steam.deb package. Please not the below command requires root privileges and will show errors due to the dependency problems which we will address next:

# dpkg -i steam.deb
Selecting previously unselected package steam-launcher.
(Reading database ... 82762 files and directories currently installed.)
Preparing to unpack steam.deb ...
Unpacking steam-launcher (1.0.0.49) ...
dpkg: dependency problems prevent configuration of steam-launcher:
 steam-launcher depends on curl; however: 
  Package curl is not installed.
 steam-launcher depends on zenity; however:   
  Package zenity is not installed. 
                                            
dpkg: error processing package steam-launcher (--install): 
 dependency problems - leaving unconfigured
Processing triggers for mime-support (3.58) ...   
Processing triggers for hicolor-icon-theme (0.13-1) ...  
Processing triggers for man-db (2.7.0.2-5) ... 
Errors were encountered while processing:  
 steam-launcher   

Read more