Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

How to choose USE flags?

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
24 posts • Page 1 of 1
Author
Message
viio
n00b
n00b
Posts: 33
Joined: Tue Mar 17, 2020 5:21 pm

How to choose USE flags?

  • Quote

Post by viio » Sat Mar 21, 2020 1:20 pm

Hi,

I've installed Gentoo with the "default/linux/amd64/17.1/hardened (stable)" profile.

Currently no custom USE flags are set.

I am wondering what's best practice to choose USE flags?
I guess going through this list from top to bottom doesn't make much sense.

My goal is to have a very minimal desktop configuration with X and a window manager like i3.
So I guess I could add "-gnome -kde -xfce" as a basis.

Before I install a new package, how can I see the USE flags it will be build with?
Then I can look closer to the description of these flags and either set/unset them globally or for this package only.


PS: This forum is missing an inline code BBCode.
Top
alexander-n8hgeg5e
n00b
n00b
Posts: 58
Joined: Sat Nov 02, 2019 2:47 pm

  • Quote

Post by alexander-n8hgeg5e » Sat Mar 21, 2020 1:42 pm

if you emerge with --ask and --verbose the use-flags will be shown and you
will be asked whether you want to proceed.

For use-flags it think, just add them from time to time if you feel
you want to.
Top
fedeliallalinea
Administrator
Administrator
User avatar
Posts: 31976
Joined: Sat Mar 08, 2003 11:15 pm
Location: here
Contact:
Contact fedeliallalinea
Website

  • Quote

Post by fedeliallalinea » Sat Mar 21, 2020 1:52 pm

The profiles add all you need to run correctly each one.
If you use a window manager you can choose desktop profile.
If in the time you need some use flag you can add it globally in make.conf or for single package in /etc/portage/package.use and the run emerge -UD @world command for apply new use flag to all installed packages
Questions are guaranteed in life; Answers aren't.

"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Top
charles17
Advocate
Advocate
Posts: 3686
Joined: Sun Mar 02, 2008 3:20 pm

Re: How to choose USE flags?

  • Quote

Post by charles17 » Sat Mar 21, 2020 3:47 pm

viio wrote:So I guess I could add "-gnome -kde -xfce" as a basis.
Unless some package you want to install pulls in stuff you don't want, there is no need for that.
The profile you selected has those flags not enabled, so you don't need to disable them.
Top
CBf9YHqgmkfqQe
n00b
n00b
Posts: 2
Joined: Sat Mar 21, 2020 5:35 pm

  • Quote

Post by CBf9YHqgmkfqQe » Sat Mar 21, 2020 5:46 pm

I wouldn't start by blindly adding a whole ton of use flags until you know what they do. It's best to slowly add them over time. Start off with easy ones you know you want or don't want. For example, if you don't like KDE, you could do "-qt5 -kde" or something along those lines.

Use "emerge --preview --verbose package-name-here-lol" and it shows you all the USE flags that a specific package uses, use that tool to figure what USE flags to add or remove over time. Also if you're unsure what a specific USE flag does, the "euses my-awesome-use-flag" package is very useful, as it searches by USE flags and gives you a short description on what that USE flag does, so you can be more educated on if you should add/remove that flag from your global USE flags, or just make it program specific.

More USE flags is not better, in fact I'd argue you want as minimal as possible. Too many USE flags that are randomly added can cause conflicts in the future. Be educated with the "euses" program to be sure you really want to add it to your global USE flag.
Top
Jaglover
Watchman
Watchman
User avatar
Posts: 8291
Joined: Sun May 29, 2005 1:57 am
Location: Saint Amant, Acadiana

  • Quote

Post by Jaglover » Sat Mar 21, 2020 5:51 pm

app-portage/ufed is a great tool to set your global flags, and more.
My Gentoo installation notes.
Please learn how to denote units correctly!
Top
viio
n00b
n00b
Posts: 33
Joined: Tue Mar 17, 2020 5:21 pm

  • Quote

Post by viio » Sat Mar 21, 2020 5:54 pm

Thanks everyone for the input.

The "emerge --verbose --preview" command is exactly what I was looking for. :)

