Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to use portage correctly
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
GaMMa
l33t
l33t


Joined: 23 Aug 2002
Posts: 684
Location: USA

PostPosted: Sun May 09, 2004 11:47 pm    Post subject: How to use portage correctly Reply with quote

How to use portage correctly
Revised: 7/10/04

The Spanish version of this guide is available at http://forums.gentoo.org/viewtopic.php?t=195629 and was translated by ArsDangor.

Introduction:
Gentoo's portage system is an excellent resource when used properly. Incorrect usage can lead to a bloated system with untraceable packages as well as a broken world file. Following this guide will allow the user to have a better system.

Emerging packages:
When emerging an unstable package it is recommended that one emerges the package
Code:
emerge foo

DON'T use ACCEPT_KEYWORDS="~x86" for it'll emerge dependencies with ~x86 which may not be wanted.

What is recommend is that one tries emerging the ebuild first, and if it complains the ebuild is unstable take the appropriate action below. Once that is resolved try emerging the package again and it may complain about a dependency. Take appropriate action for the dependency and try to emerge the package again. Keep doing this until the package is emerged. Yes it may seem like a pain, but at least you know what's getting put on your system as far as unstable packages.

WARNING: Directly emerging an ebuild (emerge foo.ebuild) has caused problems for some users and should NOT be used. In a few situations it refuses to add packages to the world file. Also using this method the user will not be notified of new unstable releases of this package, even if they contain essential security fixes.

Maintaining packages:
Sometimes when running 'emerge -u world' portage wants to downgrade packages. To unmask packages so portage doesn't try to downgrade them make the /etc/portage directory if it's not already there.
Code:
mkdir /etc/portage

Inside of the file /etc/portage/package.keywords add the complete package name followed by ~x86. For example to have portage recognize we want to have Gaim unstable ebuilds on our system we input the line
Code:
echo net-im/gaim ~x86 >> /etc/portage/package.keywords

Do this for all the unstable packages you don't want downgraded.

We can also enable specific unstable versions of a certain package, so when the next unstable version comes out, the system won't auto upgrade that package. We do this by following this syntax:
Code:
echo =app-misc/foo-version ~x86>> /etc/portage/package.keywords

The line above will only allow that one specific version of the package to be emerged. However, revision bumps will still be ~arch masked. In order to allow revision bumps to be marked as stable in addition to the specific version we use the following code instead
Code:
echo ~app-misc/foo-version ~x86>> /etc/portage/package.keywords

Where version is the version without the -rX.

NOTE: It's a lot easier to keep track of packages if you keep this list alphabetized.
WARNING: Using 'emerge -U world' may cause problems with the system and should NOT be used. Earthwings discusses why it's bad here http://forums.gentoo.org/viewtopic.php?t=167323

Sometimes, however, portage still wants to downgrade a package. Generally, there is a good reason behind it and it's best to downgrade it. There are exceptions though; for example linux-headers wanted to revert to 2.4.x when I have a 2.6.x kernel. Linux-headers is the only package that should use this method, others should use the previous method or be downgraded. In /etc/portage/package.keywords we add a line or do
Code:
echo sys-kernel/linux-headers -* >> /etc/portage/package.keywords


Packages sometimes try to creep back onto the system when they aren't needed. Users of xorg-x11 may have noticed xfree trying to make its way back onto the system. To fix this, in /etc/portage/package.mask add a line or type
Code:
echo x11-base/xfree >> /etc/portage/package.mask


Packages are also hard masked from time to time. One package I know that is for example is realone. It's hard masked due to the fact there is a security hole that could lead to a compromised system. If for some reason you want to use realone though, there's a package.unmask file. Make a /etc/portage/package.unmask and enter this command
Code:
echo media-video/realone >> /etc/portage/package.unmask


Also if you don't want a package to include a particular USE flag, there's a package.use. Make a /etc/portage/package.use and enter a function similar to this into a terminal
Code:
echo net-p2p/bittorrent -X >> /etc/portage/package.use

This would tell portage not to include X support when emerging bittorrent.

