SlideShare uma empresa Scribd logo
1 de 56
Baixar para ler offline
Installing Software, Part 2




       Kevin B. O'Brien
 Washtenaw Linux Users Group




         Washtenaw Linux Users Group   1
Package Tool Levels 1

        GUI Package Tool




     High-Level Package Tool




     Low-Level Package Tool




      Washtenaw Linux Users Group   2
Package Tool Level 2
●   For newcomers, the easiest level to work at
    is the GUI Package Tool
●   That is what we looked at in the first
    presentation
●   But a GUI is just a front-end for what you
    can do on the command line
●   The command line is much more powerful


                   Washtenaw Linux Users Group    3
Package Tool Level 3
●   Anything you can do with a GUI you can do
    on a command line
●   But the command line will let you do more
    than the GUI will
●   When the GUI has trouble with a package
    install you will generally need to use the
    command line to fix the problem
●   These are all administrative tasks, so run
    them as root or use sudo
                  Washtenaw Linux Users Group    4
Two flavors
●   While we looked at three GUI tools in the
    previous presentation, here we will only
    look at two sets of command line tools
●   They are YUM (and RPM) and APT (and
    DPKG)
●   They work with RPM and Debian packages
    respectively
●   There are others, but once you learn the
    basic principles you can pick up the others
    pretty easily shouldLinux Users need to
                   Washtenaw
                             you Group            5
RPM
●   RPM stands for Red Hat Package Manager
●   Red Hat is the major distro for corporate
    and server center environments
●   Many major distros have adopted RPM as
    well: OpenSUSE, Mandriva, etc.
●   RPM can be run by itself from the
    command line, or you can use an
    intermediate tool like YUM (Yellowdog
    Updater, Modified)
                  Washtenaw Linux Users Group   6
YUM 1

“Yum is an automatic updater and package
installer/remover for rpm systems. It
automatically computes dependencies and
figures out what things should occur to install
packages. It makes it easier to maintain
groups of machines without having to
manually update each one using rpm.”

http://yum.baseurl.org/
                 Washtenaw Linux Users Group      7
YUM 2
●   Although there are GUI front-ends for YUM, we
    will focus on the command line use
    (PackageKit, which we covered in the first
    presentation, is the default for Fedora since
    version 9)
●   YUM is pretty simple
●   To install a program, type
    yum install <package_name>
●   Remember that all of these commands must be
    run as root or using sudo
                    Washtenaw Linux Users Group   8
YUM 3
●   What happens when you enter this
    command?
●   YUM checks the database of packages
    available in the repositories it knows about
●   If it finds the package, it then checks the
    headers of the package to discover any
    dependencies
●   It then prepares to download and install all
    of the files needed to get your package up
    and running Washtenaw Linux Users Group        9
It's Not There?
●   What if you get an error that there is no such
    package?
●   That means that it is not in any of the
    repositories that your system knows about
●   Do a Google search (or Bing, if you really must)
    to find the repository. Many companies
    maintain repos for the major two systems (e.g.
    Google)
●   If that does not work, you may need to resort to
    more drastic measures, covered in a future
    presentation      Washtenaw Linux Users Group  10
Repositories
●   We covered this in some detail in the
    previous presentation
●   These are online collections of software
    packages that you can download and
    install
●   You will have the best results using
    repositories that are designed for your
    distro
●   These can be created by the distro itself, or
    by third-parties (e.g. Miro)
                   Washtenaw Linux Users Group    11
Repositories 2
●   Adding a repository is easiest with the GUI
    front-ends because they do so much of it
    for you
●   But you can add one if you know how to
    use a text editor




                  Washtenaw Linux Users Group     12
Adding a repo 1
●   Example, adding Google's Linux repo
●   As root, add the following to a file called
    google.repo in /etc/yum.repos.d/:

    [google]
    name=Google – i386
    baseurl=http://dl.google.com/linux/rpm/s
    table/i386
    enabled=1
    gpgcheck=1
●   http://www.google.com/linuxrepositories/
    yum.html      Washtenaw Linux Users Group 13
Adding a repo 2
●   So, you first need to be able to run a text
    editor as root (or by using sudo)
●   Then you need to create a file in a
    specified directory (/etc/yum.repos.d/)
●   The file needs to have a name that
    identifies it, and an extension of *.repo.
    You can pick the name you want to use,
    but it should be descriptive enough that
    you can find it if needed.
                   Washtenaw Linux Users Group    14
Adding a repo 3
●   Finally, you have to enter some structured
    information into this text file
●   The last line, gpgcheck=1, will cause it to
    automatically download and add a GPG
    signature while you are installing it




                   Washtenaw Linux Users Group    15
Adding a Repo 4
●   To check, try adding the Google repo as
    shown above
●   Then open PackageKit, and update your
    package lists
●   Then run a search for “google”
●   You will see lots of available packages
●   Then check your Software Sources, and
    see it listed

                  Washtenaw Linux Users Group   16
Adding a Repo 5




   Washtenaw Linux Users Group   17
YUM 4
●   So, with the new Google repository added,
    let's say you wanted to install the new
    Google browser, Chrome, all you do is
    yum install google-chrome
●   And if you later change your mind, it is
    simply
    yum remove google-chrome




                  Washtenaw Linux Users Group   18
Updating Repositories
●   You want to keep your information on what is in
    the repos up-to-date
●   You can get a manual update any time by
    entering yum update
●   To automate this more, edit the file
    /etc/yum/yum-updatesd.conf (Note: This file
    may not exist at first, so you would need to create it
    with a text editor)



                       Washtenaw Linux Users Group           19