Both euse and ufed look nice, but currently I'm fine applying the changes manually to the specific files.
Top
charles17
Advocate
Advocate
Posts: 3686
Joined: Sun Mar 02, 2008 3:20 pm

  • Quote

Post by charles17 » Sat Mar 21, 2020 5:59 pm

Replace it with "emerge --verbose --pretend --ask"
Top
AlexJGreen
Tux's lil' helper
Tux's lil' helper
Posts: 149
Joined: Wed Sep 19, 2018 5:37 pm

Re: How to choose USE flags?

  • Quote

Post by AlexJGreen » Sat Mar 21, 2020 6:07 pm

_
Last edited by AlexJGreen on Mon Dec 28, 2020 3:15 am, edited 1 time in total.
Top
389292
Guru
Guru
Posts: 504
Joined: Tue Mar 26, 2019 2:06 pm

  • Quote

Post by 389292 » Sat Mar 21, 2020 6:52 pm

When I first started I just compared base and desktop profile USE flags, and then chose base profile and put what I need from desktop to make.conf It were most of the flags, but not all of them. It does make sense to go through that list if you want a complete list of flags even for something you may install in the future.
Top
viio
n00b
n00b
Posts: 33
Joined: Tue Mar 17, 2020 5:21 pm

  • Quote

Post by viio » Sat Mar 21, 2020 9:34 pm

etnull wrote:When I first started I just compared base and desktop profile USE flags
That's a good idea.
Thanks.

I know I can list all flags of the current profile with "emerge --info".
But how could I see which flags some other profiles use?
Top
389292
Guru
Guru
Posts: 504
Joined: Tue Mar 26, 2019 2:06 pm

  • Quote

Post by 389292 » Sat Mar 21, 2020 9:46 pm

If I remember correctly I just 'eselect profile set' to the needed one temporarily. It should also be somewhere in the guts of portage, but I don't remember the directory without research.
Top
pietinger
Moderator
Moderator
Posts: 6608
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Sat Mar 21, 2020 9:55 pm

viio wrote:But how could I see which flags some other profiles use?
I have NO-MULTILIB, but also want KDE. But there is no profile for this. So I know only one trick:

1. Do an emerge --info and write down (or copy to a file) all used USE-Flags.
2. Then change with eselect profile to a desktop profile you wish.
3. Do an emerge --info again and save now the used USE-Flags.
3. Change back with eselect profile to your original profile.
4. Pull in all new USE-Flags in you make.conf.
Top
AlexJGreen
Tux's lil' helper
Tux's lil' helper
Posts: 149
Joined: Wed Sep 19, 2018 5:37 pm

  • Quote

Post by AlexJGreen » Sun Mar 22, 2020 7:52 pm

_
Last edited by AlexJGreen on Mon Dec 28, 2020 3:15 am, edited 1 time in total.
Top
pietinger
Moderator
Moderator
Posts: 6608
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Wed Mar 25, 2020 8:21 am

coderanger wrote:https://wiki.gentoo.org/wiki/Profile_(P ... g_profiles
Thank you very much for this link. I read it more than one time and I am not able to understand what is going on there ... so my solution for now is: Copying all the stuff from .../target/desktop and .../target/desktop/plasma into my /etc/portage.

