SlideShare uma empresa Scribd logo
1 de 37
Installing and managing Linux software Amir khakshoor
package What is a package? When Linux developers create their software they typically bundle all the executable and data files into a single file called a "package" file.  Type of packages in software context: source code packages :  suite of files related to one program: source code, documentation, and configuration files. Binary packages:  source code packages that have been configured for a particular Unix variant or package manager program.
Software package Packages have different formats  Packages contain different control files  Where the rest of the files should be placed The permissions they should have  A list of prerequisite packages that are required for the package to function correctly
Main Package Formats in Linux Packages Distributed in Binaries or Source Code form Main Package Management Standards RPM (RedHat Package Manager) (.rpm) Introduced by RedHat and has been adopted by many other distributions (Fedora, Mandrake, SuSe) .  The most popular Linux package format DEB (Debian Package Manager) (.deb) Introduced by Debian distribution  Tarball files (.tar.gz/.tar.bz2) The old-fashioned way of distributing software in Linux/Unix Compatible with all distros 4
Package management system Def: collection of software tools to automate the process of installing, upgrading, configuring, and removing software packages for a computer's operating system in a consistent manner.{= install manager} Functions: Verifying file checksums to ensure correct and complete packages. Verifying digital signatures to authenticate the origin of packages. Applying file archivers to manage encapsulated files. Upgrading software with latest versions, typically from a software repository. Grouping of packages by function to help eliminate user confusion. Managing dependencies to ensure a package is installed with all packages it requires.
Package management system(continue) Repositories: give users more control over the kinds of software that they are allowing to be installed on their system Package formats: Each package manager relies on the format and metadata of the packages it can manage.  E.g. yum relies on rpm as a backend.  Common package management systems on:  Red Hat Linux systems : RPM, yum, apt4rpm. Debian Linux systems : Aptitude
Package management system(continue) yum is better than RPM (why)? install from network repositories it can find and install dependent packages needed by the packages you request In other words: resolve dependencies automatically.
RPM Terminology Naming convention:  all package files are labeled with highly identifiable names. {four-part name} dash (-) or a period (.) to separate labels Convention:  name-version-release.architecture.rpm E.g. kernel-smp-2.6.32.9-3.i686.rpm
RPM Terminology(continue) Table 2-1 Supported Architectures
RPM Terminology(continue) Architecture Compatibility :  more recent architectures typically run software that targets older architectures within the same family;  E.g. a 686-class (Pentium II / III / IV) machine runs files within i386, i486, i586, and i686 RPM package files. But: a 386-class (80386) machine runs files within i386
RPM Terminology(continue) Note: noarch in architecture label: indicates this is a special architecture such that the files in the package work on any architecture  Why? All files in package are interpreted scripts, not binary executables, or they are documentation.  usually only the root user can install packages.
Binary RPMs and Source RPMs binary RPM: has been compiled for a particular architecture. E.g., httpd-2.2.17-1.fc13.1.i686.rpm platform-independent binary RPMs: noarch{Applications written in Perl, Python, or other scripting languages} Source RPMs:  contain all the commands, usually in scripts, necessary to recreate the binary RPM. you can recreate the binary RPM at any time.
How login as another user? su : Substitute (switch) User Why? For installing software you need to be root! And so on. Without logging out!	 How to use? suuserid  note: defaultuserid= root
InstllingSoftware From RPM Files There are generally two ways to install RPM files manually.  using a file previously downloaded to your hard drive install the RPM from some sort of removable media such as a CD-ROM drive Use command “rpm” to install (in other word =upgrade).rpm file Most common usage: rpm -Uhv package_file.rpm 14
The RPM Command  rpm -Uvh is the command to install  package  -U qualifier is used for updating an RPM to the latest version -h qualifier gives a list of hash # characters during the installation  -v qualifier prints verbose status messages while the command is run rpm command options in depth: -i: installing specified Package(s) -e : uninstalling (Erasing) specified Package(s) -U :Upgrading= Erasing old one + Installing new one -q : Query whether specifed package exist and installed or not -V : Verifying Installed RPM Packages 15
The RPM Command (continue)  Options to use with –ioption: -v: print out verbose information as the command runs. -h: print a series of hash marks, #, to provide feedback that the command is still running. --excludedocs:  ignore documentation In RPM  --includedocs: reverse of --excludedocs. {Default Option} --replacepkgs: replace, or reinstall, packages it may have already installed.{Fresh Start} --replacefiles: Install package even if it replaces files from other packages --force:  A short hand for --replacepkgsand                         –-replacefiles --nodeps: skip the dependencies check --noscripts: skip running the pre- and post-installation scripts. = --noscripts= --nopre+ --nopost 16
The RPM Command (continue)  Options to use with –U option:  all of options that can used by –i option. Plus:   --oldpackage: install an older version of a package on top of a more recent one.{downgrade} Why installing an old one? Some bug or security vulnerability Newer one won't work with some other package 17
The RPM Command (continue)  Options to use with –q option:  --whatprovides [capability] : what package provides the specified capability. e.g. webserver Or : trace individual files: which package provides specified file. -i: Detailed information about specified package(s) -l: list files that are bundling in specified package --scripts: lists the scripts associated with a package. Note: RPM database itself is stored in the directory /var/lib/rpm/ 18
RPM command example 19 [root@bigboytmp]# rpm -Uvh mysql-server-3.23.58-9.i386.rpm Preparing...        ####################### [100%]   1:mysql-server   ####################### [100%] [root@bigboytmp]#
RPM Installation Errors  Sometimes RPM installations will fail giving Failed dependencies errors which really mean that a prerequisite RPM needs to be installed To get around this problem by run the rpm command with the --nodepsoption to disable dependency checks 20 [root@bigboytmp]# rpm -Uvh--nodeps mysql-3.23.58-9.i386.rpm
Yum (Yellowdog Updater, Modified) YUM adds automatic updates and package management, including dependency management, to RPM systems. Can works with repositories too.
Automatic Updates with yum  	The yum automatic RPM update program comes as a standard feature of Fedora Core. It has a number of valuable features:  You can configure the URLs of download sites you want to use. This provides the added advantage of you choosing the most reliable sites in your part of the globe.  yum makes multiple attempts to download RPMs before failing.  yum automatically figures out not only the RPMs packages that need updating, but also all the supporting RPMs. It then installs them all. 22
Working With yum. Search for a package when you know the name: $ yum list 'foo‘ Search for a package when you're not sure of the name{using REGX} $ yum search 'foo*' $ yum search '*foo?' install and remove a package or multiple packages:  # yum install 'foo' # yum remove 'foo' # yum install 'foo fie fofum' # yum remove 'foo fie fofum' Update an installed package: # yum update 'foo'
Working With yum.(continue) List available updates for installed packages: # yum list updates Update the whole system: # yum update Find out which package a file belongs to: $ yum provides ‘httpd.conf‘ See package groups for installing big clumps of stuff at once. And install, update and remove them. $ yum grouplist # yum groupinstall 'FTP Server' # yum groupupdate 'FTP Server' # yum groupremove 'FTP Server'
Installing Software From DEB Files Unlike Redhat or Frdora,theDebian and Ubuntu versions of Linux rely on packages in the DEB format Use dpkg --install command to install the .deb package 25 root@u-bigboy:~# dpkg--install ndiswrapper-utils_1.8-0ubuntu2_i386.deb Selecting previously deselected package ndiswrapper-utils. (Reading database ... 70221 files and directories currently installed.) Unpacking ndiswrapper-utils(from ndiswrapper-utils_1.8-0ubuntu2_i386.deb) ... Setting up ndiswrapper-utils(1.8-0ubuntu2) ... root@u-bigboy:~#
Compiling Software from Source Code What Compiling means? source code packages usually packaged in the tarball format. tarball? nickname for compressed archives created by the tar program Common file extension*.tar.gz or *.tgz.  Why Use source code in tarball files? Compatible with all Linux distributions
Compiling Software from Source Code(continue) Using Tar utility archive a directory with tar: $ tar -cf tarredfilename.tar Feather Add –v option to get a verbose description Unarchiving Files with tar: $ tar -xf labrea.tar unarchive selected files with tar: $ tar -xf labrea.tar mammoth List files in an archiving without actually unarchiving the file: $ tar -tf filename  see the names of the files as they're extracted from the archive.  $ tar -xvf filename
Compiling Software from Source Code(continue) Installing from source code step by step:  locate a source code package: Unix software archive on the Web  pick a consistent place to put them after download or transfer from a disk  We suggest using the /tmp{why?} You can also use the /usr/src directory,  unpack the archive $ tar xvffilename Change directory to decompressed file directory $ cd  /tmp/filename
Compiling Software from Source Code(continue) You should see README or INSTALL file. $ ls –ltr Read README or INSTALL file. For instruction to Compile. $ less README less INSTALL  Follow these general steps: Configuring the Package: configure, configure.pl, configure.sh, or some similar script. Configure script will run some tests on your machine. Run this: # ./configure Output after running configure script:  Makefile Building the Package.{= begin to compile the software.} Run this: # make
Compiling Software from Source Code(continue) Installing the Package: install the executable binary file as an actual program. Run this:  $ make install This command moves the binary into the proper directory (outside of /tmp) and installs any required configuration or documentation files that were included in the archive clean up: $ rmdir  /tmp/filename
Where to get used Packages Packages on Linux Installation CDs Manually Downloaded Packages two most common ways of getting packages are by manually using FTP or a Web browser 31
Popular Package Download Sites Redhat http://www.redhat.com/  http://www.rpmfind.net/  Fedora ftp://download.fedora.redhat.com/pub/fedora/linux/core/  http://download.fedora.redhat.com/pub/fedora/linux/core/ http://www.rpmfind.net/ 32
Popular Package Download Sites Debain http://packages.debian.org  Ubuntu http://packages.ubuntu.com  33
How to Download Software  Getting Software Using Web-Based FTP Browse the desired Web site until you find the link to the software package.  Click on the link for the desired software package.  Save the file to hard drive  Getting RPMs Using Command-Line Anonymous FTP 34
FTP Commands  Command 	Description 	 binary		Copy files in binary mode 	 cd			Change directory on the FTP server 	 dir			List the names of the files in the current remote 			directory 	 exit		Bye bye get		Get a file from the FTP server 	 lcd			Change the directory on the local machine 	 ls			Same as dir 	 mget		Same as get, but you can use wildcards like "*" 	 mput		Same as put, but you can use wildcards like "*" 	 passive		Make the file transfer passive mode 	 put		Put a file from the local machine onto the FTP 			server 	 pwd		Give the directory name on the local machine 	 35
How to Download Software Getting software 	using wget  The wget command can be used to download files quickly when you already know the URL at which the RPM is locate # wget http://linux.stanford.edu/pub//i386/RPMS/dhcp-3.0pl2-6.16.i386.rpm 36
Thanks for your patient. Any Question? Ask me now or Later on by email: khakshoor.amir@gmail.com

Mais conteúdo relacionado

Mais procurados

Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
Rohit Kumar
 

Mais procurados (20)

User administration concepts and mechanisms
User administration concepts and mechanismsUser administration concepts and mechanisms
User administration concepts and mechanisms
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt
 
Linux Troubleshooting
Linux TroubleshootingLinux Troubleshooting
Linux Troubleshooting
 
Linux introduction
Linux introductionLinux introduction
Linux introduction
 
Systems Administration
Systems AdministrationSystems Administration
Systems Administration
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
package mangement
package mangementpackage mangement
package mangement
 
Shell programming
Shell programmingShell programming
Shell programming
 
Nfs
NfsNfs
Nfs
 
Step for installing linux server
Step for installing linux serverStep for installing linux server
Step for installing linux server
 
Linux User Management
Linux User ManagementLinux User Management
Linux User Management
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
 
Install and configure linux
Install and configure linuxInstall and configure linux
Install and configure linux
 
Linux
Linux Linux
Linux
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
Introduction to Shell script
Introduction to Shell scriptIntroduction to Shell script
Introduction to Shell script
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
 
File system Os
File system OsFile system Os
File system Os
 
Nfs
NfsNfs
Nfs
 
Server configuration
Server configurationServer configuration
Server configuration
 

Semelhante a Software management in linux

