Meego Wiki
From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
 
(6 intermediate revisions not shown)
Line 1: Line 1:
-
Zypper is the repository and package management tool used by MeeGo. It is modelled on yum, installs RPMs behind the scenes, and behaves very much like apt on Debian-based systems.
+
Zypper is the repository and package management tool used by [[MeeGo]]. It is modelled on yum, installs [[RPM]]s behind the scenes, and behaves very much like apt on [[Debian]]-based systems.
Like apt, Zypper manages a number of repositories, each of which can contain one or more packages. These repositories are defined in <code>.repo</code> files, which are stored in <code>/etc/zypp/repos.d</code>.
Like apt, Zypper manages a number of repositories, each of which can contain one or more packages. These repositories are defined in <code>.repo</code> files, which are stored in <code>/etc/zypp/repos.d</code>.
-
=== Adding a repository ===
+
 
 +
== Adding a repository ==
There are two ways to add a .repo file to zypper:
There are two ways to add a .repo file to zypper:
 +
* Add it directly with <code>zypper ar <URI> <alias></code> - "ar" is short-hand for "addrepo", for example:
 +
    zypper ar http://repo.meego.com/MeeGo/builds/trunk/latest/repos/oss/ia32/packages/ oss
* Download the .repo file locally, and then copy it to <code>/etc/zypp/repos.d</code> as root
* Download the .repo file locally, and then copy it to <code>/etc/zypp/repos.d</code> as root
-
* Add it directly with <code>zypper ar http://..../<repo>.repo</code> - "ar" is short-hand for "addrepo"
+
* If you need symbols for debugging or profiling, you need to add one more repo, for example:
 +
    zypper ar http://repo.meego.com/MeeGo/builds/trunk/latest/repos/oss/ia32/debug/ oss-debug
-
=== Updating packages ===
+
 
 +
== Updating packages ==
After adding a repository you should run <code>zypper update</code> to update all packages, or <code>zypper refresh</code> just to refresh package lists and verify the new .repo file.
After adding a repository you should run <code>zypper update</code> to update all packages, or <code>zypper refresh</code> just to refresh package lists and verify the new .repo file.
Line 15: Line 20:
"update" should be run periodically to keep software up to date. For most users, however, the operation will be done through a graphical updater, and you should only need to run this manually when adding a repository.
"update" should be run periodically to keep software up to date. For most users, however, the operation will be done through a graphical updater, and you should only need to run this manually when adding a repository.
-
=== Installing and removing software ===
+
 
 +
== Installing and removing software ==
You can install software from the command line using <code>zypper install [packagename]</code> or <code>zypper in [packagename]</code>, or remove it with <code>zypper remove [packagename]</code> or <code>zypper rm [packagename]</code>
You can install software from the command line using <code>zypper install [packagename]</code> or <code>zypper in [packagename]</code>, or remove it with <code>zypper remove [packagename]</code> or <code>zypper rm [packagename]</code>
-
=== .repo file format ===
+
 
 +
== Installing source package ==
 +
 
 +
If you know the full name , you can install the source package by
 +
    ## this command will install meegotouch-compositor's source code to ~/rpmbuild
 +
    zypper si meegotouch-compositor
 +
 
 +
If you don't know the full name of a source package, you can search a string by
 +
    ## this command will list the source package match compositor
 +
    zypper se  -t srcpackage compositor
 +
 
 +
If you know a binary package name, but want get the source package that build out the binary package name, you can
 +
    ## this command will download qt-4.7.x source code, libqtopengl4 is built from qt-4.7.x
 +
    package=libqtopengl4 ; zypper si `rpm -q --qf '%{SOURCERPM}\n' ${package}`
 +
 
 +
 
 +
== .repo file format ==
The file format for repositories is identical for yum and zypper. The file contains one or more repository definitions, in the form:
The file format for repositories is identical for yum and zypper. The file contains one or more repository definitions, in the form:
Line 35: Line 57:
-
=== Further reading ===
+
== Further reading ==
-
* [Zypper project page http://en.opensuse.org/Portal:Zypper]
+
* [http://en.opensuse.org/Portal:Zypper Zypper project page]
-
* [Zypper documentation http://en.opensuse.org/SDB:Zypper_usage]
+
* [http://en.opensuse.org/SDB:Zypper_usage Zypper documentation]
-
* [Yum documentation, including documentation of .repo file format fields http://linux.die.net/man/5/yum.conf]
+
* [http://linux.die.net/man/5/yum.conf Yum documentation, including documentation of .repo file format fields]
 +
* [[Build]] packages
[[Category:Packaging]]
[[Category:Packaging]]
 +
[[Category:Tutorial]]

Latest revision as of 23:03, 26 July 2011

Zypper is the repository and package management tool used by MeeGo. It is modelled on yum, installs RPMs behind the scenes, and behaves very much like apt on Debian-based systems.

Like apt, Zypper manages a number of repositories, each of which can contain one or more packages. These repositories are defined in .repo files, which are stored in /etc/zypp/repos.d.


Contents

Adding a repository

There are two ways to add a .repo file to zypper:

  • Add it directly with zypper ar <URI> <alias> - "ar" is short-hand for "addrepo", for example:
   zypper ar http://repo.meego.com/MeeGo/builds/trunk/latest/repos/oss/ia32/packages/ oss
  • Download the .repo file locally, and then copy it to /etc/zypp/repos.d as root
  • If you need symbols for debugging or profiling, you need to add one more repo, for example:
   zypper ar http://repo.meego.com/MeeGo/builds/trunk/latest/repos/oss/ia32/debug/ oss-debug 


Updating packages

After adding a repository you should run zypper update to update all packages, or zypper refresh just to refresh package lists and verify the new .repo file.

"update" should be run periodically to keep software up to date. For most users, however, the operation will be done through a graphical updater, and you should only need to run this manually when adding a repository.


Installing and removing software

You can install software from the command line using zypper install [packagename] or zypper in [packagename], or remove it with zypper remove [packagename] or zypper rm [packagename]


Installing source package

If you know the full name , you can install the source package by

   ## this command will install meegotouch-compositor's source code to ~/rpmbuild
   zypper si meegotouch-compositor 

If you don't know the full name of a source package, you can search a string by

   ## this command will list the source package match compositor
   zypper se  -t srcpackage compositor 

If you know a binary package name, but want get the source package that build out the binary package name, you can

   ## this command will download qt-4.7.x source code, libqtopengl4 is built from qt-4.7.x
   package=libqtopengl4 ; zypper si `rpm -q --qf '%{SOURCERPM}\n' ${package}` 


.repo file format

The file format for repositories is identical for yum and zypper. The file contains one or more repository definitions, in the form:

[home_yanli_branches_MeeGo_1.1_Core_Update_Testing]
name=Branch of MeeGo:1.1:Core:Update:Testing (MeeGo_1.1)
autorefresh=1
type=rpm-md
baseurl=http://download.meego.com/live/home:/yanli:/branches:/MeeGo:/1.1:/Core:/Update:/Testing/MeeGo_1.1/
gpgcheck=0
enabled=1


The file starts with a unique identifier for the repository, a string to indentify it, and contails a base URL where packages will be found, and an indicator of the type of the repository. This can be yast2, plaindir or rpm-md, and defines the expected format for repository metadata. Usually it will be rpm-md.


Further reading

Personal tools