Gentoo : How to add USE flags permanently

As usual I was trying to update my Gentoo system (quite routine check) and found that emerge throwing some problem to me.Here is the output of that problem:

bhaskar@bhaskar-laptop_10:19:11_Thu Jan 13:~> sudo emerge --ask --verbose --newuse --deep --update world

These are the packages that would be merged, in order:

Calculating dependencies… done!

emerge: there are no ebuilds built with USE flags to satisfy “=dev-lang/php-5.3.5[gd]”.
!!! One of the following packages is required to complete your request:
– dev-lang/php-5.3.5 (Change USE: +gd)
(dependency required by “dev-lang/php-5.3.5” [ebuild])
(dependency required by “virtual/httpd-php-5.3” [ebuild])
(dependency required by “www-apps/dokuwiki-20091225c” [installed])
(dependency required by “@selected”)
(dependency required by “@world” [argument])

So it is complaining about some software need some specific flags to be set,otherwise it won’t allow you get past it.

Now in Gentoo you can set the USE flag for a particular software in the commandline itself with the emerge invoking the software.Clear?? If not then take a look at how you can:

bhaskar@bhaskar-laptop_10:39:43_Thu Jan 13:~> sudo USE="whatever_flag" emerge -av packagename

It will work fine! but the problem is with this method is that the USE flag contents are forget by the os once the execution of this command over!! .Means if the os try to update the same software second time it wouldn’t able to determine that it was compiled with some specific flags.

Now the solution to this problem can be cured like this: If not already present create a file called package.use in /etc/portage directory. Like below:

bhaskar@bhaskar-laptop_10:39:43_Thu Jan 13:~> ls -al /etc/portage
total 44
drwxr-xr-x 5 root root 4096 Jan 13 10:19 .
drwxr-xr-x 100 root root 4096 Jan 13 10:32 ..
-rw-r--r-- 1 root root 0 Dec 28 09:59 .keep_sys-apps_portage-0
drwxr-xr-x 2 root root 4096 Jun 14 2010 bin
-rw-r--r-- 1 root root 56 Nov 12 2009 modules
-rw-r--r-- 1 root root 14 Sep 22 08:34 package.keywords
-rw-r--r-- 1 root root 174 Jan 13 09:15 package.license
-rw-r--r-- 1 root root 22 Jan 13 08:09 package.mask
-rw-r--r-- 1 root root 62 Jan 13 08:09 package.provided
-rw-r--r-- 1 root root 50 Jan 13 10:19 package.use
drwxr-xr-x 2 root root 4096 Jun 14 2010 postsync.d
drwxr-xr-x 3 root root 4096 Jan 8 2010 savedconfig

Now whatever software you need to update with a special or particular flags ;those thing you put into this file like this:

bhaskar@bhaskar-laptop_10:47:49_Thu Jan 13:~> sudo cat /etc/portage/package.use
dev-db/sqlite extensions
dev-lang/php apache2 gd

Format of this file is packagename space flagname, which can be separated by spaces.Now once you have done that and try to update then it will smoothly do the thing for you.

Hope this will help.



About unixbhaskar
GNU/Linux Consultant

One Response to Gentoo : How to add USE flags permanently

  1. Pingback: Links 15/1/2011: 1-Second Linux Boot, Firefox 4 Beta 9 | Techrights

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: