
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.sabayonlinux.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.sabayonlinux.org/index.php?title=HOWTO:_Switch_from_Test_to_Stable_Packages&amp;feed=atom&amp;action=history</id>
		<title>HOWTO: Switch from Test to Stable Packages - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.sabayonlinux.org/index.php?title=HOWTO:_Switch_from_Test_to_Stable_Packages&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://wiki.sabayonlinux.org/index.php?title=HOWTO:_Switch_from_Test_to_Stable_Packages&amp;action=history"/>
		<updated>2013-05-25T11:59:16Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.19.4</generator>

	<entry>
		<id>http://wiki.sabayonlinux.org/index.php?title=HOWTO:_Switch_from_Test_to_Stable_Packages&amp;diff=11752&amp;oldid=prev</id>
		<title>Bobwya: /* Goal and Quickstart */</title>
		<link rel="alternate" type="text/html" href="http://wiki.sabayonlinux.org/index.php?title=HOWTO:_Switch_from_Test_to_Stable_Packages&amp;diff=11752&amp;oldid=prev"/>
				<updated>2012-07-17T22:47:37Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Goal and Quickstart&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Warning| '''Portage (emerge) is not the primary package manager for Sabayon, this article is for advanced users only. In other words if this fails for you, its your fault. You have been warned.'''}}&lt;br /&gt;
=Introduction=&lt;br /&gt;
Each Sabayon release is a compilation of packages that work well together, mostly comprised of &amp;quot;test&amp;quot; packages in the Portage tree. By default, a Sabayon installation will also install test packages whenever a new application is installed, or when updates take place.  This can lead to the scenario where a stable Sabayon installation becomes unstable after doing an &amp;quot;emerge world&amp;quot;.  This article shows how to keep the currently installed test packages, while ensuring that any new packages are &amp;quot;stable&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
'''Note: All references to amd64 should be changed to reflect your architecture - probably x86 if not amd64'''&lt;br /&gt;
&lt;br /&gt;
==Test Packages==&lt;br /&gt;
&lt;br /&gt;
By default, ''emerge'' will only use stable packages.  If default was left is it was, then issuing an ''emerge world'' command would cause the majority of packages to be downgraded to stable packages, more than likely breaking the installation.&lt;br /&gt;
&lt;br /&gt;
To prevent this, the /etc/make.conf file in Sabayon contains the following statement:&lt;br /&gt;
&lt;br /&gt;
 ACCEPT_KEYWORDS=~amd64&lt;br /&gt;
&lt;br /&gt;
The tilde &amp;quot;~&amp;quot; in this line tells the ''emerge'' command that it is acceptable to download and install test packages when a request to install an application takes place.  All packages within the gentoo repository can be marked as &amp;quot;stable&amp;quot; in that they have undergone QA, or &amp;quot;masked&amp;quot; meaning they are in the tree, but have not gone through QA (this is simplified, and there are other statuses not relevant to this article, please see the Portage documentation at gentoo.org for details).  The equivalent line for stable packages would have the tilde removed:&lt;br /&gt;
&lt;br /&gt;
 ACCEPT_KEYWORDS=amd64&lt;br /&gt;
&lt;br /&gt;
As this is the default, the absence of this line would also mean &amp;quot;only install stable packages&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==Goal and Quickstart==&lt;br /&gt;
&lt;br /&gt;
The goal is to change the ACCEPT_KEYWORDS line to only permit stable packages, while allowing the existing test packages to remain installed. This means that the currently working test packages will remain, however as new stable versions of these packages become available, and ''emerge world'' is executed to update new packages, the installation will slowly migrate to stable packages.  Any packages that should remain as test can be added manually to the ''package.keywords'' file.&lt;br /&gt;
&lt;br /&gt;
The following is the quick description of the solution, while the rest of the article describes what each step achieves:&lt;br /&gt;
&lt;br /&gt;
1. Change make.conf ACCEPT_KEYWORDS line to:&lt;br /&gt;
  ACCEPT_KEYWORDS=amd64&lt;br /&gt;
2. Create a list of currently installed packages:&lt;br /&gt;
  equery -i -N list | grep \~ | sed 's/.* \(.*\) (.*/&amp;lt;=\1 ~amd64/' &amp;gt; testpackages&lt;br /&gt;
  {{warning|The default action for equery list has changed in Gentoolkit 0.3  - use new command syntax... }}&lt;br /&gt;
  equery -N list -F '=$cpv $mask2' '*' | grep \~ &amp;gt; testpackages'&lt;br /&gt;
3. Backup current package.keywords&lt;br /&gt;
  cp /etc/portage/package.keywords /etc/portage/package.keywords.back&lt;br /&gt;
4. Append ''testpackages'' file to ''package.keywords''&lt;br /&gt;
  cat testpackages &amp;gt;&amp;gt; /etc/portage/package.keywords&lt;br /&gt;
