Gentoo Archives: gentoo-user

From: Consus <consus@××××.net>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Updating Gentoo
Date: Sun, 21 Jul 2019 17:35:27
Message-Id: 20190721173516.GA24769@eddy.kbs.local
1 Hi,
2
3 For quite a bit I'm using this script to update my stable Gentoo system:
4
5 $ cat $(which sysupdate)
6 #!/bin/sh
7 # Update the whole system
8
9 set -e
10
11 echo "==> Syncing Portage tree..."
12 emerge --sync --quiet
13
14 echo "==> Updating world..."
15 emerge -auDU --with-bdeps=y @world
16
17 echo "==> Removing old dependencies..."
18 emerge -qc
19
20 echo "==> Upgrading Perl packages (if needed)..."
21 perl-cleaner --quiet --modules --ph-clean --delete-leftovers
22
23 # TODO: Check errors
24 cur_kver=$(readlink /usr/src/linux | sed 's/linux-//')
25 new_kver=$(cd /usr/src && ls -1d linux-* | sort -Vr | head -1 | sed 's/linux-//')
26
27 if [ "${cur_kver}" != "${new_kver}" ]; then
28 echo "==> Switching to kernel ${new_kver}..."
29 eselect kernel set linux-${new_kver}
30 if [ ! -e "/boot/vmlinuz-${new_kver}" ]; then
31 echo "==> Building kernel ${new_kver}..."
32 genkernel kernel
33 fi
34 else
35 # Rebuild initramfs if third-party modules were updated
36 if [ -n $(find /lib/modules/${cur_kver} \
37 -newer /boot/initramfs-${cur_kver}.img) ]; then
38 dracut -f
39 fi
40 fi
41
42 Still, it won't catch some issues with Go or Haskell (as there are
43 separate app-admin/go-updater and app-admin/haskell-updater ebuilds
44 still around in the Tree) + there is a separate genkernel post-install
45 script that cleans up old kernels during the kernel update.
46
47 So, I was wondering -- maybe there is a
48 fool-proof-one-command-that-do-it-all solution wondering somewhere?

Replies

Subject Author
Re: [gentoo-user] Updating Gentoo Alarig Le Lay <alarig@××××××××××.fr>
Re: [gentoo-user] Updating Gentoo m4110c <disquz@×××××.de>