# emerge -vuDp world

## trossachs

I have just run this app to see what would be changed with a full emerge world and the amount of items on the list is staggering. I have well placed fears about running emerge world on my production box, but can someone point me somewhere where I can go to decipher all this info and to decide what I should update and what I should leave well alone.

Any help appreciated.   :Confused: 

----------

## NaiL

It is normal to have a lot of packages to emerge, i think it depends on your use flags.

You can try to unset some use flags.

----------

## trossachs

I have only got a few USE flags listed within my make.conf file. Not really had any probs with it that way. But I do no understand what I should leave and what I shoudl adjust.

The time is rapidly drawing close to where, doing nothing is no longer an option.

----------

## mirojira

Year and something ago I had installed gentoo. Next eight month I did not make emerge world. Every week I have made this

```

emerge sync

emerge metadata

emerge -upDNv  system

emerge -pv depclean

revdep-rebuild -v

dispatch-conf

```

Everything has worked perfectly. After I wanted to install some new SW there were message that I have to upgrade  kernel.

I upgraded profiles, kernel and world and everything has been working perfectly. Nowadays I continue with emerge system 

every week and one per month I make emerge world.

So I thing that if you are happy with your system and you want to have it working, compare emerge -p system and world and choose

packages of emerge system and some of emerge -p world what you thing are  suitable for you to update.

----------

## NaiL

you can post your "emerge --info" here.

and we can take a look ;P

----------

## teidon

If you only have few USE flags, you should add some more.  :Smile:  Especially those with "-" in front of them to get rid of some pointless features. It will make emerging of some packages a little faster because those features aren't compiled and some features requires external dependencies which won't be emerged when that feature is disabled.

What you could do is to run "emerge world -uDNpv" and check the size of downloads. Then start looking through the list of packages that would be emerged and check the USE flags they have. Some of them will make sense, some won't. You can check what each USE flag does from here. When you find a USE flag that you don't need or that you want, you can change the emerge command to 'USE="-something +something-else" emerge world -uDNpv' and check again the size of downloads and compare it to what it were without setting any USE flags. That way you can find USE flags that needs dependencies, and the list of packages to emerge will get shorter (or longer). Then when you are (somewhat) happy with the USE flags (or just got plain sick of looking through the list of packages/USE flag descriptions/etc  :Wink: ), you should add the new USE flags to /etc/make.conf. Then just "emerge -uDN world" and go do something else.  :Wink:  And if you have to shutdown your computer while it's still emerging, you can just end the emerge process by pressing CTRL+C and the next time you use your computer, you can do "emerge --resume" and it should continue from the package which emerging you killed (or you can ofcourse do "emerge -uDN world" too).

"emerge --depclean" is good way to get rid of packages that aren't needed, but it's equally good way to break your system, especially if you haven't done it in a long time. I just did it today and it removed about 60 packages. I then did "revdep-rebuild" and it wanted to (re-)emerge about 90 packages. -_-; Currently my KDE is broken because of it too.  :Very Happy:  About 60 packages to go...  :Smile: 

----------

## trossachs

emerge --info below:

```

Portage 2.1-r1 (default-linux/x86/2006.0, gcc-3.3.6, glibc-2.3.5-r0, 2.6.12-gentoo-r6 i686)

=================================================================

System uname: 2.6.12-gentoo-r6 i686 AMD Athlon(tm) Processor

Gentoo Base System version 1.6.13

dev-lang/python:     2.3.5-r2

dev-python/pycrypto: 2.0.1-r5

dev-util/ccache:     [Not Present]

dev-util/confcache:  [Not Present]

sys-apps/sandbox:    1.2.11

sys-devel/autoconf:  2.13, 2.59-r6

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1

sys-devel/binutils:  2.15.92.0.2-r10

sys-devel/gcc-config: 1.3.11-r4

sys-devel/libtool:   1.5.18-r1

virtual/os-headers:  2.6.11-r2

ACCEPT_KEYWORDS="x86"

AUTOCLEAN="yes"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -march=i686 -fomit-frame-pointer"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/lib/X11/xkb"

CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/terminfo"

CXXFLAGS="-O2 -march=i686 -fomit-frame-pointer"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"

GENTOO_MIRRORS="ftp://194.117.143.71/mirrors/gentoo"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="x86 alsa apache2 apm arts avi berkdb bitmap-fonts cli crypt cups dri eds emboss encode esd foomaticdb gdbm gif gpm gstreamer gtk gtk2 imlib ipv6 isdnlog jpeg libg++ libwww mad mikmod motif ncurses nls nptl ogg opengl oss pam pcre pdflib perl png pppd python qt quicktime readline reflection sdl session spell spl ssl tcpd type1-fonts udev vorbis xml xmms xorg xv zlib elibc_glibc kernel_linux userland_GNU"

Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

```

One of the things that I would deffinately like to get shot of are any references to an GUI/X Windows stuff as both boxes are CLI only. So I don't need any reference to Gnome or KDE for example.