yum-updatesd.conf 1
●   This is the configuration file for yum-
    updatesd
●   Instructions can be found at
    http://linux.die.net/man/5/yum-
    updatesd.conf
●   You can set the interval to check the repos
    here



                   Washtenaw Linux Users Group    20
yum-updatesd.conf 2
●   You can set it to notify you in several ways;
    probably e-mail will be the easiest.
●   You could set it to install updates
    automatically, or to just download them
    automatically




                  Washtenaw Linux Users Group       21
YUM upgrades 1
●   Generally speaking, update means to
    check the info on what the latest versions
    are of your packages
●   It is only informational
●   Upgrade means to actually download and
    install the newest version




                   Washtenaw Linux Users Group   22
YUM upgrades 2
●   So, if you learned (through an update)
    there was a new version of Google Chrome
    that you wanted to install you would type
    yum upgrade google-chrome




                 Washtenaw Linux Users Group    23
YUM process summarized 1
●   You can add repos to your collection
●   You can then update the info in them to
    make sure it is current, and set this up to
    happen automatically in yum-
    updatesd.conf
●   You can upgrade packages
●   You can install new packages


                   Washtenaw Linux Users Group    24
YUM process summarized 2
●   You can remove ones you don't need any
    more
●   And all of this can be done at the command
    line




                 Washtenaw Linux Users Group     25
YUM resources
●   http://www.linuxpromagazine.com/Issues/2009
    /103/DELICIOUS
●   http://linux.die.net/man/8/yum
●   http://yum.baseurl.org/




                   Washtenaw Linux Users Group    26
APT, the Debian way
●   The other major package management
    system is APT (Advanced Package Tool),
    which is used in Debian and related distros
    (Ubuntu being a major one here)
●   This works a lot like yum, which is not
    surprising since they are doing the same
    things



                  Washtenaw Linux Users Group     27
Repositories
●   Just as with YUM, you need to maintain
    your repository information when using
    APT
●   This is kept in a file
    /etc/apt/sources.list
●   Here, each repo has a line in this single file
●   For example, here is the main Debian repo
    deb http://http.us.debian.org/debian
    stable main contrib non-free

                    Washtenaw Linux Users Group      28
Repository lines 1
●   The first entry “deb”, says that is a repo
    containing binary packages for Debian
●   If they contained source code, the first item
    would be “deb-src”
●   In either case, this is followed by the address of
    the repo. These are most often http, but can
    also be ftp, ssh, or point to a local file



                     Washtenaw Linux Users Group    29
Repository Lines 2
●   This is followed by the name of the
    distribution; in Debian is might be “stable”,
    in Ubuntu it might be “jaunty”.
●   The remaining fields are optional, but add
    some more description




                   Washtenaw Linux Users Group      30
Managing Repositories 1
●   Adding a repo is as simple as adding a line
    to /etc/apt/sources.list
●   As root, or using sudo, use a text editor to add
    a line to the list to add a repository
●   To remove one, you can just delete the line, but
    it is easier and safer to just comment out the
    line by putting “# “ in front of the line (pound
    sign and a space)
●   To re-enable the repo, just remove the
    comment
                     Washtenaw Linux Users Group   31
Managing Repositories 2
●   As with YUM, you want to keep everything
    up-to-date
●   APT keeps information about the contents
    of each repository, and about what
    packages you have installed, in a local
    database




                 Washtenaw Linux Users Group   32
Managing Repositories 3
●   You can update the information about each
    repo with apt-get update
●   Remember, this is an administrative task,
    so either run as root or use sudo for all
    commands




                  Washtenaw Linux Users Group   33
Packages 1
●   You can install packages (e.g. Google Chrome)
    by
    apt-get install google-chrome
●   If you later change your mind, just
    apt-get remove google-chrome
●   As with YUM, if you get an error that the
    package could not be found, you should do a
    search to see if there is a repository that
    contains it

                    Washtenaw Linux Users Group   34
Packages 2
●   Many companies will set up repositories for
    the major distros (e.g. Google)




                  Washtenaw Linux Users Group     35
More APT 1
●   If you damage an install, or just think something
    went wrong, you can force a reinstall
    apt-get --reinstall install pine




                    Washtenaw Linux Users Group    36
More APT 2
●   You can also upgrade your packages
       – Always do an update first to make
          sure you have the latest information
       – Then apt-get -u upgrade
       –   The “-u” switch causes the command
            to display a list of all of the
            packages that will be upgraded.
            You wouldn't do this blind!

                  Washtenaw Linux Users Group    37
APT and Upgrades
●   If you run this upgrade, sometimes it will tell
    you that some packages were not upgraded,
    that the upgrades were “held back”. This can be
    due to breaking a dependency, or because of a
    new dependency
●   For new dependencies, you can install the
    needed packages
●   You can also use APT to find out which
    packages have upgrades available:
    apt-show-versions -u
                    Washtenaw Linux Users Group   38
Distribution Upgrades
●   If you have a completely new distribution
    version (common with Ubuntu, for instance,
    which releases new versions every 6
    months)
    apt-get -u dist-upgrade




                 Washtenaw Linux Users Group     39
APT resources
●   http://www.debian.org/doc/manuals/apt-howto/




                  Washtenaw Linux Users Group      40
The Lowest Level
●   Recall that there are three levels in
    package management
●   Our first presentation focused on GUI front
    ends
●   This presentation has so far focused on the
    middle level, using the command line
