Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
A few tips using portage
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
catkfr
Guru
Guru


Joined: 02 Aug 2004
Posts: 300

PostPosted: Mon Oct 18, 2004 7:20 pm    Post subject: A few tips using portage Reply with quote

I've seen quite a few people asking questions on these forums about portage which could easily have been solved on their own knowing some tricks related to portage and the emerge function. These tricks are documented but not always well known so I decided to write these down hoping these may be useful to a few other novice like me...

1. Using emerge -atDv
When doing an upgrade or simply merging an application, I use the "ask", "tree", "deep" and "verbose" options in emerge.
- ask (-a) will give you the same output as pretend (-p) but will ask you whether you wish to go on with the install.
- deep (-D) will recursively update the dependencies. This is not necessary (but it doesn't hurt) when emerging an application, but should always be used when updating (but it will result in much slower dependency calculation: yet another reason to use -a instead of -p).
- verbose (-v) will show the various USE flags and whether or not they will be used during the install: This allows for a quick way to check you forgot to change your USE flags when you are installing a new application.
- tree (-t) is probably the less known and more useful flag here. It gives you a tabulated view of packages and dependencies.

Code:
# emerge -atDv package
# emerge -auDtv world


Now you may wonder why use these flags if you are perfectly happy with the ones you are using now... The verbose flag allows you to see the USE flags for each application. This way, if you see a big dependency you know you will not want or use, you can see what active USE flag may be related to this dependency. And if you have a problem, the output given by these flags allow you to easily understand what is going on and how to fix it.

2. Fixing common problems with emerge
The most common problems I have encountered and have seen people ask questions about in the forums are blocks, and upgrade-downgrade loops.

blocks
When a block happens, fixing it is usually not that difficult although sometimes frustrating. Most of the time, blocks concern dependencies of what you are really trying to install. The tabulated output (tree option) of emerge will allow you to verify this by looking at the line above the block.

If a package blocks another one, this can be fixed by unmerging (-C) the package blocking it and then emerging the new package using
Code:
# emerge -C package_causing_block
# emerge -aDtv --oneshot new_package

The --oneshot option should be removed if you want this package to be added to your world file (not recommended or necessary if this is a dependency).

You can now resume the emerge you were doing. Once this is done, you can do an emerge -auDtv world to check that the blockage is gone for good.

upgrade-downgrade loops:
It may happen that you upgrade to a masked version of a package and that the next time you run emerge, it will want to downgrade to an earlier version. If you do downgrade, the next update will want to upgrade once again restarting the loop.
Assuming you have done this the right way (i.e. not using ACCEPT_KEYWORDS on the command line but by using /etc/portage/packages.keywords and possibly /etc/portage/packages.unmask), this happens because another package will require the downgrade. In this case, looking at the output of emerge using the flags described previously (more precisely the tree flag), the package which will require the downgrade will be printed on the screen directly above the package which is being downgraded. With this information, you can then look at the ebuild, the Changelog or look in the forums as to why this is happening.

---------------

I hope these tricks will be useful. Comments, suggestions are more then welcome.
Back to top
View user's profile Send private message
mikkelhoegh
n00b
n00b


Joined: 27 Aug 2004
Posts: 71
Location: Herning, Denmark

PostPosted: Tue Oct 19, 2004 7:15 am    Post subject: Reply with quote

neat - especially the -t flag :)
_________________
freak n:
Slang: An eccentric or nonconformist person, especially a member of a counterculture.
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
Page 1 of 1

 
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