101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management
Acácio Oliveira
 
InstallingRoRinLinux
InstallingRoRinLinuxInstallingRoRinLinux
InstallingRoRinLinux
tutorialsruby
 
InstallingRoRinLinux
InstallingRoRinLinuxInstallingRoRinLinux
InstallingRoRinLinux
tutorialsruby
 

Semelhante a Software management in linux (20)

101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management
 
101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management
 
101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management
 
2.5 use rpm and yum package management
2.5 use rpm and yum package management2.5 use rpm and yum package management
2.5 use rpm and yum package management
 
$ make install
$ make install$ make install
$ make install
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
RPM (LINUX)
RPM (LINUX)RPM (LINUX)
RPM (LINUX)
 
Unix Administration 2
Unix Administration 2Unix Administration 2
Unix Administration 2
 
Linux
Linux Linux
Linux
 
RPM Packaging 101 (Old)
RPM Packaging 101 (Old)RPM Packaging 101 (Old)
RPM Packaging 101 (Old)
 
Sahul
SahulSahul
Sahul
 
Sahul
SahulSahul
Sahul
 
Linux training
Linux trainingLinux training
Linux training
 
InstallingRoRinLinux
InstallingRoRinLinuxInstallingRoRinLinux
InstallingRoRinLinux
 
InstallingRoRinLinux
InstallingRoRinLinuxInstallingRoRinLinux
InstallingRoRinLinux
 
RHEL Log-files, RPM, Backup & Recovery
RHEL Log-files, RPM, Backup & RecoveryRHEL Log-files, RPM, Backup & Recovery
RHEL Log-files, RPM, Backup & Recovery
 
How to make debian package from scratch (linux)
How to make debian package from scratch (linux)How to make debian package from scratch (linux)
How to make debian package from scratch (linux)
 
How to Build Package in Linux Based Systems.
How to Build Package in Linux Based Systems.How to Build Package in Linux Based Systems.
How to Build Package in Linux Based Systems.
 
Linux
LinuxLinux
Linux
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Software management in linux

  • 1. Installing and managing Linux software Amir khakshoor
  • 2. package What is a package? When Linux developers create their software they typically bundle all the executable and data files into a single file called a "package" file. Type of packages in software context: source code packages : suite of files related to one program: source code, documentation, and configuration files. Binary packages: source code packages that have been configured for a particular Unix variant or package manager program.
  • 3. Software package Packages have different formats Packages contain different control files Where the rest of the files should be placed The permissions they should have A list of prerequisite packages that are required for the package to function correctly
  • 4. Main Package Formats in Linux Packages Distributed in Binaries or Source Code form Main Package Management Standards RPM (RedHat Package Manager) (.rpm) Introduced by RedHat and has been adopted by many other distributions (Fedora, Mandrake, SuSe) . The most popular Linux package format DEB (Debian Package Manager) (.deb) Introduced by Debian distribution Tarball files (.tar.gz/.tar.bz2) The old-fashioned way of distributing software in Linux/Unix Compatible with all distros 4
  • 5. Package management system Def: collection of software tools to automate the process of installing, upgrading, configuring, and removing software packages for a computer's operating system in a consistent manner.{= install manager} Functions: Verifying file checksums to ensure correct and complete packages. Verifying digital signatures to authenticate the origin of packages. Applying file archivers to manage encapsulated files. Upgrading software with latest versions, typically from a software repository. Grouping of packages by function to help eliminate user confusion. Managing dependencies to ensure a package is installed with all packages it requires.
  • 6. Package management system(continue) Repositories: give users more control over the kinds of software that they are allowing to be installed on their system Package formats: Each package manager relies on the format and metadata of the packages it can manage. E.g. yum relies on rpm as a backend. Common package management systems on: Red Hat Linux systems : RPM, yum, apt4rpm. Debian Linux systems : Aptitude
  • 7. Package management system(continue) yum is better than RPM (why)? install from network repositories it can find and install dependent packages needed by the packages you request In other words: resolve dependencies automatically.
  • 8. RPM Terminology Naming convention: all package files are labeled with highly identifiable names. {four-part name} dash (-) or a period (.) to separate labels Convention: name-version-release.architecture.rpm E.g. kernel-smp-2.6.32.9-3.i686.rpm
  • 9. RPM Terminology(continue) Table 2-1 Supported Architectures
  • 10. RPM Terminology(continue) Architecture Compatibility : more recent architectures typically run software that targets older architectures within the same family; E.g. a 686-class (Pentium II / III / IV) machine runs files within i386, i486, i586, and i686 RPM package files. But: a 386-class (80386) machine runs files within i386
  • 11. RPM Terminology(continue) Note: noarch in architecture label: indicates this is a special architecture such that the files in the package work on any architecture Why? All files in package are interpreted scripts, not binary executables, or they are documentation. usually only the root user can install packages.
  • 12. Binary RPMs and Source RPMs binary RPM: has been compiled for a particular architecture. E.g., httpd-2.2.17-1.fc13.1.i686.rpm platform-independent binary RPMs: noarch{Applications written in Perl, Python, or other scripting languages} Source RPMs: contain all the commands, usually in scripts, necessary to recreate the binary RPM. you can recreate the binary RPM at any time.
  • 13. How login as another user? su : Substitute (switch) User Why? For installing software you need to be root! And so on. Without logging out! How to use? suuserid note: defaultuserid= root
  • 14. InstllingSoftware From RPM Files There are generally two ways to install RPM files manually. using a file previously downloaded to your hard drive install the RPM from some sort of removable media such as a CD-ROM drive Use command “rpm” to install (in other word =upgrade).rpm file Most common usage: rpm -Uhv package_file.rpm 14
  • 15. The RPM Command rpm -Uvh is the command to install package -U qualifier is used for updating an RPM to the latest version -h qualifier gives a list of hash # characters during the installation -v qualifier prints verbose status messages while the command is run rpm command options in depth: -i: installing specified Package(s) -e : uninstalling (Erasing) specified Package(s) -U :Upgrading= Erasing old one + Installing new one -q : Query whether specifed package exist and installed or not -V : Verifying Installed RPM Packages 15
  • 16. The RPM Command (continue) Options to use with –ioption: -v: print out verbose information as the command runs. -h: print a series of hash marks, #, to provide feedback that the command is still running. --excludedocs: ignore documentation In RPM --includedocs: reverse of --excludedocs. {Default Option} --replacepkgs: replace, or reinstall, packages it may have already installed.{Fresh Start} --replacefiles: Install package even if it replaces files from other packages --force: A short hand for --replacepkgsand –-replacefiles --nodeps: skip the dependencies check --noscripts: skip running the pre- and post-installation scripts. = --noscripts= --nopre+ --nopost 16
  • 17. The RPM Command (continue) Options to use with –U option: all of options that can used by –i option. Plus: --oldpackage: install an older version of a package on top of a more recent one.{downgrade} Why installing an old one? Some bug or security vulnerability Newer one won't work with some other package 17
  • 18. The RPM Command (continue) Options to use with –q option: --whatprovides [capability] : what package provides the specified capability. e.g. webserver Or : trace individual files: which package provides specified file. -i: Detailed information about specified package(s) -l: list files that are bundling in specified package --scripts: lists the scripts associated with a package. Note: RPM database itself is stored in the directory /var/lib/rpm/ 18
  • 19. RPM command example 19 [root@bigboytmp]# rpm -Uvh mysql-server-3.23.58-9.i386.rpm Preparing... ####################### [100%] 1:mysql-server ####################### [100%] [root@bigboytmp]#
  • 20. RPM Installation Errors Sometimes RPM installations will fail giving Failed dependencies errors which really mean that a prerequisite RPM needs to be installed To get around this problem by run the rpm command with the --nodepsoption to disable dependency checks 20 [root@bigboytmp]# rpm -Uvh--nodeps mysql-3.23.58-9.i386.rpm
  • 21. Yum (Yellowdog Updater, Modified) YUM adds automatic updates and package management, including dependency management, to RPM systems. Can works with repositories too.
  • 22. Automatic Updates with yum The yum automatic RPM update program comes as a standard feature of Fedora Core. It has a number of valuable features: You can configure the URLs of download sites you want to use. This provides the added advantage of you choosing the most reliable sites in your part of the globe. yum makes multiple attempts to download RPMs before failing. yum automatically figures out not only the RPMs packages that need updating, but also all the supporting RPMs. It then installs them all. 22
  • 23. Working With yum. Search for a package when you know the name: $ yum list 'foo‘ Search for a package when you're not sure of the name{using REGX} $ yum search 'foo*' $ yum search '*foo?' install and remove a package or multiple packages: # yum install 'foo' # yum remove 'foo' # yum install 'foo fie fofum' # yum remove 'foo fie fofum' Update an installed package: # yum update 'foo'
  • 24. Working With yum.(continue) List available updates for installed packages: # yum list updates Update the whole system: # yum update Find out which package a file belongs to: $ yum provides ‘httpd.conf‘ See package groups for installing big clumps of stuff at once. And install, update and remove them. $ yum grouplist # yum groupinstall 'FTP Server' # yum groupupdate 'FTP Server' # yum groupremove 'FTP Server'
  • 25. Installing Software From DEB Files Unlike Redhat or Frdora,theDebian and Ubuntu versions of Linux rely on packages in the DEB format Use dpkg --install command to install the .deb package 25 root@u-bigboy:~# dpkg--install ndiswrapper-utils_1.8-0ubuntu2_i386.deb Selecting previously deselected package ndiswrapper-utils. (Reading database ... 70221 files and directories currently installed.) Unpacking ndiswrapper-utils(from ndiswrapper-utils_1.8-0ubuntu2_i386.deb) ... Setting up ndiswrapper-utils(1.8-0ubuntu2) ... root@u-bigboy:~#
  • 26. Compiling Software from Source Code What Compiling means? source code packages usually packaged in the tarball format. tarball? nickname for compressed archives created by the tar program Common file extension*.tar.gz or *.tgz. Why Use source code in tarball files? Compatible with all Linux distributions
  • 27. Compiling Software from Source Code(continue) Using Tar utility archive a directory with tar: $ tar -cf tarredfilename.tar Feather Add –v option to get a verbose description Unarchiving Files with tar: $ tar -xf labrea.tar unarchive selected files with tar: $ tar -xf labrea.tar mammoth List files in an archiving without actually unarchiving the file: $ tar -tf filename see the names of the files as they're extracted from the archive. $ tar -xvf filename
  • 28. Compiling Software from Source Code(continue) Installing from source code step by step: locate a source code package: Unix software archive on the Web pick a consistent place to put them after download or transfer from a disk We suggest using the /tmp{why?} You can also use the /usr/src directory, unpack the archive $ tar xvffilename Change directory to decompressed file directory $ cd /tmp/filename
  • 29. Compiling Software from Source Code(continue) You should see README or INSTALL file. $ ls –ltr Read README or INSTALL file. For instruction to Compile. $ less README less INSTALL Follow these general steps: Configuring the Package: configure, configure.pl, configure.sh, or some similar script. Configure script will run some tests on your machine. Run this: # ./configure Output after running configure script: Makefile Building the Package.{= begin to compile the software.} Run this: # make
  • 30. Compiling Software from Source Code(continue) Installing the Package: install the executable binary file as an actual program. Run this: $ make install This command moves the binary into the proper directory (outside of /tmp) and installs any required configuration or documentation files that were included in the archive clean up: $ rmdir /tmp/filename
  • 31. Where to get used Packages Packages on Linux Installation CDs Manually Downloaded Packages two most common ways of getting packages are by manually using FTP or a Web browser 31
  • 32. Popular Package Download Sites Redhat http://www.redhat.com/ http://www.rpmfind.net/ Fedora ftp://download.fedora.redhat.com/pub/fedora/linux/core/ http://download.fedora.redhat.com/pub/fedora/linux/core/ http://www.rpmfind.net/ 32
  • 33. Popular Package Download Sites Debain http://packages.debian.org Ubuntu http://packages.ubuntu.com 33
  • 34. How to Download Software Getting Software Using Web-Based FTP Browse the desired Web site until you find the link to the software package. Click on the link for the desired software package. Save the file to hard drive Getting RPMs Using Command-Line Anonymous FTP 34
  • 35. FTP Commands Command Description binary Copy files in binary mode cd Change directory on the FTP server dir List the names of the files in the current remote directory exit Bye bye get Get a file from the FTP server lcd Change the directory on the local machine ls Same as dir mget Same as get, but you can use wildcards like "*" mput Same as put, but you can use wildcards like "*" passive Make the file transfer passive mode put Put a file from the local machine onto the FTP server pwd Give the directory name on the local machine 35
  • 36. How to Download Software Getting software using wget The wget command can be used to download files quickly when you already know the URL at which the RPM is locate # wget http://linux.stanford.edu/pub//i386/RPMS/dhcp-3.0pl2-6.16.i386.rpm 36
  • 37. Thanks for your patient. Any Question? Ask me now or Later on by email: khakshoor.amir@gmail.com