●   There is also the lowest level


                   Washtenaw Linux Users Group    41
Package Tool Levels

       GUI Package Tool




    High-Level Package Tool




    Low-Level Package Tool




     Washtenaw Linux Users Group   42
RPM and DPKG
●   For our two package management
    systems, the lowest levels are RPM (Red
    Hat Package Manager) and DPKG (Debian
    package)
●   These are most often used when there is a
    package available, but it is not in a
    repository
●   For example, a web site may offer a
    package with an extension *.rpm or *.deb
                 Washtenaw Linux Users Group    43
RPM Install 1
●   For example, suppose you needed to install
    Cinelarra for a 64-bit system, and you don't
    have it in a repository
●   But you find this:
    cinelerra-2.1-
    0.15.20081102.fc9.x86_64.rpm
●   This is an RPM package, which you can install
    rpm -i cinelerra-2.1-
    0.15.20081102.fc9.x86_64.rpm

                     Washtenaw Linux Users Group   44
RPM Install 2
●   This command invokes RPM, tells it to install
    (-i), and gives it the name of the package to
    install
●   This is still package management. RPM is
    doing a bunch of things as part of the
    installation process
        –   Performing dependency checks.
        –   Checking for conflicts.
        –   Performing any tasks required before the install.
        –   Deciding what to do with config files.
                        Washtenaw Linux Users Group       45
RPM Install 3
    –   Unpacking files from the package and putting
         them in the proper place.
    –   Performing any tasks required after the install.
    –   Keeping track of what it did. (i.e. updating the
         database)
●   RPM can also perform an install over the
     Internet
     rpm -i
     ftp://ftp.gnomovision.com/pub/rpms/foo
     bar-1.0-1.i386.rpm

                       Washtenaw Linux Users Group         46
RPM Install 4
●   If you want to see some of the activity, add
    a “v” option to the command
    rpm -iv <package name>
●   If you are the impatient kind who likes to
    see progress bars, add an “h” option
    rpm -ivh <package name>




                  Washtenaw Linux Users Group      47
RPM Erase 1
●   In RPM, removing a package is called “erase”
    rpm -e <package name>
●   Again, this is doing a lot more than simply
    deleting a couple of files
        –   It checks the RPM database to make sure that
               no other packages depend on the package
               being erased.
        –   It executes a pre-uninstall script (if one exists).
        –   It checks to see if any of the package's config
               files have been modified. If so, it saves copies
               of them.
                         Washtenaw Linux Users Group          48
RPM Erase 2
        –   It reviews the RPM database to find every file
               listed as being part of the package, and if they
               do not belong to another package, deletes
               them.
        –   It executes a post-uninstall script (if one exists).
        –   It removes all traces of the package (and the
               files belonging to it) from the RPM database.
●   There is no “v” option for the erase command,
    but there is a variation called “vv” that gives you
    a lot of information
    rpm -evv <package name>
                         Washtenaw Linux Users Group          49
RPM Upgrade
●   There is an upgrade option as well
    rpm -U <package name>
●
    Note the capital “U” here
●   Essentially, what this command does
    is a combination of install and erase. It
    installs the new version and erases
    the old version, all in one go.


                  Washtenaw Linux Users Group   50
RPM Upgrade Remorse
●   Suppose you upgraded a package you
    really love to the newest version
●   You try to run it, and your screen goes
    blank
    rpm -Uv --oldpackage                    <package name>
●   This is like “upgrading” to the older version
●   Note: If you can boot to a command prompt
    you can do this

                   Washtenaw Linux Users Group               51
DPKG 1
●   As with RPM, sometimes you can only find
    a *.deb file to install from
●   The commands are pretty similar
    dpkg -i gedit-2.12.1.deb
●   As with RPM, the DPKG package manager
    is doing a lot in the background
       –   It is checking and resolving dependencies
       –   It is installing any other packages needed
       –   It is updating the database, etc.
                     Washtenaw Linux Users Group        52
DPKG 2
●   In DPKG you remove a package if you
    don't want it any more
    dpkg -r gedit
●   Another option lets you remove all of the
    configuration files as well
    dpkg -P gedit
●   Upgrading a package uses the install
    command
    dpkg -i gedit-2.12.2.deb

                  Washtenaw Linux Users Group   53
DPKG 3
●   One of my favorites is a command to use
    to help clean up a problem that has come
    up when I tried to use a more high-level
    package manager
    dpkg –configure -a
●   If something goes wrong in the middle of
    an install, this cleans up the database



                  Washtenaw Linux Users Group   54
Resources
●   RPM
      –   http://www.faqs.org/docs/securing/chap3sec20.
            html
      –   http://www.rpm.org/max-rpm-snapshot/
●   DPKG
      –   http://linuxhelp.blogspot.com/2005/12/concise-
            apt-get-dpkg-primer-for-new.html
      –   http://www.cyberciti.biz/howto/question/linux/
            dpkg-cheat-sheet.php

                    Washtenaw Linux Users Group            55
Final Thoughts
●   The four package managers we covered in
    this presentation (YUM, RPM, APT, DPKG)
    all have a lot more capabilities than this
    one presentation could cover. Check the
    man pages for a full description of what
    they can do.
●   One more time, remember that all of these
    commands are administrative commands,
    and you need to run them as root, or
    precede them with “sudo”
                 Washtenaw Linux Users Group     56

Mais conteúdo relacionado

Mais procurados

Yum package manager
Yum package managerYum package manager
Yum package managerLinuxConcept
 
