Sponsored Content
Operating Systems Linux Fedora Newby: How to actually update software?! Post 302865753 by bakunin on Saturday 19th of October 2013 03:19:52 PM
Old 10-19-2013
Oh well...

What you have so verbosely told us about is the reason why "by untarring it" is considered the least preferable way to install software among SysAdmins.

Most software comes in "packages". Packages are bundles of files, but not only bundles of files. There are several packaging systems (you mentioned you use Linux: Linux has two competing systems and almost every Linux distribution uses one of these two". Other Unix systems have even different package systems) and all offer slightly different opportunities, so i will concentrate on the general aspects. You might want to find out how that translates to specifically your system later, once you got a grasp of the basics.

Installing software is not merely done by putting some files somewhere. The process of installing software usually consists of several steps:

- putting some files somewhere
- doing some changes in the system (creating users, setting up startup procedures for the software, ...)
- doing some basic configuration of the software

Then there are some additional aspects:

Software is oftenly depending on other software to work. Check if it is there.

Software changes. Maybe an older version is installed and has to be updated while preserving its configuration as good as possible. Also these "versions" should be tracked somehow.

It should be possible to remove software. Ideally installing a package and then uninstalling it should leave your system in exactly the same state as before.

All these things are taken care of by software packages. In most cases there is a special software, called "package manager", which allows you to install, remove and update/change software. It takes the information it works with from the packages it deals with. This package manager is called "apt" in Debian and Debian-like Linuxes (Ubuntu and others), in RedHat-like systems (RedHat, Fedora, CentOS and others) it is "rpm", in IBMs AIX it is "installp", and on on.

The packages themselves carry - along with the files they contain - some metainformation (version numbers, language codes for packages in various languages, dependencies of all sorts, ...) which is read and used by the package manager and things they do at various events. Events could be: prior installation, past installation, prior deinstallation, past deinstallation and so on.

Suppose we want to install "ssh", secure-shell, which you probably use to connect to your Linux boxes.

First, we need some version information. Let us say our ssh binaries are version 2.0. Now we now, that everything below 2.0 - 1.9, 1.5, 0.9, ... - is prior to this version (-> do an update) and everything above - i.e. 2.1 - is past this version (-> do not install or do only if some "force"-option is used). So this places the software in some version context.

Second, we need some files. This is the "untar it somewhere"-part of the installation and the smallest concern in package managers.

Third, the daemon part of "ssh", the "sshd" has to be started during system startup, so some files ("/etc/inittab", "/etc/rc.*/...", ...) have to be altered after installation. For this there has to be a "post-install" script, but also a "prior-deinstall"-script to undo these changes. For some packages certain administrative users have to be created (and deleted at deinstallation). Maybe filesystems have to be checked for enough free space (prior installation). You can imagine what the various pre- and post- installation, - deinstallation, -other-event-scripts are for.

Finally, "ssh" won't work on its own. It needs some SSL-library to be installed. If there is only one such library, this is the simplest form of dependency. Matters can be more complicated if one of several possible libraries has to be installed (either "OpenSSL" or "whateverSSL" but at least one of these two), if one of several packages has to be installed alongside (so-called corequisites), if a certain version (or version range) is needed, and so on. All these requirements are written into the meta-information of the package and dealt with by the package manager.

The last point is so-called "repositories": you don't want to hunt for packages on the net, put them in some nonedescript place and install them. Chances are, if you have many servers to administrate, you forget where you placed these packages if you do not organize and document cleanly their whereabouts. This is why all these package managers can deal with repositories: places where lots of packages are kept and can be installed. Prerequisite needs could (and can) be satisfied there automatically, different platforms (some packages are available in special builds for different systems) can automatically be served the package suitable for them, and so on.

I hope i have convinced you that you should never NEVER EVER "untar something somewhere", but always use a package to install and deinstall software. At work i even go so far to - when installing a non-packaged software - first create a package from the bunch of files and only then install that to a test system, let alone my production systems.

I hope this helps.

bakuin
 

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help for a newby

I am new to using nawk. When I put the following line in script file test1.awk I get the results: { print NR, length($0),NF} >nawk -f test1.awk head.txt 1 63 5 2 2622 188 3 2166 155 4 3192 228 5 2679 192 ..... but if I modify the test1.awk file to look like this: BEGIN {FS = ","}... (2 Replies)
Discussion started by: placroix1
2 Replies

2. OS X (Apple)

Software Update reporting script

I need a script that gets the output of softwareupdate -al on each machine (the list of available updates) and reports how many updates are needed in total by all the machines on the network, and the results to 4 different recipients. i.e. total patches required = 12 hostname1 =4 patch(es)... (1 Reply)
Discussion started by: glev2005
1 Replies

3. SuSE

update package/software questions

Hi, In SUSE linux, it looks like that I can update the package using YAST or install the package from source. So, which way works better? Also, if i install the package of new version. Do i need to remove/delete the old version package, or I just need to change my environments and keep the old... (0 Replies)
Discussion started by: jianma
0 Replies
All times are GMT -4. The time now is 07:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy