# List of things, we shouldn't do in gentoo...

## nolim

If anyone doesn't understand why we shouldn't these action, please ask.

Here is the list of things you shouldn't do:

1.

```
emerge --unmege gcc
```

2.

```
emerge -Du system
```

Do instead: 

```
emerge -e world
```

3.To work as root in graphic environment!

4.Install software not by portage(The program exists in portage)

5.Install several packages in several terminals at the same time().

6.I am recommending not using hardend flag only if you have to...

Add more things to that list...

----------

## Ctrl+Alt+Del

emerge --unmerge python/glibc is equally dumb  :Wink: 

in general don't use root unless needed. X or not.

why should one prefer -e world over -uD ? they are two different things for different purposes.

my all time favorite: never ever type shutdown -h / init 0 into a shell unless you have physical access to the box...

----------

## nolim

About the root you are right, and I want to add that it's better to use sudo.

You can limit yourself as a superuser(can only change several environment variables and more-Not acces to all the system).

emerge -Du system will update your system development tools so you and will probablyl break some packages.

If you still want to update your system and gcc...you should type emerge -e world...

emerge -Du world is perfectly fine when you just want to update your programs...

It has nothing to do with emerge -Du system, except the emerge -Du.

----------

## Blue Fox

 *nolim wrote:*   

> About the root you are right, and I want to add that it's better to use sudo.
> 
> You can limit yourself as a superuser(can only change several environment variables and more-Not acces to all the system).
> 
> emerge -Du system will update your system development tools so you and will probablyl break some packages.
> ...

 Not really, emerge -Du world you most likely upgrade your 'system' metapackage.

----------

## e-ipi

 *nolim wrote:*   

> If anyone doesn't understand why we shouldn't these action, please ask.
> 
> 4.Install software not by portage(The program exists in portage)
> 
> 

 

Hmm... I kinda disagree with this one.  I understand that it really makes no sense to work with gentoo unless one uses portage, but in some cases, the portage packages are more hassle than installing something on your own.  

Here's an example:

I use texlive rather than tetex.  Since I'm on ppc, I need to compile all the tetex binaries because texlive doesn't supply them for linux-ppc.  It is generally a Big Hassle to have two TeX installations, so I do it myself rather than use portage.    (And even on x86 you probably wouldn't want to use portage if you were going to use texlive.)  With texlive, I get TeX/LaTeX stuff that portage masks.  (why?  they're just TeX/LaTeX packages)  In general, texlive is a lot easier to deal with than the ebuilds. 

There are also times when you need something immediately and the ebuild is broken or behind the curve.  I guess the gentoo thing to do is fix it or update the ebuild, but that doesn't always happen.

----------

## brfsa

why it isn't good to emerge several packages in different terminal?

I always do emerge in different ttys, but they are different programs always.

----------

## Parasietje

I agree with e-ipi: some programs aren't in portage. Instead of writing an ebuild for them, you can just install them in /usr/share/local, where they belong.

All programs not installed by some package manager go in /usr/share/local, that's why there is such a directory...

My all-time favorite: always do rc-update del xdm, before fiddling with an xorg.conf. If your X crashes or boots without proper keyboard input, you'll have to search another pc to be able to reboot using ssh.

----------

## moppsy

 *Quote:*   

> All programs not installed by some package manager go in /usr/share/local, that's why there is such a directory... 

 

I think you mean /usr/local.

Anyways, some of us ancient unix people would probably disagree with that.

LFHS has it correct.

As far as  *Quote:*   

> 4.Install software not by portage(The program exists in portage)

 

It is probably a good idea to not do it unless the situation calls for it.  

Simply to make your job as administrator easier, which is the whole purpose of package managers.

----------

## Dont know anything

emerge -C python is kind of bad too.

----------

## brfsa

very bad I agree, 

emerge won't work then...

----------

## phsdv

 *nolim wrote:*   

> Here is the list of things you shouldn't do:

 

may be to obvious

```
rm -rf /
```

and this one?

```
%wheel  ALL=(ALL)       NOPASSWD: ALL
```

----------

## gabrieldain

This is probably the worst thing you can do:

```
emerge -C vi && emerge emacs
```

 :Rolling Eyes: 

Gabi

----------

## beatryder

 *nolim wrote:*   

> About the root you are right, and I want to add that it's better to use sudo.
> 
> 

 

I dissagree, as running any command as root that can open a shell (links/vi) will give that user root access, and it's not logged.

http://linuxboxadmin.com/articles/sudo-vs-root.php

I know its based on OSX, but the principles apply

----------

## killfire

 *Ctrl+Alt+Del wrote:*   

> 
> 
> my all time favorite: never ever type shutdown -h / init 0 into a shell unless you have physical access to the box...

 

a good habit is to open a new xterm before su-ing and shutdown -h-ing.... if you use an open one, you might use one that is ssh-ed into another box. woops!

----------

## salam

happened to me twice   :Laughing: 

i was in need to reboot the laptop to do some windoze stuff so i typed reboot and ctrl-d several times to logout and close aterm. after a minute it was a bit suspicious that nothing happened. of course, i typed it to a terminal ssh-ed to my server. by mistakes we learn...   :Razz: 

and my favorite one(related to remote administration) - never type iptables -F before ensuring that default input policy is ACCEPT

----------

## jamiethehutt

 *brfsa wrote:*   

> why it isn't good to emerge several packages in different terminal?
> 
> I always do emerge in different ttys, but they are different programs always.

 

Yeah, portage has pretty good file locking. I almost always run emerge -f package along side the normal emerge (so the packages will be downloading while the others compile).

----------

## Trevoke

 *Quote:*   

> 5.Install several packages in several terminals at the same time(). 

 

time() ? 

... Do you mean, start them at precisely the same moment in time? It's a little hard to do anyway.

I usually do several emerges together. I'd go insane otherwise.

----------

## madth3

A not so simple one that just hit me was:

Adding -malign-double to CFLAGS

Broke ALSA and some programs worked with a weird behaviour.

----------

## nephros

 *moppsy wrote:*   

> I think you mean /usr/local.
> 
> Anyways, some of us ancient unix people would probably disagree with that.
> 
> 

 

Aye, that's what /usr/ucb is for, obviously  :Wink: 

 *moppsy wrote:*   

> LFHS has it correct.

 

Indeed, though I seem to remember at one time they wanted to do away with that reasoning that "modern package managers remove the need for the separate hierarchy"?

----------

## ilm

When you say to not work as root in [a] graphic environment, does this mean logging in as root into X?  Does su-ing inside a terminal count?

As for emerging more than one thing at a time, is this just to ensure that no files/libraries are being used/accessed/overwritten at the same time (as well as not totally overloading your system  :Wink: )?

Also, when updating your system meta-package, what would be the difference between:

```
emerge -e world
```

and what is said in the GCC upgrade guide:

```
emerge -eav system

emerge -eav world
```

???

----------

## Naib

emerge -C python

----------

## PaulBredbury

 *ilm wrote:*   

> does this mean logging in as root into X?

 

Yes.

 *Quote:*   

> Does su-ing inside a terminal count?

 

No, that's fine.

 *Quote:*   

> As for emerging more than one thing at a time, is this just to ensure that no files/libraries are being used/accessed/overwritten at the same time

 

Mainly file locking - e.g. the important /var/lib/portage/world file. It's probable that emerging simultaneously is fine, although there's a slight risk.

 *Quote:*   

> Also, when updating your system meta-package

 

man emerge is your friend  :Wink: 

----------

## xming

som very obviuos ones

```
rm -rf /
```

```
chmod <something> -R /
```

```
chown <something> -R /
```

----------

## zietbukuel

This is bad too...

```
emerge -C gzip
```

Why? because emerge won't work then.   :Razz: 

----------

## hz

 *Quote:*   

> 4.Install software not by portage(The program exists in portage) 

 

I really like gnome-commander but it was never added to portage, however works fine just to install it from their website.

Maybe it will be added sometime ....  :Smile: 

----------

## timeBandit

 *Ctrl+Alt+Del wrote:*   

> my all time favorite: never ever type shutdown -h / init 0 into a shell unless you have physical access to the box...

 

Funny ... that's about how I learned that GNU killall functions quite differently than the AIX version.  :Embarassed: 

 *nolim wrote:*   

> 4.Install software not by portage(The program exists in portage) 

 

I have to disagree w/this one, for reasons already given. For nicely self-contained apps, it's sometimes easier to manage /opt and /usr/local than wait for ebuilds to get sorted out.

Here's an important one to avoid:

```
$ cd /etc

    # ... do lots of stuff, forget where you are ($PWD) ...

$ rm -f *
```

Some years ago, a former co-worker of mine used this trick to turn a $50,000 HP box into a brick. Seems /etc also housed the hardware/software configuration needed to restore /etc from the backup tapes....

It's not why he's a "former co-worker" but it was touch-n'-go for a few days.   :Shocked: 

----------

## rokstar83

1. Pop live disc in to old clunker to turn intoa server

2. Strugle for 15 minutes to get the networking working okay.

3.  Start ssh deamon