I would like to know why it is so impossible for the gentoo developers to give us just 4 profiles more ... :-(
Top
charles17
Advocate
Advocate
Posts: 3686
Joined: Sun Mar 02, 2008 3:20 pm

  • Quote

Post by charles17 » Wed Mar 25, 2020 8:24 am

pietinger wrote:
coderanger wrote:https://wiki.gentoo.org/wiki/Profile_(P ... g_profiles
Thank you very much for this link. I read it more than one time and I am not able to understand what is going on there ...
You are not alone ...
Top
fedeliallalinea
Administrator
Administrator
User avatar
Posts: 31976
Joined: Sat Mar 08, 2003 11:15 pm
Location: here
Contact:
Contact fedeliallalinea
Website

  • Quote

Post by fedeliallalinea » Wed Mar 25, 2020 9:03 am

coderanger wrote:
pietinger wrote:I have NO-MULTILIB, but also want KDE. But there is no profile for this.
Combining profiles
If you need to combine two existing profiles it's no so complicate.
First you should create a local overlay, after that the steps are (in this example I combine no-multilib with plasma for amd64 arch):
  • create profile directory in local overlay with mkdir -p /var/db/repos/local/profiles/no-multilib-plasma, where no-multilib-plasma is the profile name
  • create parent file with plasma and no-multilib: echo -e "gentoo:default/linux/amd64/17.1/no-multilib\ngentoo:default/linux/amd64/17.1/desktop/plasma" > /var/db/repos/local/profiles/no-multilib-plasma/parent
  • the last step is add profile in profiles.desc with echo "amd64 no-multilib-plasma dev" >> /var/db/repos/local/profiles/profiles.desc
At this point you can select profile with eselect

Code: Select all

$ eselect profile list 
Available profile symlink targets:
...
[35]  local:no-multilib-plasma (dev)
Questions are guaranteed in life; Answers aren't.

"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Top
pietinger
Moderator
Moderator
Posts: 6608
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Wed Mar 25, 2020 9:58 am

fedeliallalinea wrote:First you should create a local overlay, after that the steps [...]
Thank you very much, fedeliallalinea. You help me again. You said, I have to create a local overlay. I found some information and put them together in "Step 1", but I am not sure, if it is complete.

So, may I ask you again: Would be step 1 correct ? Is it all I would need (or too much) ?

--- Step 1: Creating a local repo

# mkdir -p /var/db/repos/local/{metadata,profiles}
# chown -R portage:portage /var/db/repos/local
# echo 'local' > /var/db/repos/local/profiles/repo_name
# nano -w /var/db/repos/local/metadata/layout.conf
===>
masters = gentoo
auto-sync = false
<===
# nano -w /etc/portage/repos.conf/local.conf
===>
[local]
location = /var/db/repos/local
<===

--- Step 2: From fedeliallalinea

# mkdir -p /var/db/repos/local/profiles/no-multilib-plasma
#echo -e "gentoo:default/linux/amd64/17.1/no-multilib\ngentoo:default/linux/amd64/17.1/desktop/plasma" > /var/db/repos/local/profiles/no-multilib-plasma/parent
#echo "amd64 no-multilib-plasma dev" >> /var/db/repos/local/profiles/profiles.desc
Top
fedeliallalinea
Administrator
Administrator
User avatar
Posts: 31976
Joined: Sat Mar 08, 2003 11:15 pm
Location: here
Contact:
Contact fedeliallalinea
Website

  • Quote

Post by fedeliallalinea » Wed Mar 25, 2020 10:06 am

Step 1 seems looks ok
Questions are guaranteed in life; Answers aren't.

"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Top
pietinger
Moderator
Moderator
Posts: 6608
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Wed Mar 25, 2020 10:10 am

fedeliallalinea wrote:Step 1 seems looks ok
Thank you again ... (you are fast as a shark :D )
Top
pietinger
Moderator
Moderator
Posts: 6608
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Wed Mar 25, 2020 10:47 am

I did it ... and had the problem with "multilib" again, but ...

Code: Select all

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

Calculating dependencies... done!
[ebuild   R    ] sys-apps/sandbox-2.13::gentoo  ABI_X86="(32*) (64) (-x32)" 416 KiB
[ebuild   R    ] dev-util/cmake-3.16.5::gentoo  USE="ncurses qt5* -doc -emacs -test" 0 KiB
[ebuild   R    ] sys-devel/gcc-9.2.0-r2:9.2.0::gentoo  USE="(cxx) fortran (multilib*) nls nptl openmp pch (pie) sanitize ssp vtv (-altivec) -d -debug -doc (-fixed-point) -go -graphite (-hardened) (-jit) (-libssp) -lto -objc -objc++ -objc-gc -pgo -systemtap -test -vanilla" 0 KiB
[ebuild   R    ] sys-libs/glibc-2.29-r7:2.2::gentoo  USE="multiarch (multilib*) ssp -audit -caps (-cet) -compile-locales -doc -gd -headers-only -nscd -profile (-selinux) -suid -systemtap -test (-vanilla)" 2.337 KiB
... if I change the order in the file "parent", it is all OK. No "multilib" anymore :-)

So in step 2 it must be:

