Meego Wiki
Views

Create and update repos

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
(= How to Create a local repo)
(Local Repository in MeeGo)
 
(18 intermediate revisions not shown)
Line 7: Line 7:
== Create a repo ==
== Create a repo ==
 +
 +
=== General repository creation ===
 +
1. Create the directory structure of the repository
 +
mkdir /var/www/html/meego/
 +
mkdir /var/www/html/meego/i586
 +
mkdir /var/www/html/meego/i686
 +
mkdir /var/www/html/meego/noarch
 +
2. Copy the RPMs to correct directory
 +
3. Create repository metadata
 +
createrepo /var/www/html/meego/
 +
 +
This might take some time, depending upon the speed of your processor(s) and HD. On successful conclusion, createrepo should create a directory /repodata. The contents should be:
 +
 +
filelists.xml.gz, other.xml.gz, primary.xml.gz, repomd.xml
 +
 +
=== Update repository creation ===
 +
You need to write additional updateinfo for your updaterepo. Example can be got from [http://repo.meego.com/MeeGo/updates/1.1/core/repos/ia32/packages/repodata | Updateinfo]
 +
 +
More infomation can be got from [http://moblin.intel.com/wiki/MeeGo_1.0_Update_Process |Update Process ]
 +
== Add a repo to MeeGo ==
== Add a repo to MeeGo ==
Package Management subsystem responsible for repo management.
Package Management subsystem responsible for repo management.
-
=== Add repo from remote http / ftp server ===
+
=== Add repo from remote repo file===
OBS always create a repo for each OBS project, for example project 'Trunk' have a repo http://download.meego.com/live/Trunk/standard/. and there's also a repo file named Trunk.repo. zypper can help to add the repo to meego system, commands as follows:
OBS always create a repo for each OBS project, for example project 'Trunk' have a repo http://download.meego.com/live/Trunk/standard/. and there's also a repo file named Trunk.repo. zypper can help to add the repo to meego system, commands as follows:
   zypper addrepo http://download.meego.com/live/Trunk/standard/Trunk.repo
   zypper addrepo http://download.meego.com/live/Trunk/standard/Trunk.repo
-
=== Add repo from remote http / ftp url ===
+
=== Add repo from base url ===
-
  If the repo file is not exist, and we just know the repo base url (eg: http://download.meego.com/live/Trunk/standard/), pkcon command can help to add this repo, commands as follows:
+
If the repo file does not exist, and we just know the repo base url (eg: http://download.meego.com/live/Trunk/standard/), pkcon command can help to add this repo, commands as follows:
-
   zypper addrepo http://download.meego.com/live/Trunk/standard/
+
   #zypper addrepo -t rpm-md http://download.meego.com/live/Trunk/standard/ Trunk
 +
  #cat /etc/zypp/repos.d/Trunk.repo
 +
  [Trunk]
 +
  name=Trunk
 +
  enabled=1
 +
  autorefresh=0
 +
  baseurl=http://download.meego.com/live/Trunk/standard
 +
  type=rpm-md
 +
  keeppackages=0
 +
  #zypper addrepo --help //More infomation about adding repo
== Add new packages to an old repo ==
== Add new packages to an old repo ==
Line 24: Line 53:
== Local Repository in MeeGo ==
== Local Repository in MeeGo ==
Local repo is useful, and it does not depend on http server, and can be used to update/install packages with complicate dependency.
Local repo is useful, and it does not depend on http server, and can be used to update/install packages with complicate dependency.
-
=== How to Create a local repo ===
 
-
You need to install createrepo first, and then prepare the RPMs you want to put them to repo:
 
-
   cp XX/YY/*.rpm .
+
The following commands can help you to add local repo to system:
-
   createrepo .
+
   #zypper addrepo -t plaindir file:///root/repo/ local
 +
  #cat /etc/zypp/repos.d/local.repo
 +
   [local]
 +
  name=local
 +
  enabled=1
 +
  autorefresh=0
 +
  baseurl=file:///root/repo/
 +
  type=plaindir
 +
  keeppackages=0
 +
If you want to list the package in your local repo, the follow command can helo you.
 +
    #zypper search --repo local
 +
 
 +
== Use Repo to update your system ==
 +
 
 +
Once your repo is installed correctly in MeeGo, next work would be update packages from repo. There're several way you can follow.
 +
 
 +
===Package Manager UI (gnome-packagekit, ect.)===
 +
If your repo is official update repo, you can use this method to update patches, but for package update, you'd better use command line tool, such as pkcon or zypper.
 +
=== PackageKit command line toole (pkcon)===
-
=== How to use local repo in MeeGo ====  
+
pkcon get-updates # list the avaliable updates
 +
pkcon update [package name or patch name]
 +
=== zypper ===
 +
zypper list-patches, lp # List needed patches.
 +
zypper list-updates, lu # List available updates.
 +
zypper update, up        # Update installed packages with newer versions
-
  zypper addrepo -t plaindir file:///root/repo/ local
+
You can get more information from 'zypper update --help'. For example, you can use -t option to specify a patch or package.

Latest revision as of 10:37, 1 July 2011

This page describes the basic steps to create and update a Zypper repo that can be used with MeeGo systems.

Contents

Why and when should I create a new repo?

Requirements

A useful repo should reside on a web server that your MeeGo client machines can access. The only requirement on the host server is that it runs an HTTP service and can share a directory. Either Linux or Windows IIS are fine. If you are using Windows as a web server, you do need another Linux machine to create and maintain the repo.

Create a repo

General repository creation

1. Create the directory structure of the repository

mkdir /var/www/html/meego/
mkdir /var/www/html/meego/i586
mkdir /var/www/html/meego/i686
mkdir /var/www/html/meego/noarch

2. Copy the RPMs to correct directory 3. Create repository metadata

createrepo /var/www/html/meego/

This might take some time, depending upon the speed of your processor(s) and HD. On successful conclusion, createrepo should create a directory /repodata. The contents should be:

filelists.xml.gz, other.xml.gz, primary.xml.gz, repomd.xml

Update repository creation

You need to write additional updateinfo for your updaterepo. Example can be got from | Updateinfo

More infomation can be got from |Update Process

Add a repo to MeeGo

Package Management subsystem responsible for repo management.

Add repo from remote repo file

OBS always create a repo for each OBS project, for example project 'Trunk' have a repo http://download.meego.com/live/Trunk/standard/. and there's also a repo file named Trunk.repo. zypper can help to add the repo to meego system, commands as follows:

 zypper addrepo http://download.meego.com/live/Trunk/standard/Trunk.repo

Add repo from base url

If the repo file does not exist, and we just know the repo base url (eg: http://download.meego.com/live/Trunk/standard/), pkcon command can help to add this repo, commands as follows:

 #zypper addrepo -t rpm-md http://download.meego.com/live/Trunk/standard/ Trunk
 #cat /etc/zypp/repos.d/Trunk.repo 
 [Trunk]
 name=Trunk
 enabled=1
 autorefresh=0
 baseurl=http://download.meego.com/live/Trunk/standard
 type=rpm-md
 keeppackages=0 
 #zypper addrepo --help //More infomation about adding repo

Add new packages to an old repo

Local Repository in MeeGo

Local repo is useful, and it does not depend on http server, and can be used to update/install packages with complicate dependency.

The following commands can help you to add local repo to system:

 #zypper addrepo -t plaindir file:///root/repo/ local
 #cat /etc/zypp/repos.d/local.repo
 [local]
 name=local
 enabled=1
 autorefresh=0
 baseurl=file:///root/repo/
 type=plaindir 
 keeppackages=0 

If you want to list the package in your local repo, the follow command can helo you.

   #zypper search --repo local

Use Repo to update your system

Once your repo is installed correctly in MeeGo, next work would be update packages from repo. There're several way you can follow.

Package Manager UI (gnome-packagekit, ect.)

If your repo is official update repo, you can use this method to update patches, but for package update, you'd better use command line tool, such as pkcon or zypper.

PackageKit command line toole (pkcon)

pkcon get-updates # list the avaliable updates
pkcon update [package name or patch name]

zypper

zypper list-patches, lp	 # List needed patches.
zypper list-updates, lu	 # List available updates.
zypper update, up        # Update installed packages with newer versions

You can get more information from 'zypper update --help'. For example, you can use -t option to specify a patch or package.

Personal tools