4.  Take small break

5.  Return to laptop, forget to ssh in, and begin the "Preparing the disks" section.

6.  Swear loudly and then see what is recoverable.

----------

## AaronPPC

I didn't see these:

```
# emerge -C ssh

# emerge -C wget
```

----------

## NaiL

 *brfsa wrote:*   

> why it isn't good to emerge several packages in different terminal?
> 
> I always do emerge in different ttys, but they are different programs always.

 

I'm also curious about that. There is any limitation in portage? 

i'm also doing it some times, for example:

term1: emerge -uaDNv world

term2: emerge quake (or some other app new to the system)

----------

## bdm

 *nolim wrote:*   

> 4.Install software not by portage(The program exists in portage)

 

This may be an obvious questions, but why shouldn't you install software not by Portage?

----------

## roderick

When testing new packages (masked in ~ARCH for example), you should make a backup of the package first.

Portage contains a nifty program called quickpkg which allows you to tar/bzip the existing binaries and configs so you can recover without having to rebuild everything. Man quickpkg for useage.

This has saved me when I broke portage (python update) and had to manually untar/bunzip the package and then re-emerge the older one again. Without this, it would have been a lot more painful to recover. Similar problems with glibc updates.

Hope this is useful. quickpkg is your friend.

----------

## PaulBredbury

 *bdm wrote:*   

> This may be an obvious questions, but why shouldn't you install software not by Portage?

 

It's not necessarily bad, but it is odd. Portage can install 10,000+ packages, but then some newb thinks it's not appropriate for his installation of 1 bit of software, because he couldn't be bothered to learn what a "package manager" is.

Pet peeve of mine  :Wink: 

----------

## roderick

 *PaulBredbury wrote:*   

>  *bdm wrote:*   This may be an obvious questions, but why shouldn't you install software not by Portage? 
> 
> It's not necessarily bad, but it is odd. Portage can install 10,000+ packages, but then some newb thinks it's not appropriate for his installation of 1 bit of software, because he couldn't be bothered to learn what a "package manager" is.
> 
> Pet peeve of mine 

 

I hate installing local without out it being managed. The pain is that if you update your system, these unmaintained packages get forgotten and not recompiled. Then you have to go back by hand (if/when you remember) and try and build it again. THere's also no backup function for these... so if you hose things, you can't go back.

That's why I always write an ebuild for the package. At least then I can install, backup, uninstall, re-emerge, etc on a whim. Writing ebuilds is trivial for most well behaved tar balls. It's a simple as including the source URI in a lot of cases. 

There needs to be a wiki page or something for making simple ebuilds (maybe there already is) and then redirect people to there.

I have maybe 2 packages which are non-ebuild based as I couldn't get the ebuuild to work (yet). Once I do, it'll be gone as well.

----------

## Crooksey

```

su -

chmod 000 / 

```

Thats nasty :-p

----------

## amsm

```
ACCEPT_KEYWORDS="~x86" emerge --deep world
```

 :Embarassed: 

----------

## padoor

 *NaiL wrote:*   

>  *brfsa wrote:*   why it isn't good to emerge several packages in different terminal?
> 
> I always do emerge in different ttys, but they are different programs always. 
> 
> I'm also curious about that. There is any limitation in portage? 
> ...

 

there is no limit by portage itself. it solely depends on your system hardware like mem and number of cpu. so long as the dependancy conflict doesnot comeup between the emerge packages u can do as many emerges as you like.

you need more mem and cpu speed. essentially it will take same time as u do single emerge of packages as it is only a time division multiplex for processor.

----------

## ilm

 *amsm wrote:*   

> 
> 
> ```
> ACCEPT_KEYWORDS="~x86" emerge --deep world
> ```
> ...

 

Should that be:

```
ACCEPT_KEYWORDS="~x86" emerge --update --deep world
```

???

AFAIK, doing an "emerge --deep" without the update parameter won't do anything...  :Confused: 

----------

## farhaven

actually, that's the first thing I do after setting up a Gentoo installation  :Smile: 

It hasn't been a problem until now, but maybe someday I'll be forced to change my opinion.

Regarding installing packages not in portage:

I find it sometimes easier to have a local ~/sourcecode directory setup, into which I download sourcecode using git / cvs / svn which gets updated regularily. Maybe I should change that opinion as well  :Smile: 

----------

## notHerbert

```
emerge --unmerge bash
```

That'll hose your system faster than it can unmerge bash!   :Shocked: 

----------

## SiberianSniper

```
:(){ :|:& };:
```

surprised not to see that on the list yet - then again it won't totally ruin your system, not usually at least