Maintaining the world file:
Sometimes packages aren't added to the world file for whatever reason. To [attempt to] fix your world file and add the packages type
Code:
regenworld

There's also another thread that provides information on how to fix your world file if regenworld doesn't work. http://forums.gentoo.org/viewtopic.php?t=136627

Conclusion:
Using this method you'll allow 'emerge -u world' to become a reality and you'll have a bleeding edge system.

Code:
emerge -uDav world

Is the best way to upgrade the world. u is for upgrade, D is for deep, a stands for ask and v is verbose, and tells the USE flags that will be used in each package.

I recommend trying ecatmur's cruft script to keep your install neat and clean!
http://forums.gentoo.org/viewtopic.php?t=152618

Any revisions/adds to this send me a PM. Yes it may seem like a dumb topic, but you'd be surprised at the people that use portage wrong.

Thanks to everyone who contributed to this guide and proved me wrong in the process :). Your countless emails and PMs helped make this guide what it is now.
_________________
Ubuntu Linux Dapper Drake running Gnome-2.14.1
[Website | Screenshot | Portage Guide]


Last edited by GaMMa on Sat Jul 10, 2004 4:57 am; edited 16 times in total
Back to top
View user's profile Send private message
ozonator
Guru
Guru


Joined: 11 Jun 2003
Posts: 591
Location: Ontario, Canada

PostPosted: Mon May 10, 2004 12:17 am    Post subject: Re: How to use portage correctly Reply with quote

GaMMa wrote:
So there's an unstable package in the system, and emerge -u world wants to downgrade it.


Uhm, you could use 'emerge -U world' instead. Yes, sometimes portage may still want to downgrade something, but that's typically because the ebuild for something that's installed is no longer in portage; assuming you're not running completely with ACCEPT_KEYWORDS="~arch", emerge will default to installing the latest stable version, which typically is older than the version installed (likely masked at the time it was emerged).

As for it never being advisable to emerge an ebuild directly, it's sometimes useful: the Gentoo docs cover this, and give examples of when it might be appropriate.
Back to top
View user's profile Send private message
GaMMa
l33t
l33t


Joined: 23 Aug 2002
Posts: 684
Location: USA

PostPosted: Mon May 10, 2004 12:25 am    Post subject: Reply with quote

Emerging an ebuild directly isn't a smart idea like I said because emerge --depclean sees them as unneeded dependencies. I'm sure there are other reasons besides that, but that alone should be something to consider.

Why emerge -U shouldn't be used:
Quote:

Ok, here are two reasons why "-U" is drop dead ugly (bookmarking this now so in the future I can link to it rather then writing it again and again Wink )

Reason 1: Problems with SLOTs
This occured to quite a few people that wanted gimp-2 instead of gimp-1.2. Imagine gimp-1.2 marked stable and in SLOT 1, gimp-2 marked unstable and in SLOT 2. Now you do an "ACCEPT_KEYWORDS=~x86" emerge gimp" and get gimp-2.
Later on you consider it's time to update your system with anything similar to "emerge -U world". This will install gimp-1.2, because gimp is in the worldfile, and "-U" doesn't handle the SLOTs here as one might expect it.

Reason 2: Problems if ebuilds are removed from Portage tree
Imagine there are two versions of package foo in portage, foo-1.4 marked stable and foo-1.6 marked unstable. You want unstable and emerge it like gimp above. Some time later you update world like above, but in the meantime foo-1.6.1 came out fixing an important security hole in foo-1.6. Now there are two possibilities:
a) foo-1.6 got removed from Portage. This results in foo-1.4 getting installed, thus a downgrade instead of "-U"
b) even worse when foo-1.6 wasn't removed from Portage due to whatever reason: foo-1.6 (the one with the security hole) would stay on your system until something greater than foo-1.6 gets marked stable.

http://forums.gentoo.org/viewtopic.php?t=167323
_________________
Ubuntu Linux Dapper Drake running Gnome-2.14.1
[Website | Screenshot | Portage Guide]
Back to top
View user's profile Send private message
ozonator
Guru
Guru


