My Gentoo Linux Upgrade Guide[dracut+systemdboot]
My Gentoo Linux Upgrade Guide
- This Guide include two part, part one is package update, second part is kernel upgrade.
- Part one is suit for any Gentoo Linux machine, but part two is customize version (We will customize kernel parameter and compile it by us manually!) is unfotanly need dracut for initramfs generate and systemboot for bootloader.If not, well, some command need to be chagne, but the general flow is same.
- This is temperary for my PERSONAL REFRENCE ONLY, if you are newbee with Gentoo please read offical gentoo linux documentation first, this is for experianced user to refrence and optmize they update process.
- Here is 2 offical guide you must read if you want to manage your Gentoo Linux:
Part One Package Update
sync with repository
- If you want to update all package for Gentoo Linux, first for all, you need sync all repository with upstream. there are two way to do this, first is fastest way --- download entire ebuild repository by using command:
emerge-webrsyncThis is the way i recommand, just like other Linux distrobution, fast and easy.
- Use old-school '--sync' subcommand to sync with repository per package, this will cost lots of time if you install lots of package on your machine,but you get more control to this process. Here is section of offical doc for it: --sync Updates repositories, for which auto-sync, sync-type and sync-uri attributes are set in repos.conf. A list of repos or aliases can be specified, in which case they will be updated regardless of their auto-sync attribute. See portage(5) for more information. The PORTAGE_SYNC_STALE variable configures warnings that are shown when emerge --sync has not been executed recently.
emerge --syncupdate package
After secusessful sync with repository, you able to update all packages! This is a long-long process if you don't have a super computer. So, with PC, i recommand to start update package before bedtime (Zzz) This is the command i recommand:
emworld (alias emworld=doas emerge -avuDN @world)I use a alias shortcut for it, in columns, there is full command. And commad meaning:
-a :
Before performing the action, display what will take place (server info for --sync, --pretend output for merge, and so forth), then ask whether to proceed with the action or abort. Using --ask is more efficient than using --pretend and then executing the same command without --pretend, as dependencies will only need to be calculated once. > [!warning] >WARNING: If the "Enter" key is pressed at the prompt (with noother input), it is interpreted as acceptance of the first choice. > Note that the input buffer is not cleared prior to the prompt, so an accidental press of the "Enter" key at any time prior to the prompt will be interpreted as a choice!-v: Tell emerge to run in verbose mode. Currently this flag causes emerge to print out GNU info errors, if any, and to show the USE flags that will be used for each package when pretending. The following sym‐ bols are affixed to USE flags in order to indicate their status:
Symbol Location Meaning ────────────────────────────────────────────────────────────── - prefix not enabled (either disabled or removed) * suffix transition to or from the enabled state % suffix newly added or removed () circumfix forced, masked, or removed {} circumfix state is bound to FEATURES settings-u:
Updates packages to the best version available, which may not always be the highest version number due to masking for testing and development. Package atoms specified on the command line are greedy, meaning that unspecific atoms may match multiple versions of slotted packages. This option also implies the --selective option.@world: excute behavior with all packages.
Run the command, and read the output by section.
- Fist section is ebuild caculation part, it will automatic compare old and new synced version of package, list out packages gonna new/update/reinstall/uninstall
[ebuild U ] sys-libs/glibc-2.41-r4:2.2::gentoo [2.40-r8:2.2::gentoo] USE="cet multiarch (multilib) ssp stack-realign (static-libs) -audit -caps -compile-locales (-custom-cflags) -doc -gd -hash-sysv-compat -headers-only -multilib-bootstrap -nscd -perl -profile (-selinux) -suid -systemd -systemtap -test (-vanilla)" 18,974 KiB
[ebuild U ] sys-libs/ncurses-6.5_p20250329:0/6::gentoo [6.5_p20250125:0/6::gentoo] USE="cxx stack-realign (tinfo) -ada -debug -doc -gpm -minimal -profile (-split-usr) -static-libs -test -trace -verify-sig" ABI_X86="32 (64) (-x32)" 373 KiB
...- Second section is conflict warning part
WARNING: One or more updates/rebuilds have been skipped due to a dependency conflict:
dev-libs/icu:0
(dev-libs/icu-77.1:0/77::gentoo, ebuild scheduled for merge) USE="-debug -doc -examples -static-libs -test -verify-sig" ABI_X86="32 (64) (-x32)" conflicts with
dev-libs/icu:0/76=[abi_x86_64(-)] required by (dev-libs/boost-1.85.0-r1:0/1.85.0.1::gentoo, installed) USE="bzip2 context icu nls stacktrace zlib -debug -doc -lzma -mpi -numpy -python -tools -zstd" ABI_X86="(64) -32 (-x32)" PYTHON_TARGETS="python3_12 -python3_10 -python3_11 -python3_13"
^^^^^^
dev-libs/boost:0
(dev-libs/boost-1.88.0-r1:0/1.88.0::gentoo, ebuild scheduled for merge) USE="bzip2 context icu nls stacktrace zlib -debug -doc -lzma -mpi -numpy -python -test -test-full -tools -zstd" ABI_X86="(64) -32 (-x32)" PYTHON_TARGETS="python3_13 -python3_11 -python3_12" conflicts with
<dev-libs/boost-1.87:=[nls] required by (net-p2p/monero-0.18.3.4-r1:0/0::guru, ebuild scheduled for merge) USE="daemon readline tools wallet-cli wallet-rpc -hw-wallet" ABI_X86="(64)"Read it all and makesure nothing gona breake your system.
- Final part is rebuild list
The following packages are causing rebuilds:
(net-libs/miniupnpc-2.3.3-r1:0/21::gentoo, ebuild scheduled for merge) causes rebuilds for:
(net-p2p/monero-0.18.3.4-r1:0/0::guru, ebuild scheduled for merge)
(dev-cpp/abseil-cpp-20250127.1:0/2501.1.0::gentoo, ebuild scheduled for merge) causes rebuilds for:
(media-libs/webrtc-audio-processing-1.3-r3:1/1::gentoo, ebuild scheduled for merge)
(dev-libs/protobuf-30.2:0/30.2.0::gentoo, ebuild scheduled for merge)
(dev-util/android-tools-35.0.2:0/0::gentoo, ebuild scheduled for merge)
(dev-libs/re2-2024.07.02:0/11::gentoo, ebuild scheduled for merge)It simply list all package need rebulid for you to get a fuzzy thought about how much time current update will take.
If everything is OK, type "yes" to comfirm update!
Would you like to merge these packages? [Yes/No]Wait a little bit of time, make sure emerge is doing things correct,then have a good sleep! If anything goes wrong, it will skip it, if no major error such as compiler or system level stuff, you can fix that easly, i may write more tutorial about those common error.
Part Two Kernel upgrade
I only install local compile kernel, this is safer and much customizable, make the OS more fast, flex and hacky.
check avaiable kernel version:
equery meta gentoo-sourcesYou will see a list of all avaliable version of gentoo official kernel(source code version).
install kernel source code
If you want to use stable kernel (above equery command text color for your architectrue is green), you can use this command to install:
emerge =sys-kernel/gentoo-sources-6.15.8Or if you want to try newest, untested kernel, you can bravly choice version from masked stuff! ( above equery command text color four your architectrue is blue). And install using this set of command:
emerge =sys-kernel/gentoo-sources-6.15.8 --autounmask --autounmask-write
dispatch-confLet me expain, first "--autounmask.." afterfix is allow portage auto create a patch for portage configuraton for automatic unmask package you want to install. Then you can use_dispatch-conf_ to apply it:
info dispatch-conf is designed to be run after merging new packages in order to see if there are updates to the configuration files. If a new configuration file will overwrite an old one, dispatch-conf will prompt the user for a decision about how to resolve the discrepancy. Advantages of dispatch-conf include easy rollback (changes to config files are stored either using patches or rcs) and the ability to automatically update config files that the user has never modified or that differ from the current version only in CVS cruft or white space.
When package is unmasked, you able to install by running above emerge command again:
emerge =sys-kernel/gentoo-sources-6.15.8config kernel
First we should confirm kernel source code is exist and reconized for Gentoo Linux
/u/src ❯❯❯ eselect kernel list
Available kernel symlink targets:
[1] linux-6.1.127-gentoo
[2] linux-6.1.129-gentoo
[3] linux-6.1.132-gentoo
[4] linux-6.12.1-gentoo
[5] linux-6.14.3-gentoo
[6] linux-6.15.0-gentoo *
[7] linux-6.15.8-gentooYou can see i am currently on 6.15.0 version(* symbol) and we gonna hand by hand upgrade to 6.15.8, with my customize configuration! So i gona select 6.15.8 kernel
eselect kernel set 7Then, Gentoo gona change the softlink of "/usr/src/linux" to the kernel source-code we select. Second, we able to config the kernel! Jump in to "/usr/src/linux"
cd /usr/src/linuxThen choice a good kernel configuration tool, i recommand nconfig, menuconfig is too old-school 😃
make nconfigBoom, you able to select what ever kernel function you want to use! You can read the offical linux kernel configuration manual by this link: gentoo kernel configuration guide
If you don't want to make any change, you can simply copy your old kernel config! for exsample as we saw above, i use linux-6.15 as previous kernel, so i need copy configuration form that old folder, just like this:
cp /usr/src/linux-6.15.0-gentoo/.config /usr/src/linuxcompile kernel
Good, we need compile kernel! this will take a while...
make -j(nproc)Or manual input count of your threads avaliable.
make -j(THREAD COUNT YOU WANT)Don't forget install module! it is really easy to forget.
make modules_installWhen kernel and all module is ready, it is time to install it. (it should auto trigger your bootloader or something to auto copy vmlinux and initramfs to your boot partition, if it can do that, recheck the install process about whatever your bootloader is)
make installFantastic! and finally if you using nvidia graphic card same as me, you should reinstall nvidia-drivers
emerge x11-drivers/nvidia-driversFinally, we can reboot the system, and check out your system is broke or not 😃 If someting go wrong, we also should use old backup kernel to diagnostic and fix the problem.
End
Yes, the end.
Copyright
This article link:/article/avdtlke7/
License under:Attribution-NonCommercial 4.0 International (CC-BY-NC-4.0)
