There are also self extracting files which are typically bash shell scripts that when executed perform the needed operations. For example,
While this works fine, there are some significant difficulties if the installation is complex, involving multiple directories in different locations. A major problem is trying to keep your system up-to-date when you can't keep track of the files. So there are alternatives.
RPM is an acronym for Redhat Package Manager, so as you might guess, it's a Redhat invention. This scheme allows someone to gather files from all over a system and put them together in a file with a manifest (table of contents). When it is installed, it placess all of the files where needed,sets the permissions and ownership and logs the information on the system. This is very useful, because if you uninstall, you don't leave files all over the place, and you can query to system to see what is installed, included version numbers. All in all, a very nice capability and one that is being copied by other Linux versions.
The command for managing RPM files is, suprisingly, rpm. This is a fairly complex command, but you only need a few things to do most of what you need. Assume a package in a file named uncas-1.6.3.rpm.
To install this package you would enter:
-i tells rpm to install, while -v and -h simply provide a verify operation and an output to indicate progress. If you had a previous version installed and wanted to upgrade, you might do this:
If you try to install a newer package without uninstalling an earlier version or using the upgrade option, it will refuse.
To uninstall this package you would enter:
To query the system to see if a package is installed you might enter:
You don't have to give it the exact name (forutnately), just enough for it to do a search.
To verify that the files on a system are the same as the files in the original rpm, use verify:
This can be useful if you think someone has broken into your machine and possibly changed something.
The biggest problem with RPM's is that they don't necessarily have everything you need, so they have dependencies - other packages that must be installed first. This can be quite a headache as you chase down packages and install them one-at-a-time until you get everything you need.
So where can you find RPM files. One good place would be at redhat.com if you are running Redhat, but there are lots of other places on the web where the latest and greatest software is maintained, often in RPM format. Try some of these. The first one is very complete, but tends to stay more in the mainstream.
APT is an acronym for Advanced Package Manager and it is a creation of Debian, another Linux distribution. It has some significant advantages over RPM, the primary one being that it will automatically find and resolve dependencies, installing a package and all required supporting packages. The problem is that in order to do this, everything has to be available in an apt respository somewhere.
To use apt, you must first install it. Go to one of the major RPM sites and download the apt rpm. It will have a name of this form:
You probably don't want to download the package where the i386 is replaced with src.
Then install it:
After installing apt, check the man pages and you will find that apt-get is the primary command and /etc/apt is the primary configuration directory.
Looking in /etc/apt, you see a number of files, but the important one is sources.list as it has a list of the apt repositories. These are places where apt will look to add new software to your system or to upgrade what already exists. The file as it is initially installed is mostly commented out, so you need to add a few things so that it is useable for your purposes. Add the following lines:
# Fedora Linux 3
rpm http://ayo.freshrpms.net fedora/linux/3/i386 core updates freshrpms
rpm http://ayo.freshrpms.net fedora/linux/3/i386 tupdates
rpm-src http://ayo.freshrpms.net fedora/linux/3/i386 core updates freshrpms
rpm-src http://ayo.freshrpms.net fedora/linux/3/i386 tupdates
# New RPMS
rpm http://newrpms.sunsite.dk/apt/ redhat/en/i386/fc3 newrpms
# Dag RPM Repository for Fedora Core 3
rpm http://apt.sw.be fedora/3/en/i386 dag
# Dries Repository for Fedora Core 3
rpm http://apt.sw.be dries/fedora/fc3/i386 dries
# ATrpms for Fedora Core 3
# Possible sections: at-stable, at-good, at-testing, at-bleeding
rpm http://apt.atrpms.net fedora/3/en/i386 at-stable
rpm-src http://apt.atrpms.net fedora/3/en/i386 at-stable
The other thing you need to do is to insure that your system can validate the downloads from these sites. You do this by importing the PGP encryption key which is used to sign each file in the repository. This can be done with the following:
To use apt to update your system software you will use the apt-get command. The form of an apt-get command is:
For example, the first command you need to execute on your system will update the local package database with the data from the repositories that you have selected.
You will see lots of stuff on the screen as it scans the repsoitories.
Now you should perform a simple test to verify the integrity of your package cache and the dependcies:
Everything should be copasetic, so now you can bring your system up-to-date with:
apt will determine which packages that you have that are out-of-date and give you information about what it is going to do. If you tell it to proceed it will update all of the packages that it can. Remember, this only applies to software packages that have been put in the apt format and placed in an apt repository. It is common to run the upgrade command with the -u option so that it will show all the packages being upgraded. Just in case you want to be cautious.
If you want to install a new package you can do that with apt:
The package names you use do not include versioning information or suffixes. So for example, if you want to install a movie player, you can simply enter:
without worrying about the version. apt-get will find the latest version and any needed dependency upgrades and take care of it for you.
You can also remove packages like this:
If you want to know what packages are available you can use the apt-cache command to search the database:
will return all packages containing dvd in their name. You can find out more about a package with:
Finally, your cache can become cluttered with retrieved packages which you can remove to save disk space with:
Of course this means that if you need this package again for some reason, it will have to be downloaded.
If you use the form:
only packages that can no longer be downloaded are removed.
apt is a powerful tool and it can do other things, including an upgrade of your system to a new distribution version. It can also work with source packages and allow you to create your own local packages for it to manage. These features are discussed in the man page and also in the apt HowTo.
Go to /etc/yum/repos.d and list the files. You will find some configuration files for fedora, which should include a fedora core repo, a development repo, an updates repo and an updates-testing repo. Edit each of these and set the enabled bit to 1 for those you want and 0 for those you don't. Normally, avoid the updates-testing repo unless you might really want some new thing. In addition, create a file named dag.repo and add the following:
# Dag name=Dag RPM Repository for Fedora Core baseurl=http://apt.sw.be/fedora/$releasever/en/$basearch/dag/ # baseurl=http://rh-mirror.linux.iastate.edu/pub/dag/fedora/$releasever/en/$basearch/dag/ enabled=1 gpgcheck=1
And create a freshrpms.repo and add the following:
[core] name=FreshRPMS-Core baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/core #baseurl=http://ayo.us5.freshrpms.net/fedora/linux/$releasever/$basearch/core enabled=1 gpgcheck=1 #[extras] #name=Fedora Linux $releasever - $basearch - extras #baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/extras #baseurl=http://ayo.us5.freshrpms.net/fedora/linux/$releasever/$basearch/extras #enabled=0 gpgcheck=1 #[alternatives] #name=Fedora Linux $releasever - $basearch - alternatives #baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/alternatives #baseurl=http://ayo.us5.freshrpms.net/fedora/linux/$releasever/$basearch/alternatives #enabled=0 gpgcheck=1 [updates] name=FreshRPMS-Updates baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/updates #baseurl=http://ayo.us5.freshrpms.net/fedora/linux/$releasever/$basearch/updatesenabled=1 gpgcheck=1 [freshrpms] name=FreshRPMS-Fresh baseurl=http://ayo.freshrpms.net/fedora/linux/$releasever/$basearch/freshrpms #baseurl=http://ayo.us5.freshrpms.net/fedora/linux/$releasever/$basearch/freshrpms enabled=1 gpgcheck=1
In these entries, the forms \emph{$releasever} and \emph{$basearch} are used to make the files insensitive to changes in Linux version. This allows you to keep the files up-to-date without editing them. Yum will determine the appropriate values for you.
You could have placed all of these entries in /etc/yum.conf just as was discussed with Apt. Also, Apt has a directory for separate files for the repositories named sources.list.d. So the two are very similar in structure, but you should choose one or the other.
Now that you have the repositories, some of the Yum commands are: \begin {tabular}{l @{-} p{4.5in}} yum update & Update all the packages on your system. This is the first thing you should do. \\ yum install & Install a package as specified. \\ yum clean & Clean the local cache. You must specify what is to be cleaned. \\ yum info & Output information on a specified package or all packages. \\ yum search & Search for specific packages. \\ \end {tabular}