As you know,you can use the yum command to install packages on redhat linux.It's a powerful tool than it can resolve the package dependence.But in suse,you can also do it easily by zypper command.Before,you must know how to create the packages repository.

By default,the SUSE linux dvd as the default repository,you can check it by following command:

  1. suse:~ # zypper repos 
  2. # | Alias       | Name        | Enabled | Refresh 
  3. --+-------------+-------------+---------+-------- 
  4. 1 | SUSE-11-SP2 | SUSE-11-SP2 | Yes     | No      

Or view the follwing file:

  1. suse:~ # cd /etc/zypp/repos.d 
  2. suse:/etc/zypp/repos.d # ls 
  3. SUSE-11-SP2.repo  SUSE-HA.repo 
  4. suse:/etc/zypp/repos.d # cat SUSE-11-SP2.repo  
  5. [SUSE-11-SP2] 
  6. name=SUSE-11-SP2 
  7. enabled=1 
  8. autorefresh=0 
  9. baseurl=cd:///?devices=/dev/sr0 
  10. path=/ 
  11. type=yast2 
  12. keeppackages=0 

Now creating the suse HA repository:

  1. //Mount the suse HA iso file 
  2. suse:~ # mount -o loop SLE-HA-11-SP2-x86_64-GM-CD1.iso /ha 
  3. //Edit the /etc/zypp/repos.d/SUSE-11-SP2.repo file and append following lines: 
  4. [SUSE-HA] 
  5. name=SUSE-HA 
  6. enabled=1 
  7. autorefresh=0 
  8. baseurl=file:///ha 
  9. path=/ 
  10. type=yast2 
  11. keeppackages=0 

After created,refresh the suse repository:

  1. suse:/etc/zypp/repos.d # zypper ref 
  2. Retrieving repository 'SUSE-HA' metadata [done] 
  3. All repositories have been refreshed. 
  4. suse:/etc/zypp/repos.d # zypper ls 
  5. # | Alias       | Name        | Enabled | Refresh | Type  
  6. --+-------------+-------------+---------+---------+------ 
  7. 1 | SUSE-11-SP2 | SUSE-11-SP2 | Yes     | No      | yast2 
  8. 2 | SUSE-HA     | SUSE-HA     | Yes     | No      | yast2 

Now,you can install any packages by zypper.