----------

## trossachs

mirojira, have you had any "nasty" surprises whilst using your script?

----------

## teidon

If you don't want any GUI or any support for them, you should add atleast USE="-gtk -gtk2 -qt -xorg" (I think).

If you want to use the mirojas's update "script", you could add to your /root/.bashrc a line 'alias upp="emerge -uDNav world && emerge --depclean -a && revdep-rebuild'. After that, running "emerge --sync && upp" will update your system (I prefer having emerge --sync and rest of the commands separate) (-a (--ask) is better than -p (--pretend) imo).

And for the record, my system is working properly again. You just can't break Gentoo.  :Wink: 

----------

## dkostic

JulesF - Just because I'm a little curious, what kind of nasty surprises do you fear from running emerge world?  (I do this fairly often, and haven't yet experienced any undesirable behavior.)

----------

## trossachs

dkostic, I keep reading posts about such things like all the config files are replaced with "default" ones and horrors such as this!   :Shocked:   Both my boxes are now comfortable production servers and I don't have the time at the moment to run full tests on separate machines; this is why I am so nervous...

----------

## teidon

Portage doesn't automaticly override config files (except some, but they are files user shouldn't change). After you emerge a package that comes with config file, portage says that "there's X config files that needs to be updated" (or something like that) and then tells you to run etc-update. Etc-update lists all those config files that have a updated version, and you can check one by one if you want to keep the original, change to the updated one or do selective merge on the original and updated config. It shows the differencies between the original and update. You can also tell it to replace all the config files with updated ones, but that's a bad idea if you have changed some of them by yourself.

Running "emerge -uDN world" should be mostly safe if you are running stable system, because new packages and new versions of them are normally quite well tested before they are flagged as stable. Different packages also have different testing periods. Some bigger system related or otherwise "low level" packages have longer testing period, like KDE 3.5.x for example were about 6 months in testing before version 3.5.2 were finally flagged stable. Some high level/user level software have normally shorter testing period, because it won't be so catastropic if some new version of text editor won't work compared to if your new version of GCC wouldn't work...

Running "emerge --depclean" might be dangerous for your system though, and you should always run revdep-rebuild after it, so that broken things will be fixed. But I think "emerge --depclean" won't be so dangerous if you run it oftenly, like every time you do "emerge -uDN world".

Keeping Gentoo in well working and easy-to-update state requires you to use the special features of Gentoo properly. You shouldn't for example ever install packages with "ACCEPT_KEYWORDS=~x86 emerge something" or with 'USE="something" emerge something' (except for testing purposes maybe) because the next time you do "emerge -uDN world", the portage will downgrade those package that were installed with keyword ~x86 to the latest stable version and re-emerge with default USE flags those packages for which you gave different USE flags at command line. Instead you should add all global USE flags to /etc/make.conf and package specific ones to /etc/portage/package.use. And you should use /etc/portage/package.keywords if you want to install ~flagged packages. /etc/portage/package.mask is usefull too in some cases. Basicly if you use those files properly, keeping your system updated should be as easy as running "emerge -uDN world" (you might want to add -va to it too, to see the packages and their USE flags before emerging, in case something is little wrong). And if you want to remove packages that aren't needed anymore you should run "emerge --depclean -a && revdep-rebuild" and check that it doesn't remove some packages that you specifically need.

But I'm also still learning to use Gentoo to it's fullest so I probably don't know everything about it's maintenance, but I do know that it hasn't yet broken to such point that it couldn't be fixed with a little bit of emerging during these 2 years I've used it.  :Wink:  Sure some updates, especially if you want the very latest, testing version of some package can break a thing or two, but reversing back to older version should always fix it, unless it's broken because of missconfiguration.

I wrote _little_ bit more than I at first thought. Oh well...  :Smile: 

----------

## mirojira

 *JulesF wrote:*   

> mirojira, have you had any "nasty" surprises whilst using your script?

 

No never.

----------

## masterdriverz

The best way to make sure you don't get packages/features you don't want/need installed is to add -* to the beginning of your USE variable. (E.g. USE="-* multislot ntpl ntplonly"). Very useful on any machine but especially in server environments. One thing I would reccommend against is copying large amounts of use flags from other people's make.conf s that are posted on the net. The first time I installed Gentoo I did this and later found on my -gnome system gnome packages were being pulled in because of a glade flag. Make sure you know what the flags you are putting in do before adding any (preferably run 'emerge -pv packagename' to see what flags it uses). 

Just my $0.02

----------

## madchaz

I tend to do a less drastic emerge -u world

removing the D makes it not update depencencies unless it as to, reducing the number of things that need to be emerged drasticaly.

----------

## trossachs

Having run 

```
emerge world -uDNpv |more
```

 I have 7 pages to go thru to see what apps are being used. Quite a long and tedious task ahead!   :Confused: 

----------