Joined: 11 Jun 2003
Posts: 591
Location: Ontario, Canada

PostPosted: Mon May 10, 2004 12:59 am    Post subject: Reply with quote

Ahhh. I stand corrected. When first I read your response, it seemed that the examples (which include the 'missing ebuild' example I suggested) just showed a shortcoming in the way '-U' works. Re-reading your first post, however, I see now you had mentioned '-U' as being problematic, even buggy (as the examples you cite suggest), so I shouldn't be surprised you had a good response ready. :) Sorry to jump the gun there. And indeed, another post in the thread you quoted from suggests even that '-U' may even be superfluous now. Thanks for the correction, and your explanation of package.keywords et al.
Back to top
View user's profile Send private message
GaMMa
l33t
l33t


Joined: 23 Aug 2002
Posts: 684
Location: USA

PostPosted: Mon May 10, 2004 1:22 am    Post subject: Reply with quote

Until I saw that thread yesterday I use to always emerge ebuilds directly. I think tried an emerge -e world and noticed none of my ebuilds were getting emerged. I think tried an emerge -p --depclean (a feature that removes packages that aren't needed) and noticed all my ebuilds I emerged directly were there along with their dependencies. I then concluded that seriously messes up portage, and shouldn't be used.

I then ran 'qpkg -d -I -v' and noticed I had a few installs of the same program on my system. So then I decided I had to make a guide to how to use portage.

Today I'm also fixing my system as well as running an emerge -e world. Now that I followed what I said in the guide I can run emerge -uD world without worries.

Quote:
root:/home/gamma% emerge -puD world
These are the packages that I would merge, in order:
Calculating world dependencies ...done!
root:/home/gamma%


You have to love it :D. BTW I've had this install for over a year and yesterday doing that command would have returned 100 or so results because I love to use unstable packages.
_________________
Ubuntu Linux Dapper Drake running Gnome-2.14.1
[Website | Screenshot | Portage Guide]
Back to top
View user's profile Send private message
ozonator
Guru
Guru


Joined: 11 Jun 2003
Posts: 591
Location: Ontario, Canada

PostPosted: Mon May 10, 2004 2:45 am    Post subject: Reply with quote

GaMMa wrote:
Until I saw that thread yesterday I use to always emerge ebuilds directly. I think tried an emerge -e world and noticed none of my ebuilds were getting emerged. I think tried an emerge -p --depclean (a feature that removes packages that aren't needed) and noticed all my ebuilds I emerged directly were there along with their dependencies. I then concluded that seriously messes up portage, and shouldn't be used.


I'm not sure that's because they were emerged directly -- I just tried the same thing, and noticed a lot of things there that I'm sure I didn't emerge directly, but did with the usual "emerge foo" command. The reason they seem to be picked up by depclean is that those packages aren't listed in /var/cache/edb/world -- i.e., for some reason, emerging them didn't put a corresponding entry in the world file. Interestingly, if I check with 'emerge -ep world', those packages not in the world file are still listed among those that would be emerged, so portage somehow knows they're installed even though they're not in the world file.

I just tried running 'regenworld', which did seem to add some things to my 'world' file, but not all the non-essential things I want to have installed. One example: app-text/gv, for which I noticed a newer stable version available -- I emerged the new version, and voila, it put an entry in the 'world' file. This has me wondering: could it be that an older version of portage had a bug whereby it didn't always maintain the 'world' file properly? Just a thought. Otherwise, I don't have an explanation.

Glad to hear you've got your system clean and in shape! If you can't tell, this thread has me thinking about that, too (I'm a few months shy of the second anniversary of the initial install on one of my machines, so it's about time!). I've even started using package.keywords. :)
Back to top
View user's profile Send private message
GaMMa
l33t
l33t


Joined: 23 Aug 2002
Posts: 684
Location: USA

PostPosted: Wed May 19, 2004 7:39 pm    Post subject: Reply with quote

Yea package.keywords is a great resource. People seriously need to read more into using portage. I know this guide isn't the best and people assume because it emerges everything is fine, but you can end up having packages on your system you can't account for or multiple slotted items you don't know about by not following the guide. Live and learn :-D.
_________________
Ubuntu Linux Dapper Drake running Gnome-2.14.1
[Website | Screenshot | Portage Guide]
Back to top
View user's profile Send private message
teedog
Apprentice
Apprentice


Joined: 09 Mar 2004
Posts: 211

PostPosted: Wed May 19, 2004 8:10 pm    Post subject: Reply with quote

More about why emerge -U is a bad idea. Always use package.keywords instead.

http://forums.gentoo.org/viewtopic.php?p=1060314#1060314
Back to top
View user's profile Send private message
mike4148
l33t
l33t


Joined: 09 Sep 2003
Posts: 641

PostPosted: Wed May 19, 2004 10:30 pm    Post subject: Reply with quote

Code:
ACCEPT_KEYWORDS="~x86 emerge foo"

should be
Code:
ACCEPT_KEYWORDS="~x86" emerge foo
Back to top
View user's profile Send private message
teedog
Apprentice
Apprentice


Joined: 09 Mar 2004
Posts: 211

PostPosted: Wed May 19, 2004 10:43 pm    Post subject: Reply with quote

mike4148 wrote:
Code:
ACCEPT_KEYWORDS="~x86 emerge foo"

should be
Code:
ACCEPT_KEYWORDS="~x86" emerge foo


And you should emphasize that it is a bad idea. The command
Code:
ACCEPT_KEYWORDS="~x86" emerge foo

will cause all the dependencies of foo to be merged with the ~x86 keyword, which is probably not what you want. One should put the necessary ~x86 packages in /etc/portage/package.keywords.

Thanks for pointing out "regenworld". Didn't know about that.
Back to top
View user's profile Send private message
GaMMa
l33t
l33t


Joined: 23 Aug 2002
Posts: 684
Location: USA

PostPosted: Thu May 20, 2004 12:18 am    Post subject: Reply with quote

Fixed the mistake, I had everything in quotes then decided to make it look pretty, I guess I forgot one quotes and to remove the one on the end.

teedog: if people were to ACCEPT_KEYWORDS="~x86" wouldn't emerge -pu world pick up on it and ask that you downgrade? And if it's asking you downgrade, THEN you add it to packages.keywords.

The reason I see doing it this way is better is because say you have a package foo that only has foo-1.0.ebuild. The user adds the package to package.keywords and emerges the program. Little do they know they're really emerging a stable version. Later foo has another version, which is marked unstable. Now the user doesn't know it's unstable, yet he/she will be prompted to upgrade and they'll be going from stable to unstable packages without even realizing it. Plus it keeps the package.keywords less bloated.

Again I could be wrong, please tell me if I am.. I'll fix it :D.
_________________
Ubuntu Linux Dapper Drake running Gnome-2.14.1
[Website | Screenshot | Portage Guide]


Last edited by GaMMa on Thu May 20, 2004 12:20 am; edited 1 time in total
Back to top
View user's profile Send private message
Duty
Apprentice
Apprentice


Joined: 15 Nov 2003
Posts: 253

PostPosted: Thu May 20, 2004 12:20 am    Post subject: Reply with quote

And shouldn't

Code:
echo x11-base/xfree >> /etc/portage/package.keywords


be

Code:
echo x11-base/xfree >> /etc/portage/package.mask
?
Back to top
View user's profile Send private message
teedog
Apprentice
Apprentice


Joined: 09 Mar 2004
Posts: 211

PostPosted: Thu May 20, 2004 1:42 am    Post subject: Reply with quote

GaMMa wrote:

teedog: if people were to ACCEPT_KEYWORDS="~x86" wouldn't emerge -pu world pick up on it and ask that you downgrade? And if it's asking you downgrade, THEN you add it to packages.keywords.


Yes, if you do "ACCEPT_KEYWORDS=~x86 emerge gnome" when you do "emerge -up gnome" Portage will ask you to downgrade. True, you can then add gnome to package.keywords.

GaMMa wrote:

The reason I see doing it this way is better is because say you have a package foo that only has foo-1.0.ebuild. The user adds the package to package.keywords and emerges the program. Little do they know they're really emerging a stable version. Later foo has another version, which is marked unstable. Now the user doesn't know it's unstable, yet he/she will be prompted to upgrade and they'll be going from stable to unstable packages without even realizing it. Plus it keeps the package.keywords less bloated.


But why would a user add foo ~x86 to package.keywords unless he/she specifically wants to use the bleeding edge foo builds from now on?

To restate the reason for not doing "ACCEPT_KEYWORDS=~x86 emerge foo": If you do that, all dependencies of foo will be emerged with keyword ~x86. That can create a major problem when you try to do "emerge -u world" as Portage will try to downgrade everything that is ~x86, and there might be a LOT of them. If you place foo ~x86 in package.keywords, then only foo will be emerged with ~x86; all dependencies will be x86 unless otherwise specified in the ebuild. If the foo.ebuild specifically asks for other ~x86 packages, you can place those in package.keywords too.
Back to top
View user's profile Send private message
GaMMa
l33t
l33t


Joined: 23 Aug 2002
Posts: 684
Location: USA

PostPosted: Thu May 20, 2004 5:53 am    Post subject: Reply with quote

I guess it's a matter of opinion, but your way may be easier. The thing is if there's 50 dependencies that are masked, you do emerge foo.ebuild you add dep1, then run it again and add dep2, that could take a while. As opposed to doing a emerge -puD world and c/ping all the deps that want to be downgraded.
_________________
Ubuntu Linux Dapper Drake running Gnome-2.14.1
[Website | Screenshot | Portage Guide]


Last edited by GaMMa on Wed May 26, 2004 4:17 am; edited 1 time in total
Back to top
View user's profile Send private message
teglsbo
n00b
n00b


Joined: 18 Apr 2004
Posts: 11

PostPosted: Thu May 20, 2004 10:08 am    Post subject: Reply with quote

teedog wrote:

But why would a user add foo ~x86 to package.keywords unless he/she specifically wants to use the bleeding edge foo builds from now on?

Example:

I wanted to have mosml. But there was only a masked package available at the time, so I installed the masked package.

When a stable package becomes available I want to use that, and not use any masked mosml packages after that.

Can that be done in an automatic way?


Last edited by teglsbo on Fri May 21, 2004 12:08 am; edited 1 time in total
Back to top
View user's profile Send private message
tomk
Administrator
Administrator


Joined: 23 Sep 2003
Posts: 7219
Location: Sat in front of my computer

PostPosted: Thu May 20, 2004 10:49 am    Post subject: Reply with quote

Nice guide :)

For fixing your world file, there's a FAQ about it, which explains the use of regenworld and some other commands if regenworld doesn't work.
_________________
Search | Read | Answer | Report | Strip
Back to top
View user's profile Send private message
calhoun
Tux's lil' helper
Tux's lil' helper


Joined: 14 Nov 2003
Posts: 91
Location: Point Pleasant, NJ

PostPosted: Thu May 20, 2004 5:21 pm    Post subject: Reply with quote

GaMMa wrote:

The reason I see doing it this way is better is because say you have a package foo that only has foo-1.0.ebuild. The user adds the package to package.keywords and emerges the program. Little do they know they're really emerging a stable version. Later foo has another version, which is marked unstable. Now the user doesn't know it's unstable, yet he/she will be prompted to upgrade and they'll be going from stable to unstable packages without even realizing it. Plus it keeps the package.keywords less bloated.

Again I could be wrong, please tell me if I am.. I'll fix it :D.


What if you just name the emerged ~x86 version in the keyword file without the "~x86". Will this allow you to run the unstable version, while waiting for the next stable version? This way portage won't assume that you want all future ~x86 versions, but still allow you to run "emerge uDp world" without downgrading the installed apps.

With the package files below, I can run "emerge uDp world" and it won't try to downgrade my apps. This is how I have mine setup, but can't confirm that the apps will update until these applications are upgraded.

Code:
package.keywords
::::::::::::::
=x11-misc/superkaramba-0.33-r1
=sys-apps/qtparted-0.4.4
=app-cdr/cdrtools-2.01_alpha27-r1
=media-gfx/gimp-2.0.0
::::::::::::::
package.mask
::::::::::::::
<media-gfx/gimp-2.0.0
Back to top
View user's profile Send private message
gtaluvit
Tux's lil' helper
Tux's lil' helper


Joined: 09 Aug 2003
Posts: 135
Location: Columbia, MD

PostPosted: Thu May 20, 2004 5:25 pm    Post subject: Reply with quote

Quote:
I guess it's a matter of opinion, but your way may be easier. The thing is if there's 50 dependencies that are masked, you do emerge foo.ebuild you add dep1, then run it again and add dep2, that could take a while. As opposed to doing a emerge -puD world and c/ping all the deps that want to be downgraded.


However, you don't know necessarily why they want to be downgraded. They could have been removed from portage or you have a ~ dependency. It is a pain (particularly with a Gnome 2.6 example) to have to put a seriously large list of ~x86 lines in your keywords file, but it solves any issues you have with doing a emerge -uDav world in the future. Not only that, but if you decide to emerge something else from a stable branch, wouldn't you want it to use the most stable libraries available? By only putting the hard dependencies that are actually required in keywords, you're only using unstable when necessary, not for an entire dependency tree. Anyways, onto my suggestions:

keywords can take versions, so if you only want a specific version installed, you can put a line such as:
Code:
~media-sound/rhythmbox-0.8.1 ~x86
which will allow me to emerge rhythmbox 0.8.1 but not any higher versions if they are masked. The ~ before the line means that it will also allow installs of -r1, -r2, etc if there are updates.

kernel-headers DO NOT need to be version 2.6 for a 2.6 kernel. 2.4 works just fine. You only need to go up to 2.6 if you want to use NPTL. Search the forums but some people have had issues with the 2.6 headers with NPTL.

In addition to package.mask and package.keywords, there is also package.unmask (for things that are hardmasked) and package.use. I use package.use all the time for the bittorrent client. I don't want X support so I have the line:
Code:
net-psp/bittorrent -X
which when emerging would be like
Code:
USE=-X emerge bittorrent


Finally, you may want to mention
Code:
emerge -uDav world
as the line to update world. u does the update, D for deep, v shows what the USE flags are going to be for the emerge, and a stands for ask. a is better than using p for pause since you have to run emerge again without p to do the emerge while with a, you just type yes or no and you don't have to redetermine dependencies.
_________________
I'm out of bed and dressed, what more do you want?
Back to top
View user's profile Send private message
gtaluvit
Tux's lil' helper
Tux's lil' helper


Joined: 09 Aug 2003
Posts: 135
Location: Columbia, MD

PostPosted: Thu May 20, 2004 5:34 pm    Post subject: Reply with quote

Just for examples of these files:

Code:

::::::::::::::
package.keywords
::::::::::::::
~media-gfx/gimp-2.0.0 ~x86
~media-tv/xawtv-3.91 ~x86
~media-libs/xvid-0.9.2 ~x86
~media-gfx/icoutils-0.22.0 ~x86
~media-gfx/inkscape-0.38 ~x86
~dev-python/pyxdg-0.5 ~x86
~gnome-extra/gdesklets-core-0.26 ~x86
~media-sound/grip-3.2.0 ~x86
~media-libs/win32codecs-20031001 ~x86
~net-www/mplayerplug-in-2.60 ~x86
~x11-themes/redhat-artwork-0.95 ~x86
~media-sound/rhythmbox-0.8.1 ~x86
~app-emulation/wine-20040408 ~x86
~media-gfx/gnuplot-4.0 ~x86
#~media-video/mplayer-1.0_pre4 ~x86

# xorg
~x11-base/xorg-x11-6.7.0 ~x86
~x11-terms/xterm-184 ~x86
~sys-apps/utempter-0.5.3.2 ~x86

# Gnome 2.6 (Omitted)
::::::::::::::
package.mask
::::::::::::::
sys-fs/devfsd
dev-lang/tcl
dev-lang/tk
::::::::::::::
package.unmask
::::::::::::::
::::::::::::::
package.use
::::::::::::::
net-p2p/bittorrent -X
x11-themes/redhat-artwork -gtk
media-sound/lame -gtk
net-im/gaim -crypt
media-video/mplayer -gtk theora v4l2
media-libs/libquicktime -gtk
media-libs/libdv -gtk
media-libs/smpeg -gtk
media-tv/xawtv -quicktime
net-www/netscape-flash -gtk
net-mail/evolution -mozilla
x11-themes/lila-artwork -gtk
media-gfx/gnuplot gd
games-misc/fortune-mod offensive

_________________
I'm out of bed and dressed, what more do you want?
Back to top
View user's profile Send private message
NickDaFish
Tux's lil' helper
Tux's lil' helper


Joined: 12 Sep 2002
Posts: 112
Location: Boston, USA

PostPosted: Tue May 25, 2004 5:16 pm    Post subject: Reply with quote

I'm trying to wrap my noodle around this.....
A few weeks ago I upgraded to rsync-2.6.2-r2, but there was a problem with the build so portage quickly reverted back to 2.6.0. The problem was with running an rsync server so I really don't care and I'm happy to leave it at 2.6.2-r2.... So I edited /etc/portage/package.keywords
And added:
Code:
net-misc/rsync


Portage now wants to downgrade me to 2.6.0-r1 rather than 2.6.0?!?!?
I'm very confused. I tryed serveral ways to un-keyword the specific version of rsync that I have installed as explained by gtaluvit (among others).... but I simply CANNOT get this to work. The above line is the only one that appears to have *ANY* effect on emerge (I have tryed ALOT of variations trying to add the version). This isn't urgent.... I'm just trying to figure out how all this is supposed to work..... if anyone can give me any tips/pointers/links ect on what I'm doing wrong I'd be most happy!

Many thanks.....

Nick
Back to top
View user's profile Send private message
gtaluvit
Tux's lil' helper
Tux's lil' helper


Joined: 09 Aug 2003
Posts: 135
Location: Columbia, MD

PostPosted: Tue May 25, 2004 6:11 pm    Post subject: Reply with quote

Rsync is now hardmasked over 2.6.2 according to /usr/portage/profiles/package.mask. If you want an "emerge sync" to work properly, i'd STRONGLY recommend going back down to 2.6.0 unless there is something you need specifically in 2.6.2. So, if that is the case, here is what you need to do.

First, if you run
Code:
etcat -v rsync
it probably looks like the following:

Code:

*  net-misc/rsync :
        [  I] 2.6.0 (0)
        [M~ ] 2.6.0-r1 (0)
        [M~ ] 2.6.2 (0)
        [M  ] 2.6.2-r1 (0)
        [M  ] 2.6.2-r2 (0)
        [M  ] 2.6.2-r3 (0)


Well, mine does, yours probably has the I next to 2.6.2-r2.

Since the package is hard masked, you'll need to unmask it using /etc/portage/package.unmask. If I add this to that file:

Code:
=net-misc/rsync-2.6.2-r2


that will unmask it. Running the above etcat command again:

Code:
*  net-misc/rsync :
        [  I] 2.6.0 (0)
        [M~ ] 2.6.0-r1 (0)
        [M~ ] 2.6.2 (0)
        [M  ] 2.6.2-r1 (0)
        [   ] 2.6.2-r2 (0)
        [M  ] 2.6.2-r3 (0)


It looks like rsync would be perfectly happy now to update. So, all you should need to do is modify your package.unmask file (create it if it doesn't exist) and add that line. Your package.keywords file doesn't need an rsync entry.

Also, if you don't have etcat, emerge app-portage/gentoolkit. It has a lot of helpful utilities.
_________________
I'm out of bed and dressed, what more do you want?
Back to top
View user's profile Send private message
NickDaFish
Tux's lil' helper
Tux's lil' helper


Joined: 12 Sep 2002
Posts: 112
Location: Boston, USA

PostPosted: Tue May 25, 2004 7:15 pm    Post subject: Reply with quote

gtaluvit wrote:
Rsync is now hardmasked over 2.6.2 according to /usr/portage/profiles/package.mask.

:oops: DOH! :oops:

Yeah.... now that I see that it's masked this is all making sence now.
Thanks to all for the great thread BTW!

Nick
Back to top
View user's profile Send private message
GaMMa
l33t
l33t


Joined: 23 Aug 2002
Posts: 684
Location: USA

PostPosted: Sun May 30, 2004 2:33 am    Post subject: Reply with quote

Hey GaMMa again, forums.gentoo.org is supposed to notify me of updates to the thread, but never did. Luckily robmoss2k sent me a PM telling me my guide needed updating. I'm still here, the thread isn't dead and I just updated with the stuff people said.

I'm currently fixing the part teedog and teglsbo noted, so give me a few minutes!

If you find any typos, or things I missed or need to add or aren't clear reply back. Thanks guys for helping with this thread.

UPDATE: All fixed; if I'm missing anything give me a yell!
_________________
Ubuntu Linux Dapper Drake running Gnome-2.14.1
[Website | Screenshot | Portage Guide]
Back to top
View user's profile Send private message
amasidlover
Apprentice
Apprentice


Joined: 16 Jun 2002
Posts: 275
Location: Manchester, UK

PostPosted: Thu Jun 17, 2004 1:41 pm    Post subject: Re: How to use portage correctly Reply with quote

GaMMa wrote:

What is recommend is that one tries emerging the ebuild first, and if it complains the ebuild is unstable take the appropriate action below. Once that is resolved try emerging the package again and it may complain about a dependency. Take appropriate action for the dependency and try to emerge the package again. Keep doing this until the package is emerged. Yes it may seem like a pain, but at least you know what's getting put on your system as far as unstable packages.


I think I have created a couple of scripts which alleviate this. Firstly a script which will do the emerge -p process repeatedy, adding the masked dependencies (specific versions of) to package.keywords. Simply call the following with the package (with version number e.g. gnome-2.6.1_rc1):
Code:
#!/usr/bin/perl
my $package_keywords="/etc/portage/package.keywords";
my $unstable_package=$ARGV[0];

while(system("emerge -puD =$unstable_package 2>/dev/null >/dev/null") ) {
   $_ = `emerge -puD =$unstable_package 2>/dev/null`;
   if(/satisfy \"(.*)\"/i) {
      $package = $1;
      $package =~ s/>//g;
      print "Adding $package to $package_keywords\n";
      `echo "$package ~x86" >> $package_keywords`
   } else {
      print "Some other error occured...\n";
      exit;
   }
}
print `emerge -p =$unstable_package`;

Also, if you want to do a safe version of emerge -U world then the following script will do an emerge -pu world and add anything that portage tries to downgrade to package.keywords:
Code:
#!/usr/bin/perl
my $package_keywords="/etc/portage/package.keywords";
my $output = `emerge -puD world`;

my @lines = split(/\n/,$output);

my $ind;

foreach $ind (@lines) {
   $_ = $ind;
   if(/\[ebuild     UD\] (.*)-[0-9].*\[(.*)\]/i) {
      print "Adding package $1 version $2 to $package_keywords\n";
      `echo "=$1-$2 ~x86" >> $package_keywords`;
   }
}
print `emerge -puD world`;


I can't guarantee that these scripts will always work, or that they won't put rubbish in your package.keywords file. But they should be ok....
Back to top
View user's profile Send private message
stonent
Veteran
Veteran


Joined: 07 Aug 2003
Posts: 1139
Location: Texas

PostPosted: Fri Jun 25, 2004 9:57 pm    Post subject: Reply with quote

What would be the correct way to hard mask headers < 2.6 yet still leave the 2.6 headers masked as well? (Basically freezing the headers until they get unmasked by portage) 2.6.x headers are fine, but it is not necessary for me to have the latest every time they come out.
_________________
Inspiron 4100 & Sun UltraAXe
Portage on Solaris|Dell Laptop Hacks
The way you feel about organized religion is the same way I feel about organized socialism.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum