Posts tagged portage
If you have looked at portage (2.2rc2) lately you will have noticed some nice new things:
Specifies the number of packages to build simultaneously.
Also see the related –load-average option.
Continue as much as possible after an error. When an error
occurs, dependencies are recalculated for remaining packages
and any with unsatisfied dependencies are automatically
dropped. Also see the related –skipfirst option.
Specifies that no new builds should be started if there are
other builds running and the load average is at least LOAD (a
floating-point number). This option is recommended for use in
combination with –jobs in order to avoid excess load. See
make(1) for information about analogous options that should
be configured via MAKEOPTS in make.conf(5).
Interesting blog post with more info.
So how about that? So many people are too busy trying to bury and put a headstone on gentoo that they are not seeing that Gentoo is a live and well. Imagine that! Even through the so called turmoil the media was drumming up, portage was active. People complain that the devs aren’t communicating, but it takes two to complete this process. A gentoo dev isn’t going to come to your house and personally tell you what is going on. The user has to take some initiative and look at the mailing lists that are available, even gentoo planet and gentoo universe. I wish I had a dollar for everytime I heard gentoo was done from someone.
This script has been around since last year and is definitely worth talking about again. I mentioned it on the Sabayon Forum when it first came out to help people with unmasking, but it must of went over their heads as not many comments were not made about it. Since it’s release it has made it’s way into the official portage tree now. It’s fairly simple to use, don’t believe me, take a look at the help file.
root@wolf911:/home/wolfden # autounmask –h autounmask version 0.21 (using PortageXS-0.02.07 and portage-22.214.171.124) Usage: autounmask category/package-version Options: -h, –help : Show this help. -p, –pretend : Just pretend. -n, –noversions : Do not append version when unmasking a package.
It only has 3 switches to remember. Even I can remember those. So lets take an example of using the latest gnome. Gnome contains a lot of packages to unmask and well it would be impossible to guess all the packages. So we fire up autounmask and tell it to do it for us.
# autounmask gnome-base/gnome-2.20.0
It will now do it’s thing and edit the files for you. Once it gets done, all you need to do is:
# emerge -pv =gnome-base/gnome-2.22.0
I like to run versionless, which is really nice with all the new KDE 4 releases. I didn’t need to unmask 4.0.0, 4.0.1 and now 4.0.2. As they roll out, my world update grabs the packages.
# autounmask -n =kde-base/kde-meta-4.0.2
This works for any masked package in portage, single or multiple packages.
One of the scariest things people run into with Gentoo based systems is Portage. It’s not that scary if you just take 5 minutes and read through the material. So you just did a fresh install and have no idea how to install packages. Sabayon and Gentoo have wonderful package manager. Emerge is the client to Portage. We will use emerge to do what we want.
First thing you want to do as root – to do this, open up konsole and type su than
- emerge –sync ——> this may take some time the first time. This is updating your package list so you can have access to the latest packages.
- layman -S ——–> after the above is done it’s time to update your overlay package list so you can have access to it’s latest packages. “Overlays” are package trees for Portage.
After that is complete you are now ready to install the latest packages. You may issues both commands at same time by simply doing emerge –sync && layman -S. That one command will do the same as running both the commands above. So now lets say we want to install the package called foo.
- emerge foo ——-> pretty tough huh? What if you just want to update foo since it’s already installed
- emerge foo or emerge -u foo ———> either of those will work. The -u option also upgrades all dependencies of that package instead of just the package itself.
- You should get into the habit of using the -av or -pv switches so you can see what is going to happen to your system before hand. emerge -av foo will ask with verbose before it actually installs and emerge -pv foo will just do a pretend with verbose and not actually install anything. You don’t want to spend 45 minutes compiling something to discover you forgot a flag or something.
Super now you are adding packages to your system. Installed something you don’t like?
- emerge -C foo ——> will remove that package, but it doesn’t remove the dependencies it brought with it. You will have to use depclean for that, but you better know what you are doing before depclean as you will more than likely hose your system. Also note, Portage is case sensitive.
Lets say we want to install or uninstall several packages
- emerge foo foo1 foo2 foo3 foo4 foo5 ——–> this will install each package one after another.
- emerge –resume –skipfirst ——–> use this option if package foo2 fails in the above command, but you still want foo3 foo4 and foo5 to install. It will resume the installations, but will skip the package foo2.
- emerge -C foo foo1 foo2 foo3 foo4 foo5 ——–> this will uninstall each package one after anther.
How to find a package in portage
- emerge -s foo ——–> this will find all packages that contain foo. So if you want to install firefox and you are punching in emerge firefox and portage is going there are no ebuilds for firefox you will want to do a emerge -s firefox and you will discover that the package is really called mozilla-firefox.
- I highly recommend you install eix as it is the king for searching portage. You don’t want to be without this great tool. It works for finding packages in overlays even. Don’t even think about it, just get it.
- emerge eix && update-eix Than all you have to do is eix foo instead of emerge -s foo
Gentoo based systems are an install once and just maintain your system via portage. It takes a while to get the hang of doing system and world updates. You need to understand portage and listen to it as you can run into errors with compiling packages for various reason. You will need to search out the solution via gentoo, sabayon forum or bugzilla. It’s something that just comes to you as you use the operating system
- emerge -uaDN –world —–> is the command you will want to get familiar with. After you have done your syncs this command will bring you current with portage. I highly recommend you take a look at a really nice script that will make your life easier for updating. This will do the above command and more, such as help work around blocks and packages that fail.
- It’s not necessary to do this daily, but some do setup a cron job to run a world update. I personally do it like once a week. I guess do it as you feel you need to.
- People frequently ask about an auto update notification. It’s pointless in the gentoo based world as portage changes every day. As I said, some people set up a cron job to run daily for a world update. You can see for yourself daily changes.
- C0mpiling isn’t fast by any means. People are horrified to find out it took 40 minutes to install firefox. I just say back, try openoffice than, you’re talking 6 hours on a fairly decent machine. Luckily there is a binary version of openoffice in portage to ease the pain.
- Sabayon Linux is developing a binary package manager that you can use in replace of portage. As of today, it is still in beta and is called entropy that uses the client equo to manage packages. Instead of emerge foo you will do equo install foo. You can even do world updates with equo, but keep in mind that entropy will not have the latest packages like portage will. It will be close to portage, but portage will always have the latest. So if you don’t want to compile your packages, entropy will be for you. There will be a GUI available with entropy also.
- Speaking of GUI package managers, I don’t really recommend them. They all have their problems and are just not reliable. Many people have a GUI package manager and use it for browsing portage, but use the command line to actually install the package. Don’t be afraid to use the command line, it’s your most powerful tool you will get your hands on. When all else fails you can normally always depend on your command line. Learn it, can’t stress it enough.
- Layman is another handy tool to have. Let’s face it, portage can not contain every single package out there. Overlays help solve this and you can even maintain your own personal overlay if you wish. So if a package is not in portage, check the overlays. You can use eix to search for packages in portage and overlays. Once you find the package, use layman to add your overlay and emerge your package.
- eix foo
- layman -a overlayname
- emerge foo
- Security aka GLSA is very well documented in the handbook.
- glsa-check -t all – to see if effected
- glsa-check -p $(glsa-check -t all) – to see what packages will be installed
- glsa-check -f $(glsa-check -t all) – to apply updates
It’s definitely something you have to learn and see the Sabayon Linux wiki for even more information on Portage. Bookmark the gentoo wiki as it is full of howtos to follow. Follow the links posted in this post to explore more information. Use the package manager as much as you can as this will help maintain your system with ease. Things installed outside of the package manager are totally on their own and can cause problems.