Linux Server – Task 4: Creating MetaPackages
Course
Linux palvelimena [Linux server] by Tero Karvinen at Haaga-Helia University of Applied Sciences
Task
Create a metapackage, which installs some software of your choosing, and make sure it passes the lintian check. Create a package repository with reprepro. Package one of your scripts, so that the package installs a new script for the users.
Testing environment
OS: Xubuntu Linux 13.10 “Saucy Salamander” 32-bit (persistent live USB drive)
System: HP EliteBook 2570p Notebook PC
Creating the metapackage
I began by installing equivs via the terminal: $ sudo apt-get install equivs. I then proceeded to create a metapackage in a folder named packages, in my home directory, with $ equivs-control jannes-metatest.cfg. After this I edited the file with $ nano jannes-metatest.cfg to contain only the following:
Section: misc
Priority: optional
Standards-Version: 3.9.2Package: jannes-metatest
Version: 0.1
Maintainer: Example
Depends: geoip-bin, pidgin
Description: Test MetaPackage
by Janne Varis
This particular package would now install GeoIP and Pidgin, once complete. To complete it, I executed $ equivs-build jannes-metatest.cfg in the terminal. Success. The resulting file: jannes-metatest_0.1_all.deb, located in the previously mentioned packages folder.
Passing lintian and testing
I tested the metapackage in lintian next with $ lintian jannes-metatest_0.1_all.deb. Success. I received no errors. Next I needed to install gdebi with $ sudo apt-get install gdebi-core -y to test my metapackage in use, which I did with $ sudo gdebi -n jannes-metatest_0.1_all.deb. The metapackage worked flawlessly, and GeoIP and Pidgin were installed.
Creating the package repository with reprepro
To begin, I created a folder structure in the public_html folder in my home directory by entering $ mkdir -p repository/conf in the terminal, after having navigated to the public_html folder. I also created a file within the same folder structure with $ nano repository/conf/distributions, in which I entered details about my Xubuntu version, some of them could be printed out by entering $ lsb_release -a in the terminal. My file looked like this:
Codename: saucy
Components: main
Suite: saucy
Architectures: i386 amd64 source
Next I installed reprepro with $ sudo apt-get install reprepro -y. Then I added the latest .deb package that I had made with $ reprepro -VVVV -b public_html/repository includedeb saucy packages/jannes-metatest_0.1_all.deb.
To install the repository to clients, I needed to edit repository.list by entering $ dsudoedit /etc/apt/sources.list.d/repository.list in the terminal. I added the following line and saved the changes:
deb http://127.0.0.1/~xubuntu/repository saucy main
Finally I ran $ sudo apt-get update to update the package list, and then sucessfully installed my own package with $ sudo apt-get install jannes-metatest -y.
Packaging a script
First I created a shell script as I had done previously (located in the packages folder this time). After this was done, I edited jannes-metatest.cfg to include the script (Files line) and the desired installation location, and upped the version number to 0.2:
Section: misc
Priority: optional
Standards-Version: 3.9.2Package: jannes-metatest
Version: 0.2
Maintainer: Example <example@example.com>
Depends: geoip-bin, pidgin
Files: mystatus /usr/local/bin/
Description: Test MetaPackage
by Janne Varis
Then I repeated the remaining steps, as described earlier in this post, to be able to install the package again and run the the script by entering $ mystatus in the terminal (with any user). Task complete.
References
Karvinen, Tero: Forensic File Recovery with Linux (http://terokarvinen.com/2013/forensic-file-recovery-with-linux)
Karvinen, Tero: Lessons 2014-2-10, Linux palvelimena [Linux server] (http://terokarvinen.com/2013/aikataulu-%E2%80%93-linux-palvelimena-ict4tn003-11-ja-12-kevaalla-2014)
About
This document can be copied and edited according to the GNU General Public License (version 3 or newer). http://www.gnu.org/licenses/gpl.html
Based on a course by Tero Karvinen, http://www.iki.fi/karvinen
Blog Hits
- 15,881 hits
Tag Cloud
5v analog in android emulator android sdk apache apk apt get arduino arduino uno breadboard cordova api cordova game digital pin distance meter eclipse google play ground hot air balloon game hp elitebook html janne varis jumper wire kernel komentorivi lamp led linux live CD mobile app development mysql phonegap php phpmyadmin prototype resistor saucy salamander scripting sensor server solderless sudo terminal testaus tool työasemat ja tietoverkot ubuntu ultrasonic sensor usb a to b web xubuntuRecent Posts
Archives
Categories
- Android (11)
- Arduino (7)
- BUS4TN007-5 – Building a prototype (7)
- BUS4TN008-3 – Mobile application development (11)
- Free software (2)
- ICT1TN002-25 – Työasemat ja tietoverkot (5)
- ICT4TN003-12 – Linux server (7)
- JavaScript (9)
- jQuery (8)
- LAMP (4)
- Linux (14)
- Logs (1)
- Lokit (2)
- Ohjelmointikielet (1)
- OpenSSH (3)
- PhoneGap (9)
- Security (1)
- Ubuntu (7)
- Vapaat sovellukset (1)
- WordPress.org (2)
- Xubuntu (7)