Android on Intel Architecture: ROM Cooking Tutorial
Android on Intel Architecture: ROM Cooking TutorialAndroid on Intel Architecture: ROM Cooking Tutorial
Android on Intel Architecture: ROM Cooking TutorialRon Munitz
 
Puppet managed loadays
Puppet managed loadaysPuppet managed loadays
Puppet managed loadaysloadays
 
HowTo Install openMPI on Ubuntu
HowTo Install openMPI on UbuntuHowTo Install openMPI on Ubuntu
HowTo Install openMPI on UbuntuA Jorge Garcia
 
Red Hat - LVM - Mazenet Solution
Red Hat - LVM - Mazenet SolutionRed Hat - LVM - Mazenet Solution
Red Hat - LVM - Mazenet SolutionMazenetsolution
 
Get to know linux - First steps with Ubuntu
Get to know linux - First steps with UbuntuGet to know linux - First steps with Ubuntu
Get to know linux - First steps with UbuntuMaja Kraljič
 
Batch file programming
Batch file programmingBatch file programming
Batch file programmingswapnil kapate
 
The implementation of ldrp (with rear)
The implementation of ldrp (with rear)The implementation of ldrp (with rear)
The implementation of ldrp (with rear)loadays
 
Batch File Programming
Batch File ProgrammingBatch File Programming
Batch File ProgrammingFrz Khan
 
Basics of Batch Scripting
Basics of Batch ScriptingBasics of Batch Scripting
Basics of Batch ScriptingArik Fletcher
 
LivePC creation webcast
LivePC creation webcastLivePC creation webcast
LivePC creation webcastkelvin
 
Batch programming and Viruses
Batch programming and VirusesBatch programming and Viruses
Batch programming and VirusesAkshay Saini
 
Guide to open suse 13.2 by mustafa rasheed abass & abdullah t. tua'ama..super...
Guide to open suse 13.2 by mustafa rasheed abass & abdullah t. tua'ama..super...Guide to open suse 13.2 by mustafa rasheed abass & abdullah t. tua'ama..super...
Guide to open suse 13.2 by mustafa rasheed abass & abdullah t. tua'ama..super...Mustafa AL-Timemmie
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot processsagarpdalvi
 

Mais procurados (20)

Yum package manager
Yum package managerYum package manager
Yum package manager
 
Android on Intel Architecture: ROM Cooking Tutorial
Android on Intel Architecture: ROM Cooking TutorialAndroid on Intel Architecture: ROM Cooking Tutorial
Android on Intel Architecture: ROM Cooking Tutorial
 
Puppet managed loadays
Puppet managed loadaysPuppet managed loadays
Puppet managed loadays
 
HowTo Install openMPI on Ubuntu
HowTo Install openMPI on UbuntuHowTo Install openMPI on Ubuntu
HowTo Install openMPI on Ubuntu
 
2.Accessing the Pi
2.Accessing the Pi2.Accessing the Pi
2.Accessing the Pi
 
Red Hat - LVM - Mazenet Solution
Red Hat - LVM - Mazenet SolutionRed Hat - LVM - Mazenet Solution
Red Hat - LVM - Mazenet Solution
 
Get to know linux - First steps with Ubuntu
Get to know linux - First steps with UbuntuGet to know linux - First steps with Ubuntu
Get to know linux - First steps with Ubuntu
 
Batch file programming
Batch file programmingBatch file programming
Batch file programming
 
The implementation of ldrp (with rear)
The implementation of ldrp (with rear)The implementation of ldrp (with rear)
The implementation of ldrp (with rear)
 
linux
linuxlinux
linux
 
Batch File Programming
Batch File ProgrammingBatch File Programming
Batch File Programming
 
File systems for Embedded Linux
File systems for Embedded LinuxFile systems for Embedded Linux
File systems for Embedded Linux
 
Basics of Batch Scripting
Basics of Batch ScriptingBasics of Batch Scripting
Basics of Batch Scripting
 
LivePC creation webcast
LivePC creation webcastLivePC creation webcast
LivePC creation webcast
 
Batch FIles
Batch FIlesBatch FIles
Batch FIles
 
Open_suse
Open_suseOpen_suse
Open_suse
 
Batch programming and Viruses
Batch programming and VirusesBatch programming and Viruses
Batch programming and Viruses
 
Guide to open suse 13.2 by mustafa rasheed abass & abdullah t. tua'ama..super...
Guide to open suse 13.2 by mustafa rasheed abass & abdullah t. tua'ama..super...Guide to open suse 13.2 by mustafa rasheed abass & abdullah t. tua'ama..super...
Guide to open suse 13.2 by mustafa rasheed abass & abdullah t. tua'ama..super...
 
LinuxTag2012 Rear
LinuxTag2012 RearLinuxTag2012 Rear
LinuxTag2012 Rear
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 

Semelhante a Install Software at the Command Line

Software management in linux
Software management in linuxSoftware management in linux
Software management in linuxnejadmand
 
InstallingRoRinLinux
InstallingRoRinLinuxInstallingRoRinLinux
InstallingRoRinLinuxtutorialsruby
 
How tos nagios - centos wiki
How tos nagios - centos wikiHow tos nagios - centos wiki
How tos nagios - centos wikishahab071
 
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 managementAcácio Oliveira
 
Making the Move to Linux from an Enterprise Perspective
Making the Move to Linux from an Enterprise PerspectiveMaking the Move to Linux from an Enterprise Perspective
Making the Move to Linux from an Enterprise PerspectiveAll Things Open
 
