{"id":493,"date":"2023-06-25T20:08:13","date_gmt":"2023-06-25T20:08:13","guid":{"rendered":"https:\/\/blogs.gentoo.org\/gsoc\/?p=493"},"modified":"2023-06-25T20:08:13","modified_gmt":"2023-06-25T20:08:13","slug":"gentoo_update-introduction","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/gsoc\/2023\/06\/25\/gentoo_update-introduction\/","title":{"rendered":"gentoo_update Introduction"},"content":{"rendered":"<h3>Introduction<\/h3>\n<p><em>gentoo_update<\/em> (Github <a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\">repo<\/a>) is a tool that automatically updates Gentoo Linux.<\/p>\n<h3>Motivation<\/h3>\n<p>Gentoo Linux gives users maximum flexibility and control over the system. A great example of this is the OS upgrade process. Users have a large selection of different command utilities and a bunch of configuration options to choose from to tailor the upgrade process to their needs. Here is the list of some tools that are commonly used during an upgrade:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-yaml hljs\" data-lang=\"yaml\">[\r\n    <span class=\"hljs-string\">eix<\/span>, <span class=\"hljs-string\">equery<\/span>, <span class=\"hljs-string\">emaint<\/span>, <span class=\"hljs-string\">euse<\/span>, <span class=\"hljs-string\">etc-update<\/span>, <span class=\"hljs-string\">dispatch-conf<\/span>,  \r\n    <span class=\"hljs-string\">eselect<\/span>, <span class=\"hljs-string\">elogv<\/span>, <span class=\"hljs-string\">needrestart<\/span>, <span class=\"hljs-string\">eclean<\/span>, <span class=\"hljs-string\">eclean-kernel<\/span>, \r\n    <span class=\"hljs-string\">qcheck<\/span>, <span class=\"hljs-string\">revdep-rebuild<\/span>, <span class=\"hljs-string\">glsa-check<\/span>, <span class=\"hljs-string\">layman<\/span>\r\n]\r\n<\/code><\/pre>\n<\/div>\n<p>For a successful upgrade, knowing how to use many of these tools is essential. While experienced users might find this manageable, it can be overwhelming for new or inexperienced users.<\/p>\n<p><img loading=\"lazy\" class=\"wp-image-491 aligncenter\" src=\"http:\/\/blogs.gentoo.org\/gsoc\/files\/2023\/06\/lb_gentoo_update_meme-287x300.jpg\" alt=\"\" width=\"354\" height=\"370\" srcset=\"https:\/\/blogs.gentoo.org\/gsoc\/files\/2023\/06\/lb_gentoo_update_meme-287x300.jpg 287w, https:\/\/blogs.gentoo.org\/gsoc\/files\/2023\/06\/lb_gentoo_update_meme.jpg 500w\" sizes=\"(max-width: 354px) 100vw, 354px\" \/><\/p>\n<p>Additionally, users often delay updates due to the time required, which can compromise system security. Regular updates are vital for maintaining security, so it is recommended to update the system daily.<\/p>\n<p>This project addresses both issues:<\/p>\n<ol>\n<li>complicated update process<\/li>\n<li>potential security issues caused by the lack of regular upgrades<\/li>\n<\/ol>\n<h3>Functionality<\/h3>\n<p>Here are some of the things that <em>gentoo_update<\/em>\u00a0will be able to do:<\/p>\n<ul>\n<li>Install only security updates from Gentoo Linux Security Advisory by default.<\/li>\n<li>Optionally run a full system upgrade (<em>@world<\/em>) with different parameters.<\/li>\n<li>Detect and handle update errors.<\/li>\n<li>Schedule updates.<\/li>\n<li>Generate a post-update report and send it via email and\/or IRC chat.<\/li>\n<li>Send push notifications to a mobile app.<\/li>\n<\/ul>\n<p>The program comprises three core components: the updater, the parser, and the notification sender. The\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/blob\/main\/gentoo_update\/scripts\/updater.sh\">updater<\/a> is a Bash script that executes <em>emerge<\/em> to update the system and generates detailed logs for each action performed. Upon successful completion of the updater, the parser reads the logs and compiles an update report. The notification sender then dispatches this report to users.<\/p>\n<h3>Usage<\/h3>\n<p>At the moment <em>gentoo_update<\/em> can only install GLSA and <em>@word<\/em> updates and store the output to a dedicated directory. It is available in <a href=\"https:\/\/wiki.gentoo.org\/wiki\/Project:GURU\">GURU<\/a>\u00a0overlay in\u00a0<a href=\"https:\/\/github.com\/gentoo\/guru\/tree\/master\/app-admin\/gentoo_update\">app-admin\/gentoo_update<\/a>, and in\u00a0<a href=\"https:\/\/pypi.org\/project\/gentoo-update\/\">PyPI<\/a>. Generally, installing the program from GURU overlay is the preferred method, but PyPI will always have the most recent version (at the time of writing the newest version is 0.1.6).<\/p>\n<p>After\u00a0<a href=\"https:\/\/wiki.gentoo.org\/wiki\/Project:GURU\/Information_for_End_Users\">enabling GURU overlay<\/a>\u00a0it can be installed via:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-bash hljs\" data-lang=\"bash\">emerge --ask app-admin\/gentoo_update\r\n<\/code><\/pre>\n<\/div>\n<p>Alternatively, it can be installed with pip:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-bash hljs\" data-lang=\"bash\">emerge --ask dev-python\/pip\r\npip install gentoo_update --break-system-packages<\/code><\/pre>\n<p>Here are some use cases:<br \/>\n<strong>Security update<\/strong><br \/>\nRunning command without specifying <em>&#8211;update-mode<\/em> will use <em>glsa-check<\/em>\u00a0to install security patches.<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-bash hljs\" data-lang=\"bash\">gentoo-update\r\n<\/code><\/pre>\n<\/div>\n<div class=\"post-content\">\n<p><strong>@world update<\/strong><br \/>\nRun full system update, merge all new configuration files, restart all services that were updated and display <em>elogs<\/em>:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-bash hljs\" data-lang=\"bash\">gentoo-update --update-mode full \\\r\n              --config-update-mode merge \\\r\n              --daemon-restart y \\\r\n              --read-logs y\r\n<\/code><\/pre>\n<\/div>\n<p>Override default behavior and show build logs:<\/p>\n<div class=\"highlight\">\n<pre><code class=\"language-bash hljs\" data-lang=\"bash\">gentoo-update --update-mode full --args <span class=\"hljs-string\">\"quiet-build=n\"<\/span>\r\n<\/code><\/pre>\n<\/div>\n<p>After an update a log file will be created in <em>\/var\/log\/portage\/gentoo_update\/log_&lt;timestamp&gt;<\/em>.<\/p>\n<h3 id=\"conclusion\">Conclusion<\/h3>\n<p><em>gentoo_update<\/em> aims to be a useful tool that will automate and simplify updating Gentoo Linux. By default it only installs updates from GLSA, but can also be used to update <em>@world<\/em>, and it can be installed from GURU or PyPI.<\/p>\n<p>I would love to receive some feedback and\/or suggestions for this project, feel free to reach out to me via\u00a0<a href=\"https:\/\/github.com\/Lab-Brat\/gentoo_update\/tree\/main\">Github<\/a>,\u00a0<a href=\"mailto:stepan_kk@pm.me\">email<\/a> or IRC (LabBrat).<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Introduction gentoo_update (Github repo) is a tool that automatically updates Gentoo Linux. Motivation Gentoo Linux gives users maximum flexibility and control over the system. A great example of this is the OS upgrade process. Users have a large selection of &hellip; <a href=\"https:\/\/blogs.gentoo.org\/gsoc\/2023\/06\/25\/gentoo_update-introduction\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":182,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16,18],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/493"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/users\/182"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/comments?post=493"}],"version-history":[{"count":2,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/493\/revisions"}],"predecessor-version":[{"id":495,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/posts\/493\/revisions\/495"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/media?parent=493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/categories?post=493"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/gsoc\/wp-json\/wp\/v2\/tags?post=493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}