Thursday, 12 July 2012

gentoo notes

Notes from gentoo handbook

Search by pkg name
emerge --search
Search by desc
emerge --searchdesc
dry run
emerge --pretend
fetch only
emerge --fetchonly
   This downloads the pkg in /usr/portage/disfiles/. Even the ones which you install are downloaded here and later compiled and installed. Fetchonly downloads but doesnt install.
Query which pkg a file belongs to or which are files provided by the pkg, intall app-portage/gentoolkit and run
equery files
remove a pkg
emerge --unmerge
  This does not remvoe dependencies or warn if it is a dependency. Removing is messy, try and avoid it.
update the entire system
emerge --update --deep --with-bdeps=y --newuse world

SLOTS : are mechanism to allow different ver of same pkg to be installed. The pkg name remains same. The slot is used to differentiate them.
virtuals : are place holder pkgs. for example logger is virtual which is provided to pkges with dependency on logging functionality. This logger virtual can be syslog-ng or ksyslogd, etc.

If you get masked error msg when installing a pkg. Try to get another pkg with same functionality. This pkg has been masked for not suiting your profile or breaking some functionality

use flags can be specified in global loc. /etc/make.conf or in pkg individual loca. /etc/portage/package.use

services are started and stopped via scripts in /etc/init.d/ . it also accepts addition arguments like zap, pause, ineed.
zap resets the current state of the process to stopped
where action = add or del (both are keywords and self explanatory)
service = eg. httpd sendmail, etc
runlevel = mostly this "default"

rc-update -v show :- shows services details like what is starting on what runlevel etc.

gentools provide equery, which you can use to query packages. It accepts wildcard characters, but as usual they must be qouted to prevent shell messing it up.
equery list pkg :- will tell you if pkg is installed on the pc or not.
equery belongs -e /path/to/file :- will tell you which packages the file belongs to. -e option tells equery to stop searching on first match, which is what you would usually want. I dont like one package file belonging to multiple pkgs.
equery files pkg :- gives list of files belonging to the pkg.

There is another tool called q which does the functionalities provided by equery in a much more efficent and faster way. It is a part of portage-utils. But i have postponed learning it for another day, the day when i think equery is limiting for me.

I found that certain utility like emerge will stop giving coloured output when the output device is not tty. So if you do emerge --search pkg | less then less will show colour less output. But it is not less fault. less is capable of showing color. The fix to this is pass the optiion --color=y to emerge.

I see that there are alternatives to emerge --search and portage itself. eix will do the emerge's search but more efficiently. But emerge has evolved since the days when eix solved the problem. Similarly is the case with paludis, but here it is for portage.

sudo hints

I found that you can extend sudo time with sudo -v and you can cancel sudo time with sudo -k. By sudo time, i mean the time duration between subcequent sudo command that dont require you to re-enter sudo password. Usualy this time is 5 mins.

No comments:

Post a Comment