Respositórios do Ubuntu, santo apt-get e outras coisas
Respositórios do Ubuntu, santo apt-get e outras coisasRespositórios do Ubuntu, santo apt-get e outras coisas
Respositórios do Ubuntu, santo apt-get e outras coisasQuefo.me
 
(Practical) linux 104
(Practical) linux 104(Practical) linux 104
(Practical) linux 104Arie Bregman
 
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 managementAcácio Oliveira
 
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 managementAcácio Oliveira
 
How to start Django automatically after restarting development or local syste...
How to start Django automatically after restarting development or local syste...How to start Django automatically after restarting development or local syste...
How to start Django automatically after restarting development or local syste...Vidhi_Khatri
 
Linux System Administration
Linux System AdministrationLinux System Administration
Linux System AdministrationJayant Dalvi
 
RHEL Log-files, RPM, Backup & Recovery
RHEL Log-files, RPM, Backup & RecoveryRHEL Log-files, RPM, Backup & Recovery
RHEL Log-files, RPM, Backup & RecoveryAneesa Rahman
 

Semelhante a Install Software at the Command Line (20)

Software management in linux
Software management in linuxSoftware management in linux
Software management in linux
 
6 - Package Management in Red Hat
6 - Package Management in Red Hat6 - Package Management in Red Hat
6 - Package Management in Red Hat
 
InstallingRoRinLinux
InstallingRoRinLinuxInstallingRoRinLinux
InstallingRoRinLinux
 
How tos nagios - centos wiki
How tos nagios - centos wikiHow tos nagios - centos wiki
How tos nagios - centos wiki
 
Linux
LinuxLinux
Linux
 
Linux Day2
Linux Day2Linux Day2
Linux Day2
 
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
 
Linux workshop
Linux workshopLinux workshop
Linux workshop
 
RPM (LINUX)
RPM (LINUX)RPM (LINUX)
RPM (LINUX)
 
Making the Move to Linux from an Enterprise Perspective
Making the Move to Linux from an Enterprise PerspectiveMaking the Move to Linux from an Enterprise Perspective
Making the Move to Linux from an Enterprise Perspective
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Linux
LinuxLinux
Linux
 
Respositórios do Ubuntu, santo apt-get e outras coisas
Respositórios do Ubuntu, santo apt-get e outras coisasRespositórios do Ubuntu, santo apt-get e outras coisas
Respositórios do Ubuntu, santo apt-get e outras coisas
 
(Practical) linux 104
(Practical) linux 104(Practical) linux 104
(Practical) linux 104
 
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
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
How to start Django automatically after restarting development or local syste...
How to start Django automatically after restarting development or local syste...How to start Django automatically after restarting development or local syste...
How to start Django automatically after restarting development or local syste...
 
Linux System Administration
Linux System AdministrationLinux System Administration
Linux System Administration
 
RHEL Log-files, RPM, Backup & Recovery
RHEL Log-files, RPM, Backup & RecoveryRHEL Log-files, RPM, Backup & Recovery
RHEL Log-files, RPM, Backup & Recovery
 

Mais de Kevin OBrien

Diffie_Hellman-Merkle Key Exchange
Diffie_Hellman-Merkle Key ExchangeDiffie_Hellman-Merkle Key Exchange
Diffie_Hellman-Merkle Key ExchangeKevin OBrien
 
Password best practices and the last pass hack
Password best practices and the last pass hackPassword best practices and the last pass hack
Password best practices and the last pass hackKevin OBrien
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory StructureKevin OBrien
 
Hardware Discovery Commands
Hardware Discovery CommandsHardware Discovery Commands
Hardware Discovery CommandsKevin OBrien
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linuxKevin OBrien
 
Installing Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System ConsiderationsInstalling Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System ConsiderationsKevin OBrien
 
The ifconfig Command
The ifconfig CommandThe ifconfig Command
The ifconfig CommandKevin OBrien
 
Find and Locate: Two Commands
Find and Locate: Two CommandsFind and Locate: Two Commands
Find and Locate: Two CommandsKevin OBrien
 
The Shell Game Part 3: Introduction to Bash
The Shell Game Part 3: Introduction to BashThe Shell Game Part 3: Introduction to Bash
The Shell Game Part 3: Introduction to BashKevin OBrien
 
The Shell Game Part 2: What are your shell choices?
The Shell Game Part 2: What are your shell choices?The Shell Game Part 2: What are your shell choices?
The Shell Game Part 2: What are your shell choices?Kevin OBrien
 
The Shell Game Part 1: What is a shell?
The Shell Game Part 1: What is a shell?The Shell Game Part 1: What is a shell?
The Shell Game Part 1: What is a shell?Kevin OBrien
 

Mais de Kevin OBrien (18)

American icon pmi
American icon   pmiAmerican icon   pmi
American icon pmi
 
Tls 1.3
Tls 1.3Tls 1.3
Tls 1.3
 
Forward Secrecy
Forward SecrecyForward Secrecy
Forward Secrecy
 
Diffie_Hellman-Merkle Key Exchange
Diffie_Hellman-Merkle Key ExchangeDiffie_Hellman-Merkle Key Exchange
Diffie_Hellman-Merkle Key Exchange
 
Password best practices and the last pass hack
Password best practices and the last pass hackPassword best practices and the last pass hack
Password best practices and the last pass hack
 
SSL certificates
SSL certificatesSSL certificates
SSL certificates
 
Encryption basics
Encryption basicsEncryption basics
Encryption basics
 
