Software can come from several sources
Source code that needs to be compiled and installed
Binary executables
RPM packages
Debian packages
Most software packages require a large number of files: source code, image files, configuration files, etc
Windows will package these as zip files; Unix packages them as tar files
To create a tar file in a directory
will recursively collect all the files
tar -cf file.tar files...
To list a tar file contents
tar -lf file.tar
To unpack a tar file
tar -xf file.tar
There are many compression algorithms and tar can handle many of them
If it is compressed with compress
by convention it ends in .tar.Z
Unpack by
zcat file.tar.Z | tar -xf -
If it is compressed with gzip
by convention it ends in .tgz
Unpack by
tar -zxf file.tgz
If it is compressed with bzip2
by convention it ends in .bz2
Unpack by
tar -jxf file.bz2
There are many varieties of Unix: Linux, BSD, Solaris, ...
There are several architectures: 64-bit RISC, 686, 586, ...
Some programs need to be configured differently for the possible variations
Autoconf is used to set up software for automatic configuration. It is tricky, but not your concern here
If there is a file configure
in the
top-level directory of your package, then you need
to run it to setup the build environment
./configure
See for example, djmount-0.71.tar.gz (you may need to install the fuse-dev package first)
If the top level directory contains a Makefile
then make
is used to build the system
make
it is also used to install the system
make install
And to clean up afterwards
make clean
A simple Makefile is
file : file1.o file2.o
cc -o file file1.o file2.o
# note the line above starts with tab
file1.o : file1.c mytypes.h
cc -c file1.c
file2.o : file2.c mytypes.h
cc -c file2.c
Redhat-based systems use the rpm
package manager to build and install systems
To install a new package
rpm -i file.rpm
To update an existing package
rpm -u file.rpm
To remove an existing package
rpm -e package
To list the files in a package
rpm -q -l -p file.rpm
rpm will fail if other packages are required and they are not installed
Yum will try to install all necessary packages
yum -i file.rpm
Debian-based systems use their own package management, with .deb files
The command to install a package and its dependencies is
apt-get install package-name
The current package information is brought up to date by
apt-get update
To bring all your installed packages up to date,
apt-get upgrade
The tool dpkg
can be used to manipulate
packages, like rpm
aptitude search ~i |less
dpkg-query -W --showformat='${Package}\n'|less
Ubuntu:/Gnome "Ubuntu software centre"
Redhat/Gnome: "Applications -> System tools -> Add/remove software"
There are several different ways of installing software
Build from source
Run install scripts
Install or update RPM or DEB packages
proxy=http://mycache.mydomain.com:3128
# The account details for yum connections
proxy_username=yum-user
proxy_password=qwerty
See
Managing software with yum
Acquire::http::proxy "http://user:pass@host:port/";
I use the Software Centre to install Synaptic and from then on use Synaptic. It has
a configuration menu