Metapackages

This assingment was performed following the instractions written by our teacher Tero Karvinen
(http://terokarvinen.com/2011/create-deb-metapackage-in-5-minutes) &
(http://terokarvinen.com/2011/update-all-your-computers-with-a-deb-repository)

Creating a metapackage

 

My goal was to create a packge that would install my favorite softwares. As a fan of digital art I chose to go with Inkscape and digiKam.

sudo apt-get update
sudo apt-get install equivs
I ran the update and installed Equivs so I would be able to create my package
equivs-control carolas-artpack.cfg

nano carolas-artpack.cfg
I created the source file and edited it by remowing the commends (#) where they wouldnt be needed. This is the outfit of my first metapackage (version 0.1):



Building and installation


After this was done I still needed to build the packge.
equivs-build carolas-artpack.cfg
The package was created succesfully in my desktop where I would let it be temporary.



sudo apt-get install gdebi
sudo gdebi -n carolas-artpack_0.1_all.deb

I got GDebi (package installer) and tested my brand new artpack and it seemed to work fine! Inkscape and digiKam were installed on my system.

Passing Lintian

sudo apt-get install lintian
lintian -c carolas-artpack_0.1_all.deb


When trying to validate my package with Lintian I encountered with two errors which were also related to each other.

E: carolas-artpack: debian-changelog-file-contains-invalid-email-address xubuntu@xubuntu
E: carolas-artpack: maintainer-address-malformed Live session user
xubuntu@xubuntu

I opened my source file (carolas-artpack) and made the needed changes:

Version: 0.1  -> 0.2
# Maintainer: Your name <yourname@example.com> -> Carola Wennermark <minoreth@gmail.com>

Lintian proofed file
I built the package just like before and installed the new 0.2-file with gdebi. This time the package passed Lintian and I did not get any errors.

Adding a package into repository


sudo apt-get install apache2
cd
mkdir public_html
cd public_html
mkdir -p repository/conf
nano repository/conf/distributions

I created a folder html_public, made a new directory for a configuration file with the following contents:

Codename: lucid
Components: main
Suite: lucid
Architectures: i386 amd64 source



cp /home/xubuntu/Desktop/carolas-artpack_0.2_all.deb /home/xubuntu/Desktop/public_html/carolas-artpack/carolas-artpack_0.2_all.deb

My metapackage was still in desktop so I was thinking of copying it to public_html but this time I decided to write it's location path when I added it to repository. In order to do so I installed reprepro.

sudo apt-get install reprepro
reprepro -VVVV -b repository/ includedeb lucid /home/xubuntu/Desktop/carolas-artpack_0.2_all.deb

The artpack was now in it's new location but I still needed to ran a command that would add it to "repository"-list so it could be used by all the users and clients.
reprepro -VVVV -b repository/ includedeb lucid /home/xubuntu/Desktop/carolas-artpack_0.2_all.deb


Now I could use the basic installation command for calling the created metapackage.

sudo apt-get update
sudo apt-get install carolas-artpack


Since the package was already installed and updated I naturally did not receive anything new but I could be quite sure my package was working and living well.

Inserting script into a metapackage


nano lotto

#!/bin/bash
echo "This week's lucky numbers are:"
echo $(expr $RANDOM % 40)-$(expr $RANDOM % 40)-$(expr $RANDOM % 40)-$(expr $RANDOM % 40)-$(expr $RANDOM % 40)-$(expr $RANDOM % 40)-$(expr $RANDOM % 40)

I started by creating my script that would show 7 lucky number's of the week. I would included it to my original package, carolas-artpack.

chmod +x lotto
./lotto


I ran the script and saw it working. Next I opened carolas-artpack and modified it once again. I added the script and changed the version number to 0.3.


I linked the "Files" to my lotto file, built the package and ran it.


Sources 
Lectures by Tero Karvinen
http://terokarvinen.com/2011/create-deb-metapackage-in-5-minutes/
http://terokarvinen.com/2011/update-all-your-computers-with-a-deb-repository/

http://www.computerhope.com/unix/ucp.htm
http://juhani-hynynen-linux.blogspot.fi/2014/02/h4-metapaketin-luominen-pakettivarasto.html
https://apps.ubuntu.com/cat/applications/precise/gdebi/


Based on Linux course by Tero Karvinen (http://terokarvinen.com)

Comments

Popular Posts