When ever I decide to download and install a software on Linux, I am given the choice of a plethora of packages to download - each targeted at a particular distribution. And many times different versions of the same distributions needing different packages. For example, if I am using Fedora Core 2 and I want to download and install a software, then it will have separate packages for debian, fedora, redhat, mandrake and so on ; and I have to choose the package targeted at fedora. And if by any chance you don't have a package of the software for your distribution, you might have to download the source and compile it yourself and install it.
Two days back, I decided to download and install the Super Tux game on Linux. When I visited their site, I found that they had only one single binary package targeted at all Linux flavours which I found really surprising. I read a little bit more and came to realize that they have used autopackage to distribute their software.
What is autopackage ?In a end users perspective, autopackage lets you install an up to date software without any hassles like dependency issues and more importantly, you don't have to choose which distro you run based on how many packages are available.
For developers, autopackage lets you create binary packages for Linux that will install on any distribution, can automatically resolve dependencies and can be installed using multiple front ends (command line, GUI etc).
Coming back to the story, I downloaded the file supertux-0.1.3.x86.package from the Super Tux game website which was a 6.7MB download. Then according to their directions, I set the executable bit for the software as follows :
$ chmod ugo+x supertux-0.1.3.x86.package
Note: You can also do this in KDE by right clicking the file, choosing properties and then clicking the permissions tab and checking the "is executable" checkbox.
Now I executed the file by double clicking on it. You could also execute the file in command line by entering the command :
$ bash supertux-0.1.3.x86.package
At the time of execution, I did not have autopackage installed on my system. So it offered to download and install the autopackage software from the net. This is the message I got:
autopackage for "SuperTux platform game"
The installation of this software requires some additional support code to be installed.
A] If the support code is found in a local directory, it will be used.
The file containing the support code will be called:
"autopackage.tar.bz2"
or
B] If there is an active Internet connection, the support code will be
downloaded from:
"http://autopackage.org/latest/autopackage.tar.bz2"
Proxy users should ensure the http_proxy environment variable is set, otherwise the download may fail.
Selection B --> OK to download and install support code now? (Y/n): Y
I typed 'Y' and it automatically downloaded the autopackage software (a small download) and installed it on my system. During installing, it gave me the choice of installing it system wide which I accepted for which I had to supply the root password.
After this the installation of the game started. Here also I was asked for the root password to install it system wide. And the installation completed without a hitch.
Things to remember
1) Autopackage installs the software by default in /usr directory. If you want to install it elsewhere, you have to modify the file /etc/autopackage/config and change the autopackage_prefix section to point to another location.
# FILE: /etc/autopackage/config
...
autopackage_prefix="/usr/local"
...
Or you can also use the --prefix switch while installing using command line.
2) Autopackage uses the package program to manage (install, uninstall) the softwares. For example, to uninstall the Super Tux game, I just run the following command by logging in as root :
# package remove supertux
It is as simple as that.
Advantages of Autopackage
- Supports automatic dependency resolution like in apt and emerge.
- One common package for all known Linux/Unix distributions.
- Double click and install softwares like in Windows OS.
- Choice of GUI based and command line method of installation.
- If you install using autopackage, it will not update the RPM database.
- There is no package signing.
- Autopackage cannot be used to build Linux distributions.
- Is not cross-platform. Supports only x86 and x86-64 (might change at a future date).
No comments:
Post a Comment