# echo -e "gentoo:default/linux/amd64/17.1/desktop/plasma\ngentoo:default/linux/amd64/17.1/no-multilib" > /var/db/repos/local/profiles/no-multilib-plasma/parent


So the complete procedure is:

Code: Select all

# mkdir -p /var/db/repos/local/{metadata,profiles}
# chown -R portage:portage /var/db/repos/local
# echo 'local' > /var/db/repos/local/profiles/repo_name
# nano -w /var/db/repos/local/metadata/layout.conf
===>
masters = gentoo
auto-sync = false
<===
# nano -w /etc/portage/repos.conf/local.conf
===>
[local]
location = /var/db/repos/local
<===
# mkdir -p /var/db/repos/local/profiles/no-multilib-plasma
# echo -e "gentoo:default/linux/amd64/17.1/desktop/plasma\ngentoo:default/linux/amd64/17.1/no-multilib" > /var/db/repos/local/profiles/no-multilib-plasma/parent
# echo "amd64 no-multilib-plasma dev" >> /var/db/repos/local/profiles/profiles.desc
Top
grknight
Retired Dev
Retired Dev
Posts: 2549
Joined: Fri Feb 20, 2015 9:36 pm

  • Quote

Post by grknight » Tue Mar 08, 2022 3:42 pm

pietinger wrote:

Code: Select all

# mkdir -p /var/db/repos/local/{metadata,profiles}
# chown -R portage:portage /var/db/repos/local
# echo 'local' > /var/db/repos/local/profiles/repo_name
# nano -w /var/db/repos/local/metadata/layout.conf
===>
masters = gentoo
auto-sync = false
<===
# nano -w /etc/portage/repos.conf/local.conf
===>
[local]
location = /var/db/repos/local
<===
# mkdir -p /var/db/repos/local/profiles/no-multilib-plasma
# echo -e "gentoo:default/linux/amd64/17.1/desktop/plasma\ngentoo:default/linux/amd64/17.1/no-multilib" > /var/db/repos/local/profiles/no-multilib-plasma/parent
# echo "amd64 no-multilib-plasma dev" >> /var/db/repos/local/profiles/profiles.desc
Fixing a few minor issues here to those that find this post

Shorten parent path to not reapply all of 17.1 again;
Ensure profile-formats is set;
Drop unused auto-sync;

Code: Select all

# mkdir -p /var/db/repos/local/{metadata,profiles}
# chown -R portage:portage /var/db/repos/local
# echo 'local' > /var/db/repos/local/profiles/repo_name
# nano -w /var/db/repos/local/metadata/layout.conf
===>
masters = gentoo
profile-formats = portage-2
<===
# nano -w /etc/portage/repos.conf/local.conf
===>
[local]
location = /var/db/repos/local
<===
# mkdir -p /var/db/repos/local/profiles/no-multilib-plasma
# echo -e "gentoo:default/linux/amd64/17.1/desktop/plasma\ngentoo:arch/amd64/no-multilib" > /var/db/repos/local/profiles/no-multilib-plasma/parent
# echo "amd64 no-multilib-plasma dev" >> /var/db/repos/local/profiles/profiles.desc
Top
pietinger
Moderator
Moderator
Posts: 6608
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Tue Mar 08, 2022 4:46 pm

grknight,

thank you very much for this update !

Not only I am using it for myself - I gave this as recommendation in my german installation guide (I will now update immediately).

Many Greetings,
Peter
Top
pietinger
Moderator
Moderator
Posts: 6608
Joined: Tue Oct 17, 2006 5:11 pm
Location: Bavaria

  • Quote

Post by pietinger » Wed Oct 16, 2024 1:06 am

I am adding to this old thread because I have linked to it very often ... and there are now wiki articles:

Although “only” for DESKTOP+HARDENED, but maybe that's exactly what you're looking for. ;-)

https://wiki.gentoo.org/wiki/Hardened_Desktop_Profiles

https://wiki.gentoo.org/wiki/KDE/Harden ... ma_profile
https://wiki.gentoo.org/wiki/GNOME/Guid ... E_Profiles
https://wiki.gentoo.org/wiki/User:Pietinger --> https://wiki.gentoo.org/wiki/User:Pieti ... _at_Gentoo
Top
Post Reply

24 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy