install and managing software

43
Install and managing software

Upload: trista

Post on 08-Jan-2016

33 views

Category:

Documents


0 download

DESCRIPTION

Install and managing software. Install and managing software. Installing software on Linux Managing installed software. 1. I nstalling software on Linux. Obtaining Linux software Installing software from source packages Installing software packages. Obtaining Linux Software. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Install and managing software

Install and managing software

Page 2: Install and managing software

Install and managing software

1. Installing software on Linux

2. Managing installed software

Page 3: Install and managing software

1. Installing software on Linux

Obtaining Linux software Installing software from source packages Installing software packages

Page 4: Install and managing software
Page 5: Install and managing software
Page 6: Install and managing software

• Obtaining Linux Software

Sources for Linux Software Verifying Your Downloads

Page 7: Install and managing software

Sources for Linux Software

CDs or DVD ( For example, the SUSE Linux 10.1 DVD includes hundreds of application and service RPMs in the subdirectories of the suse directory )

Web sites

Ex: http://www.pureftpd.org

http://www.rpmfind.net/linux/RPM SourceForge (http://sourceforge.net)

Page 8: Install and managing software

In addition, you can also use the following Web sites to download software for your Linux system:

Tucows http://linux.tucows.com Freshmeat http://www.freshmeat.net Linux Online http://www.linux.org/apps

Page 9: Install and managing software

Verifying Your Downloads

The good news is that you can check your files after they are downloaded to verify that the copy on your local system is the same as the copy on the server you downloaded from. This can be done by creating and comparing the file’s checksum value against the source file. A checksum is a value generated by calculating the contents of a file using a Message Digest 5 (MD5) algorithm

Page 10: Install and managing software

After downloading the file, you could then use the sum command from the shell prompt to calculate a checksum for the local copy of the file. To do this, you simply enter

sum path/filename The sum utility reads the file and generates a

checksum value for the file and displays it onscreen. You can then compare the checksum for the original file on the Web site against the checksum for the local file. If the checksums are the same, you’re in good shape. That means the files are identical. No corruption occurred during transit.

Page 11: Install and managing software

• Installing Software from Source Code Preparing the installation files Compiling the executable Installing the executable

Page 12: Install and managing software

Preparing the Installation File Because these applications are distributed as

tarballs, you must first unzip and untar them after downloading them from the Internet before you can do anything else.

(tar –zxvf ./filename) Ex: tar –zxvf ./pure-ftpd-1.0.21.tar.gz

Page 13: Install and managing software

With the files extracted, we next need to prepare the installation files to be compiled.To run this command, verify that you’re in the directory created when the tarball was extracted. Then enter ./configure at the shell prompt

Page 14: Install and managing software

Compiling the Executable

At this point in the process, the program you want to install still only exists as source code in your file system. Before you can run it, you must convert the text-based source code into a binary executable file. This is done using the make command. The make command calls your system’s C compiler (such as gcc) and directs it to read the source code files, using the specifications and options listed in the Makefile file, and generate a compiled executable file.

Page 15: Install and managing software

This is done by entering make at the shellprompt without any options while you are still in the directory created when you untarred the tarball file.

Page 16: Install and managing software

Installing the Executable To actually install the program on your system,

you use the make command a second time. However, this time you specify a target with make named INSTALL.

To do this, make sure you’re still in the directory created when you untarred the tarball file. Then enter

make install

at the shell prompt

Page 17: Install and managing software

• Installing Software Packages

The role and function of a package manager Installing RPM packages

Page 18: Install and managing software

The Role and Function of a Package Manager

Install new packages Update existing packages Verify package files Query installed packages Uninstall packages

Page 19: Install and managing software

To make this happen, the RPM Package Manager has its own database, stored in

/var/lib/rpm, that it uses to keep track of what packages are installed in the system. Whenever you install, uninstall, or update a package, the appropriate changes are made to this database.

Page 20: Install and managing software

Installing RPM Packages

Page 21: Install and managing software

Package Name This part of the file name simply identifies the name of the package. In this example, the name of the package is acroread.

Version Number This part of the file name specifies the version of the software in the package. In this case, the software version is 7.0.5

Release Number This part of the file name indicates the current release of the software version. On occasion, errors are encountered in the process of creating an RPM package. (15)

Page 22: Install and managing software

Release Number

fcx Specifies that the package is intended for Fedora Core version x. For example, fc4 indicates the package is for Fedora Core 4.

rhlx Specifies that the package is intended for Red Hat Linux version x.

susexxx Specifies that the package is intended for SUSE Linux version xxx. For example, suse101 indicates that the package is intended for SUSE Linux 10.1.

Page 23: Install and managing software

Architecture Type This part of the file name specifies the CPU architecture that the software inside the package will run on. In the preceding example, the architecture is specified as i586. That means the software will run on any Intel Pentium or later CPU

i386 Specifies that the software will run on an Intel 80386 or later CPU.

i686 Specifies that the software will run on an Intel Pentium II or later CPU.

athlon Specifies that the software is intended to run on an AMD Athlon CPU.

Page 24: Install and managing software

Architecture Type ppc Specifies that the software is intended to

run on the PowerPC CPU. noarch Specifies that the package is not

architecture-dependent.

Page 25: Install and managing software

you can also use the rpm command to check the authenticity of the package. This is done by entering

rpm - -checksig package_ filename Install package using the rpm command:

rpm –i package_filename

ex:

rpm –i armagetron-0.2.7.1-38.i586.rpm

Page 26: Install and managing software

Some Linux administrators prefer it this way; others prefer to see some visual queues that indicate the progress of the installation. This can be done using

rpm -ihv package_filename The –h option tells rpm to print hash marks

on the screen as a progress indicator. The –v option tells rpm to operate verbosely,

printing output to the screen.

Page 27: Install and managing software

One of the fantastic features of the rpm utility is that it automatically calculates dependencies for you. You need to understand that a given Linux software package may be dependent upon another package being installed on the system before it can work properly. If this is the case, the dependent package is called a dependency.

When you run the rpm utility, it queries the package you want to install and automatically checks to see if you have the dependent packages installed. If not, it will generate an error and prompt you to install the necessary packages required for the software to work.

Page 28: Install and managing software

If you want to check for dependencies without actually installing the software, you can use the –test option with the rpm utility. If there are any failed dependency tests, they will be printed on the screen, allowing you to install the necessary software. You can skip the dependency tests completely and install the package even if dependent software isn’t present (not a good idea, by the way) by using the –nodeps option with rpm.

Page 29: Install and managing software

2. Manage Installed Software Uninstalling software Updating software Querying packages Verifying packages

Page 30: Install and managing software

• Uninstalling software

Uninstalling software compiled from source code

Uninstalling RPM packages

Page 31: Install and managing software

Uninstalling Software Compiled from Source Code

The uninstall process can vary slightly from product to product. Some applications or services may include an uninstall script in the files you extract from the tarball. If this is the case, you can execute this script to uninstall the application from your system.

Page 32: Install and managing software

Uninstalling Software Compiled from Source Code

Other products may include an UNINSTALL target in their Makefile file. If this is the case, you must first run configure from the directory created when you originally extracted the downloaded tarball file, just as you did when you first installed the software. Then, instead of running make install, you run make uninstall. This will cause the make utility to follow the instructions in the uninstall portion of the Makefile file to remove the software from your system

Page 33: Install and managing software

How do you know what method to use?

The tarball you downloaded should include a README file of some sort that documents both the install and the uninstall process for the particular software you are working with. Check this file first. If the information isn’t available, then check the FAQ or knowledgebase on the Web site of the organization that produced the software. One of these resources should provide you with the steps you need to follow to uninstall the software.

Page 34: Install and managing software

Uninstalling RPM Packages Syntax:

rpm –e package_name For example, we installed the armegetron-

0.2.7.1-38.i586.rpm package

using rpm. We could uninstall this same package by entering

rpm –e armagetron

at the shell prompt.

Page 35: Install and managing software

• Updating Software

Syntax:

rpm –U package_name ex:

rpm –U gftp-2.0.18-23.i586.rpm

Page 36: Install and managing software

• Querying Packages

Syntax:

rpm –q Using the –q option, you can list all the

packages installed on the system, view the version and release number of a specific package installed on the system, or view details about a package.

Page 37: Install and managing software

For example, if you want to generate a list of all packages installed on the system, you would enter rpm –qa. A list of installed packages will then be displayed on the screen.

Be warned that the list will probably be very long! If you need information about a specific package, you can use the following options with –q:

–i This option displays summary information about a specific package.

Page 38: Install and managing software

--whatrequires This option displays a list of packages that require the specified packages. For example, entering rpm –q --whatrequires postfix will display a list of packages that require the postfix package.

–l This option displays a list of files that are included in an RPM package.

--provides This option displays the functionality the specified package supplies.

--requires This useful option displays the functionality required by the specified package.

Page 39: Install and managing software

• Verifying Packages (Xác minh)

In addition to querying packages, the rpm utility can also be used to verify packages on your system. As you are probably (painfully) aware, software can get corrupted, deleted, or otherwise messed up on any given computer system, regardless of the operating system. You can use the rpm utility to verify your installed packages and make sure everything is working the way it is supposed to. This is done using the –V option. Syntax: rpm -V package_name

Page 40: Install and managing software

Ex: rpm –V gftp You can also verify all packages on the system by entering rpm –Va

Page 41: Install and managing software

If an error does occur, rpm prints out the error message and the associated file name, as shown in Figure

Page 42: Install and managing software

The error messages generated during the verification process follow the syntax of:

SM5DLUGT c file_name The parameters in the error message stand for the following:

S Indicates a problem in the size of a file.

M Indicates a problem with a file’s mode.

5 Indicates a problem with the MD5 checksum of a file.

D Indicates a problem with a file’s revision numbers.

L Indicates a problem with a file’s symbolic link.

Page 43: Install and managing software

U Indicates a problem with a file’s ownership.

G Indicates a problem with a file’s group.

T Indicates a problem with the modification time of a file.

c Indicates the specified file is a configuration file.

file_name Specifies the name of the file that failed verification.