&lt;br /&gt;
=Detail=&lt;br /&gt;
&lt;br /&gt;
==Change ''make.conf''==&lt;br /&gt;
&lt;br /&gt;
First things first, edit /etc/make.conf and either comment out, remove, or change the ACCEPT_KEYWORDS line to:&lt;br /&gt;
&lt;br /&gt;
    ACCEPT_KEYWORDS=amd64&lt;br /&gt;
&lt;br /&gt;
If you do this, you must do the rest, otherwise you could be in trouble next time you get to emerge something. This line tells emerge that all packages must be stable, unless explicitly stated in /etc/portage/package.keywords&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Generate list of currently installed test packages==&lt;br /&gt;
&lt;br /&gt;
Next we need to get the list of packages that are currently masked as test packages, and create a file that we can use to add to the package.keywords to let emerge know that they can remain as test packages.&lt;br /&gt;
&lt;br /&gt;
We use three commands piped together to do this. You can try these out stage by stage so that you can see exactly what is going on. The first part is:&lt;br /&gt;
&lt;br /&gt;
    equery -i -N list&lt;br /&gt;
&lt;br /&gt;
This shows a list of installed packages, such as:&lt;br /&gt;
&lt;br /&gt;
    [I--] [ ~] x11-wm/twm-1.0.3 (0)&lt;br /&gt;
&lt;br /&gt;
The second column will contain a tilde ‘~’ if the package is masked. These are the packages we need, so we will pipe the output into grep to pull out only those lines that contain a tilde:&lt;br /&gt;
&lt;br /&gt;
    equery -i -N list | grep \~&lt;br /&gt;
&lt;br /&gt;
The output will now only contain the masked packages. &lt;br /&gt;
&lt;br /&gt;
==Manipulate for use in ''package.keywords''&lt;br /&gt;
&lt;br /&gt;
We need to manipulate each line a little to pull out just the package name, and then add the prefix and suffix we need ready for the package.keywords file:&lt;br /&gt;
&lt;br /&gt;
    equery -i -N list | grep \~ | sed 's/.* \(.*\) (.*/=\1 ~amd64/'&lt;br /&gt;
&lt;br /&gt;
This transforms the above line:&lt;br /&gt;
&lt;br /&gt;
    [I--] [ ~] x11-wm/twm-1.0.3 (0)&lt;br /&gt;
&lt;br /&gt;
into:&lt;br /&gt;
&lt;br /&gt;
    =x11-wm/twm-1.0.3 ~amd64&lt;br /&gt;
&lt;br /&gt;
This means “permit use of a masked package for x11-wm/twm, for version 1.0.3 only.”&lt;br /&gt;
&lt;br /&gt;
We just need to output the results of that to a file, and append it to /etc/portage/package.keywords&lt;br /&gt;
&lt;br /&gt;
Output to a file:&lt;br /&gt;
&lt;br /&gt;
    equery -i -N list | grep \~ | sed 's/.* \(.*\) (.*/&amp;lt;=\1 ~amd64/' &amp;gt; testpackages&lt;br /&gt;
&lt;br /&gt;
==Update ''package.keywords''==&lt;br /&gt;
&lt;br /&gt;
Append to the end of /etc/portage/package.keywords (take a backup first):&lt;br /&gt;
&lt;br /&gt;
    cp /etc/portage/package.keywords /etc/portage/package.keywords.back&lt;br /&gt;
&lt;br /&gt;
    cat testpackages &amp;gt;&amp;gt; /etc/portage/package.keywords&lt;br /&gt;
&lt;br /&gt;
This last command will need to be done with root privileges. If you followed the previous article’s approach, you will have a bunch of old entries in there from the previous method. These will need to be removed first.&lt;br /&gt;
&lt;br /&gt;
Once you have done this, you can effectively leave it alone. As new packages are released into the stable tree, they will supersede the ones you have installed, and the package.keywords entries will be ignored. Forum user voxiac suggested a cron job that would clean up the package.keywords file over time. I’ll have a go at putting something together down the line, depending on what level of hassle the cleanup is.&lt;br /&gt;
&lt;br /&gt;
=Notes=&lt;br /&gt;
&lt;br /&gt;
The following command will give you a count of the current test packages you have installed:&lt;br /&gt;
&lt;br /&gt;
    equery -i -N list | grep \~ | wc -l&lt;br /&gt;
&lt;br /&gt;
Versus total installed:&lt;br /&gt;
&lt;br /&gt;
    equery -i -N list | grep \/ | wc -l&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
[http://www.servwise.com/blog-paul/?p=46 Sabayon Stabiliser 2]&lt;br /&gt;
[http://www.servwise.com/blog-paul/?p=45 Sabayon Stabiliser]&lt;br /&gt;
&lt;br /&gt;
[[Category:Package Management|Switch from Test to Stable Packages]]&lt;/div&gt;</summary>
		<author><name>Bobwya</name></author>	</entry>

	</feed>