In Gentoo, to update your portage tree to the latest version one can do:
emerge --sync
In Gentoo, to fetch and merge the latest available packages into your system one can do:
emerge -pvDuN world
emerge -DuN world
In Gentoo, to remove the unnecessary dependencies that might remain and must to be removed one can do:
emerge -p --depclean
emerge --depclean
In Gentoo, to rebuild the missing dependencies one can do:
revdep-rebuild -pv
revdep-rebuild
In Gentoo, sometimes you need to update some configuration files after an package update. One can do that by:
dispatch-conf
In Gentoo, is sometimes also necessary to handle the new configuration files, so one can do:
etc-update
Many things can be done in Gentoo. That's why for me Gentoo means power. BUT I like to do Gentoo in my own way so I wrote a little daemon (sync-emerge) which synchronize (once, in background) Â the portage tree at system start-up and a second bash script (which start once at session start-up) that check if exists new packages are available to be merged and if there are then send a balloon notification on the desktop informing user about that.
Later you can emerge those new packages by traditional means (emerge is your friend).
The daemon which  check Gentoo updates (sync-emerge):
#!/sbin/runscript opts="reload" depend() { after net } start() { ebegin "Starting to synchronize the portage tree" emerge --sync 1>/dev/null eend $? return 0 } stop() { ebegin "Stopping the sync-emerge daemon" eend $? return 0 } reload() { ebegin "Reloading sync-emerge" eend $? start }
Copy this daemon at /etc/init.d/sync-emerge and configure your system to start it at start-up:
rc-update add sync-emerge default
The session bash script (check-emerge):
#!/bin/bash while [ -n "$(/etc/init.d/sync-emerge status|awk '/starting/ {print 1}')" ];do sleep 10 #wait 5 minutes, until the X daemon will synchronize the emerge database done NEWS=$(emerge -pvDuN world|awk '/[ebuild/ {if ($2=="U") {u++}; if ($2=="R") {r++}; if ($2=="D") {d++}; if($2=="F"){f++}; if($2=="I"){i++}; if($2=="B"){b++};} END {total=u+r+d+f+i+b; if(total>0){ print total" package available for update :"; if (u>0) {print " - updating : "u}; if (r>0){print " - replacing : "r};if(d>0){print " - downgrading : "d};if(f>0){print " - fetch restricted : "f};if(i>0){print " - interactive : "i};if(b>0){print " - blocked : "b};}}') if [ -n "$NEWS" ];then notify-send -i "/usr/share/icons/Tango/48x48/status/dialog-information.png" "Update available" "$NEWS" fi
If you are using Xfce then you can go into Settings -> Session and Startup -> Application Autostart and define a new startup application like:
- name=check-emerge
- command=[path-to]/check-emerge
where [path-to] is the path to check-emerge bash script.
Note: don't forget to set both scripts as executable (chmod +x
Now, if you think that this article was interesting don't forget to rate it. It shows me that you care and thus I will continue write about these things.
Eugen Mihailescu
Latest posts by Eugen Mihailescu (see all)
- Dual monitor setup in Xfce - January 9, 2019
- Gentoo AMD Ryzen stabilizator - April 29, 2018
- Symfony Compile Error Failed opening required Proxies - January 22, 2018
If I turn off my computer before I go out somewhere, and turn it back on, can't I get in trouble if I sync the portage tree more than once per day?
The people from Gentoo recommends to sync your portage once per day. Two times will not hurt anyone but does not help you anyway.