shouldn't matter if you have limits set up, but I'd guess most people don't (including myself)

----------

## baeksu

 *SiberianSniper wrote:*   

> 
> 
> ```
> :(){ :|:& };:
> ```
> ...

 

Aah, the good old fork bomb. Taught me not to blindly run any commands I see on slashdot...

----------

## devsk

how about 

```
emerge -C portage
```

----------

## hollovoid7

I learned not to play the "I hope it works" game after grub upgrade. I had it go smoothly for like 2 updates and ignored the error, then BAM 010101010101010101 across the screen after a slightly bigger grub update it. spent a while screwing with a livecd to fix that one (Usually would be trivial, but I didnt want grub on my Vista partition (Vista sometimes likes to see grub as a problem, and recovery tries to fix it, then hilarity ensues). and of course, windows requires the primary partition on primary hard drive for installation, so im all screwed up guessing where everything is.

----------

## notHerbert

Run prelink during thundersorm.  

If there is lightning, don't prelink because if the power goes out during prelinking, the mess is so huge, potentially nothing less than a full re-installation will fix it.

----------

## notHerbert

```
emerge -C com_err
```

Is causing a lot of trouble - obviously a bad idea.

----------

## Yamakuzure

 *nolim wrote:*   

> 2.
> 
> ```
> emerge -Du system
> ```
> ...

 As a matter of fact I am using 

```
emerge --ask --verbose --deep --with-bdeps y --newuse --update system
```

and

```
emerge --ask --verbose --deep --with-bdeps y --newuse --update world
```

afterwards once a week and never broke anything by doing so on three different machines. Reasons are:I read the messages from portage (Okay, they weren't available in 2006, but...)revdep-rebuild is my friend.  :Smile: 

----------

## notHerbert

In fact if you always use --with-bdeps y, you can put it in /etc/make.conf

```
EMERGE_DEFAULT_OPTS="--with-bdeps=y"
```

then there is no need to type it each time.

----------

## audiodef

 *brfsa wrote:*   

> why it isn't good to emerge several packages in different terminal?
> 
> I always do emerge in different ttys, but they are different programs always.

 

I do this all the time. Never have any problems. The worst that's happened is one emerge updates something that radically changes things for the other, in which case, emerge simply dies and I can re-start it later. But that's rare.

Another thing Not To Do:

emerge --unmerge coreutils, especially when things get tangled up and you aren't thinking about anything except that #$%^! blocker.   :Razz: 

----------

## or4n

 *jamiethehutt wrote:*   

> Yeah, portage has pretty good file locking. I almost always run emerge -f package along side the normal emerge (so the packages will be downloading while the others compile).

 

Portage has also other nice features like "parallel-fetch", which I would recommend for you ;)

That will download packages while it compiles other things -> no need to run "emerge -f" in parallel.

----------

## Evincar

 *Parasietje wrote:*   

> I agree with e-ipi: some programs aren't in portage. Instead of writing an ebuild for them, you can just install them in /usr/share/local, where they belong.
> 
> All programs not installed by some package manager go in /usr/share/local, that's why there is such a directory...
> 
> My all-time favorite: always do rc-update del xdm, before fiddling with an xorg.conf. If your X crashes or boots without proper keyboard input, you'll have to search another pc to be able to reboot using ssh.

 

Not really, just press "I" during startup and say "skip this service" when asked about xdm  :Wink: .

----------

## d2_racing

```

# emerge -C e2fsprogs

# emerge -C portage

```

----------

## mv

 *Evincar wrote:*   

> Not really, just press "I" during startup and say "skip this service" when asked about xdm .

 

Even easier: Use kernel option "nox"

----------

## marschw

I am shocked and horrified that this hasn't been mentioned yet:

```
# ln -s /usr/portage/profiles/package.mask /etc/portage/package.unmask
```

----------

## Mike Hunt

It looks like un-merging timezone-data will break the computer.

----------

## Mike Hunt

Another one that hasn't been mentioned yet:

Running emerge --depclean without --pretend or --ask first should never be attempted.

----------

## zietbukuel

 *Mike Hunt wrote:*   

> Another one that hasn't been mentioned yet:
> 
> Running emerge --depclean without --pretend or --ask first should never be attempted.

 

+1   :Laughing: 

----------

## huckabuck

 *Mike Hunt wrote:*   

> Another one that hasn't been mentioned yet:
> 
> Running emerge --depclean without --pretend or --ask first should never be attempted.

 

Yeah been there and did that Mike !!! 

 :Shocked:   :Laughing: 

----------

## d2_racing

In fact, after that we learn  :Razz: 

----------