Passwords
PasswordsPasswords
Passwords
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
 
Hardware Discovery Commands
Hardware Discovery CommandsHardware Discovery Commands
Hardware Discovery Commands
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
The ps Command
The ps CommandThe ps Command
The ps Command
 
Installing Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System ConsiderationsInstalling Linux: Partitioning and File System Considerations
Installing Linux: Partitioning and File System Considerations
 
The ifconfig Command
The ifconfig CommandThe ifconfig Command
The ifconfig Command
 
Find and Locate: Two Commands
Find and Locate: Two CommandsFind and Locate: Two Commands
Find and Locate: Two Commands
 
The Shell Game Part 3: Introduction to Bash
The Shell Game Part 3: Introduction to BashThe Shell Game Part 3: Introduction to Bash
The Shell Game Part 3: Introduction to Bash
 
The Shell Game Part 2: What are your shell choices?
The Shell Game Part 2: What are your shell choices?The Shell Game Part 2: What are your shell choices?
The Shell Game Part 2: What are your shell choices?
 
The Shell Game Part 1: What is a shell?
The Shell Game Part 1: What is a shell?The Shell Game Part 1: What is a shell?
The Shell Game Part 1: What is a shell?
 

Último

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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 RobisonAnna Loughnan Colquhoun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
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...Drew Madelung
 
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 AutomationSafe Software
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
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 MenDelhi Call girls
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
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 slidevu2urc
 
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 MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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 2024The Digital Insurer
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 

Último (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
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...
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
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
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 

Install Software at the Command Line

  • 1. Installing Software, Part 2 Kevin B. O'Brien Washtenaw Linux Users Group Washtenaw Linux Users Group 1
  • 2. Package Tool Levels 1 GUI Package Tool High-Level Package Tool Low-Level Package Tool Washtenaw Linux Users Group 2
  • 3. Package Tool Level 2 ● For newcomers, the easiest level to work at is the GUI Package Tool ● That is what we looked at in the first presentation ● But a GUI is just a front-end for what you can do on the command line ● The command line is much more powerful Washtenaw Linux Users Group 3
  • 4. Package Tool Level 3 ● Anything you can do with a GUI you can do on a command line ● But the command line will let you do more than the GUI will ● When the GUI has trouble with a package install you will generally need to use the command line to fix the problem ● These are all administrative tasks, so run them as root or use sudo Washtenaw Linux Users Group 4
  • 5. Two flavors ● While we looked at three GUI tools in the previous presentation, here we will only look at two sets of command line tools ● They are YUM (and RPM) and APT (and DPKG) ● They work with RPM and Debian packages respectively ● There are others, but once you learn the basic principles you can pick up the others pretty easily shouldLinux Users need to Washtenaw you Group 5
  • 6. RPM ● RPM stands for Red Hat Package Manager ● Red Hat is the major distro for corporate and server center environments ● Many major distros have adopted RPM as well: OpenSUSE, Mandriva, etc. ● RPM can be run by itself from the command line, or you can use an intermediate tool like YUM (Yellowdog Updater, Modified) Washtenaw Linux Users Group 6
  • 7. YUM 1 “Yum is an automatic updater and package installer/remover for rpm systems. It automatically computes dependencies and figures out what things should occur to install packages. It makes it easier to maintain groups of machines without having to manually update each one using rpm.” http://yum.baseurl.org/ Washtenaw Linux Users Group 7
  • 8. YUM 2 ● Although there are GUI front-ends for YUM, we will focus on the command line use (PackageKit, which we covered in the first presentation, is the default for Fedora since version 9) ● YUM is pretty simple ● To install a program, type yum install <package_name> ● Remember that all of these commands must be run as root or using sudo Washtenaw Linux Users Group 8
  • 9. YUM 3 ● What happens when you enter this command? ● YUM checks the database of packages available in the repositories it knows about ● If it finds the package, it then checks the headers of the package to discover any dependencies ● It then prepares to download and install all of the files needed to get your package up and running Washtenaw Linux Users Group 9
  • 10. It's Not There? ● What if you get an error that there is no such package? ● That means that it is not in any of the repositories that your system knows about ● Do a Google search (or Bing, if you really must) to find the repository. Many companies maintain repos for the major two systems (e.g. Google) ● If that does not work, you may need to resort to more drastic measures, covered in a future presentation Washtenaw Linux Users Group 10
  • 11. Repositories ● We covered this in some detail in the previous presentation ● These are online collections of software packages that you can download and install ● You will have the best results using repositories that are designed for your distro ● These can be created by the distro itself, or by third-parties (e.g. Miro) Washtenaw Linux Users Group 11
  • 12. Repositories 2 ● Adding a repository is easiest with the GUI front-ends because they do so much of it for you ● But you can add one if you know how to use a text editor Washtenaw Linux Users Group 12
  • 13. Adding a repo 1 ● Example, adding Google's Linux repo ● As root, add the following to a file called google.repo in /etc/yum.repos.d/: [google] name=Google – i386 baseurl=http://dl.google.com/linux/rpm/s table/i386 enabled=1 gpgcheck=1 ● http://www.google.com/linuxrepositories/ yum.html Washtenaw Linux Users Group 13
  • 14. Adding a repo 2 ● So, you first need to be able to run a text editor as root (or by using sudo) ● Then you need to create a file in a specified directory (/etc/yum.repos.d/) ● The file needs to have a name that identifies it, and an extension of *.repo. You can pick the name you want to use, but it should be descriptive enough that you can find it if needed. Washtenaw Linux Users Group 14
  • 15. Adding a repo 3 ● Finally, you have to enter some structured information into this text file ● The last line, gpgcheck=1, will cause it to automatically download and add a GPG signature while you are installing it Washtenaw Linux Users Group 15
  • 16. Adding a Repo 4 ● To check, try adding the Google repo as shown above ● Then open PackageKit, and update your package lists ● Then run a search for “google” ● You will see lots of available packages ● Then check your Software Sources, and see it listed Washtenaw Linux Users Group 16
  • 17. Adding a Repo 5 Washtenaw Linux Users Group 17
  • 18. YUM 4 ● So, with the new Google repository added, let's say you wanted to install the new Google browser, Chrome, all you do is yum install google-chrome ● And if you later change your mind, it is simply yum remove google-chrome Washtenaw Linux Users Group 18
  • 19. Updating Repositories ● You want to keep your information on what is in the repos up-to-date ● You can get a manual update any time by entering yum update ● To automate this more, edit the file /etc/yum/yum-updatesd.conf (Note: This file may not exist at first, so you would need to create it with a text editor) Washtenaw Linux Users Group 19
  • 20. yum-updatesd.conf 1 ● This is the configuration file for yum- updatesd ● Instructions can be found at http://linux.die.net/man/5/yum- updatesd.conf ● You can set the interval to check the repos here Washtenaw Linux Users Group 20
  • 21. yum-updatesd.conf 2 ● You can set it to notify you in several ways; probably e-mail will be the easiest. ● You could set it to install updates automatically, or to just download them automatically Washtenaw Linux Users Group 21
  • 22. YUM upgrades 1 ● Generally speaking, update means to check the info on what the latest versions are of your packages ● It is only informational ● Upgrade means to actually download and install the newest version Washtenaw Linux Users Group 22
  • 23. YUM upgrades 2 ● So, if you learned (through an update) there was a new version of Google Chrome that you wanted to install you would type yum upgrade google-chrome Washtenaw Linux Users Group 23
  • 24. YUM process summarized 1 ● You can add repos to your collection ● You can then update the info in them to make sure it is current, and set this up to happen automatically in yum- updatesd.conf ● You can upgrade packages ● You can install new packages Washtenaw Linux Users Group 24
  • 25. YUM process summarized 2 ● You can remove ones you don't need any more ● And all of this can be done at the command line Washtenaw Linux Users Group 25
  • 26. YUM resources ● http://www.linuxpromagazine.com/Issues/2009 /103/DELICIOUS ● http://linux.die.net/man/8/yum ● http://yum.baseurl.org/ Washtenaw Linux Users Group 26
  • 27. APT, the Debian way ● The other major package management system is APT (Advanced Package Tool), which is used in Debian and related distros (Ubuntu being a major one here) ● This works a lot like yum, which is not surprising since they are doing the same things Washtenaw Linux Users Group 27
  • 28. Repositories ● Just as with YUM, you need to maintain your repository information when using APT ● This is kept in a file /etc/apt/sources.list ● Here, each repo has a line in this single file ● For example, here is the main Debian repo deb http://http.us.debian.org/debian stable main contrib non-free Washtenaw Linux Users Group 28
  • 29. Repository lines 1 ● The first entry “deb”, says that is a repo containing binary packages for Debian ● If they contained source code, the first item would be “deb-src” ● In either case, this is followed by the address of the repo. These are most often http, but can also be ftp, ssh, or point to a local file Washtenaw Linux Users Group 29
  • 30. Repository Lines 2 ● This is followed by the name of the distribution; in Debian is might be “stable”, in Ubuntu it might be “jaunty”. ● The remaining fields are optional, but add some more description Washtenaw Linux Users Group 30
  • 31. Managing Repositories 1 ● Adding a repo is as simple as adding a line to /etc/apt/sources.list ● As root, or using sudo, use a text editor to add a line to the list to add a repository ● To remove one, you can just delete the line, but it is easier and safer to just comment out the line by putting “# “ in front of the line (pound sign and a space) ● To re-enable the repo, just remove the comment Washtenaw Linux Users Group 31
  • 32. Managing Repositories 2 ● As with YUM, you want to keep everything up-to-date ● APT keeps information about the contents of each repository, and about what packages you have installed, in a local database Washtenaw Linux Users Group 32
  • 33. Managing Repositories 3 ● You can update the information about each repo with apt-get update ● Remember, this is an administrative task, so either run as root or use sudo for all commands Washtenaw Linux Users Group 33
  • 34. Packages 1 ● You can install packages (e.g. Google Chrome) by apt-get install google-chrome ● If you later change your mind, just apt-get remove google-chrome ● As with YUM, if you get an error that the package could not be found, you should do a search to see if there is a repository that contains it Washtenaw Linux Users Group 34
  • 35. Packages 2 ● Many companies will set up repositories for the major distros (e.g. Google) Washtenaw Linux Users Group 35
  • 36. More APT 1 ● If you damage an install, or just think something went wrong, you can force a reinstall apt-get --reinstall install pine Washtenaw Linux Users Group 36
  • 37. More APT 2 ● You can also upgrade your packages – Always do an update first to make sure you have the latest information – Then apt-get -u upgrade – The “-u” switch causes the command to display a list of all of the packages that will be upgraded. You wouldn't do this blind! Washtenaw Linux Users Group 37
  • 38. APT and Upgrades ● If you run this upgrade, sometimes it will tell you that some packages were not upgraded, that the upgrades were “held back”. This can be due to breaking a dependency, or because of a new dependency ● For new dependencies, you can install the needed packages ● You can also use APT to find out which packages have upgrades available: apt-show-versions -u Washtenaw Linux Users Group 38
  • 39. Distribution Upgrades ● If you have a completely new distribution version (common with Ubuntu, for instance, which releases new versions every 6 months) apt-get -u dist-upgrade Washtenaw Linux Users Group 39
  • 40. APT resources ● http://www.debian.org/doc/manuals/apt-howto/ Washtenaw Linux Users Group 40
  • 41. The Lowest Level ● Recall that there are three levels in package management ● Our first presentation focused on GUI front ends ● This presentation has so far focused on the middle level, using the command line ● There is also the lowest level Washtenaw Linux Users Group 41
  • 42. Package Tool Levels GUI Package Tool High-Level Package Tool Low-Level Package Tool Washtenaw Linux Users Group 42
  • 43. RPM and DPKG ● For our two package management systems, the lowest levels are RPM (Red Hat Package Manager) and DPKG (Debian package) ● These are most often used when there is a package available, but it is not in a repository ● For example, a web site may offer a package with an extension *.rpm or *.deb Washtenaw Linux Users Group 43
  • 44. RPM Install 1 ● For example, suppose you needed to install Cinelarra for a 64-bit system, and you don't have it in a repository ● But you find this: cinelerra-2.1- 0.15.20081102.fc9.x86_64.rpm ● This is an RPM package, which you can install rpm -i cinelerra-2.1- 0.15.20081102.fc9.x86_64.rpm Washtenaw Linux Users Group 44
  • 45. RPM Install 2 ● This command invokes RPM, tells it to install (-i), and gives it the name of the package to install ● This is still package management. RPM is doing a bunch of things as part of the installation process – Performing dependency checks. – Checking for conflicts. – Performing any tasks required before the install. – Deciding what to do with config files. Washtenaw Linux Users Group 45
  • 46. RPM Install 3 – Unpacking files from the package and putting them in the proper place. – Performing any tasks required after the install. – Keeping track of what it did. (i.e. updating the database) ● RPM can also perform an install over the Internet rpm -i ftp://ftp.gnomovision.com/pub/rpms/foo bar-1.0-1.i386.rpm Washtenaw Linux Users Group 46
  • 47. RPM Install 4 ● If you want to see some of the activity, add a “v” option to the command rpm -iv <package name> ● If you are the impatient kind who likes to see progress bars, add an “h” option rpm -ivh <package name> Washtenaw Linux Users Group 47
  • 48. RPM Erase 1 ● In RPM, removing a package is called “erase” rpm -e <package name> ● Again, this is doing a lot more than simply deleting a couple of files – It checks the RPM database to make sure that no other packages depend on the package being erased. – It executes a pre-uninstall script (if one exists). – It checks to see if any of the package's config files have been modified. If so, it saves copies of them. Washtenaw Linux Users Group 48
  • 49. RPM Erase 2 – It reviews the RPM database to find every file listed as being part of the package, and if they do not belong to another package, deletes them. – It executes a post-uninstall script (if one exists). – It removes all traces of the package (and the files belonging to it) from the RPM database. ● There is no “v” option for the erase command, but there is a variation called “vv” that gives you a lot of information rpm -evv <package name> Washtenaw Linux Users Group 49
  • 50. RPM Upgrade ● There is an upgrade option as well rpm -U <package name> ● Note the capital “U” here ● Essentially, what this command does is a combination of install and erase. It installs the new version and erases the old version, all in one go. Washtenaw Linux Users Group 50
  • 51. RPM Upgrade Remorse ● Suppose you upgraded a package you really love to the newest version ● You try to run it, and your screen goes blank rpm -Uv --oldpackage <package name> ● This is like “upgrading” to the older version ● Note: If you can boot to a command prompt you can do this Washtenaw Linux Users Group 51
  • 52. DPKG 1 ● As with RPM, sometimes you can only find a *.deb file to install from ● The commands are pretty similar dpkg -i gedit-2.12.1.deb ● As with RPM, the DPKG package manager is doing a lot in the background – It is checking and resolving dependencies – It is installing any other packages needed – It is updating the database, etc. Washtenaw Linux Users Group 52
  • 53. DPKG 2 ● In DPKG you remove a package if you don't want it any more dpkg -r gedit ● Another option lets you remove all of the configuration files as well dpkg -P gedit ● Upgrading a package uses the install command dpkg -i gedit-2.12.2.deb Washtenaw Linux Users Group 53
  • 54. DPKG 3 ● One of my favorites is a command to use to help clean up a problem that has come up when I tried to use a more high-level package manager dpkg –configure -a ● If something goes wrong in the middle of an install, this cleans up the database Washtenaw Linux Users Group 54
  • 55. Resources ● RPM – http://www.faqs.org/docs/securing/chap3sec20. html – http://www.rpm.org/max-rpm-snapshot/ ● DPKG – http://linuxhelp.blogspot.com/2005/12/concise- apt-get-dpkg-primer-for-new.html – http://www.cyberciti.biz/howto/question/linux/ dpkg-cheat-sheet.php Washtenaw Linux Users Group 55
  • 56. Final Thoughts ● The four package managers we covered in this presentation (YUM, RPM, APT, DPKG) all have a lot more capabilities than this one presentation could cover. Check the man pages for a full description of what they can do. ● One more time, remember that all of these commands are administrative commands, and you need to run them as root, or precede them with “sudo” Washtenaw Linux Users Group 56