<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Archiwa MariaDB - soban</title>
	<atom:link href="https://soban.pl/category/mariadb/feed/" rel="self" type="application/rss+xml" />
	<link>https://soban.pl/category/mariadb/</link>
	<description>IT, Linux, Servers, Security</description>
	<lastBuildDate>Tue, 12 Oct 2021 17:13:28 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>Upgrade Debian GNU/Linux 10 (buster) to 11 (bullseye)</title>
		<link>https://soban.pl/upgrade-debian-gnu-linux-10-buster-to-11-bullseye/</link>
		
		<dc:creator><![CDATA[soban]]></dc:creator>
		<pubDate>Fri, 01 Oct 2021 13:26:37 +0000</pubDate>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MariaDB]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Patching]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<guid isPermaLink="false">https://soban.pl/?p=42</guid>

					<description><![CDATA[<p>Before we start upgrading the Debian system version, please make a snapshot or a possible backup of the system. Such a change entails significant changes that can damage the system. Of course, before you upgrade the system in production, it is best to upgrade to the testing environment first. The upgrade process affects the entire [&#8230;]</p>
<p>Artykuł <a href="https://soban.pl/upgrade-debian-gnu-linux-10-buster-to-11-bullseye/">Upgrade Debian GNU/Linux 10 (buster) to 11 (bullseye)</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Before we start upgrading the Debian system version, please make a snapshot or a possible backup of the system. Such a change entails significant changes that can damage the system. Of course, before you upgrade the system in production, it is best to upgrade to the testing environment first. The upgrade process affects the entire system. Services may not be available at this time. If the system is doing the hosting for your website then it may not be available!<br><br>Always bear in mind that the production environment is different from test environment, so I recommend that you do it carefully. A good practice is to keep a time interval between the upgrade of test and production environment, in my case it is a week. Remember not to make changes to production on Friday!<br><br>This is how we check the version of the system:</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="870" height="364" src="https://soban.pl/wp-content/uploads/2021/10/image.png" alt="" class="wp-image-45" srcset="https://soban.pl/wp-content/uploads/2021/10/image.png 870w, https://soban.pl/wp-content/uploads/2021/10/image-300x126.png 300w, https://soban.pl/wp-content/uploads/2021/10/image-768x321.png 768w" sizes="(max-width: 870px) 100vw, 870px" /></figure>



<p>And now, we going to update OS, but before we do that &#8211; we will make copy of:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag">cp /etc/apt/sources.list /root/sources.list_buster</pre></div>



<p>There is sorces setup for buster:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># cat /etc/apt/sources.list
deb http://ftp.debian.org/debian buster main contrib
deb http://ftp.debian.org/debian buster-updates main contrib
deb http://security.debian.org buster/updates main contrib
deb http://nginx.org/packages/debian/ buster nginx
deb-src http://nginx.org/packages/debian/ buster nginx</pre></div>



<p>Before we upgrade the debian system version to 11, we need to do a full upgrade:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># apt update &amp;&amp; apt upgrade -q -y &amp;&amp; apt dist-upgrade -q -y &amp;&amp; apt autoremove -y -q</pre></div>



<p>Then we use sed to replace &#8220;buster&#8221; on &#8220;bullseye&#8221;:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># sed -i 's/buster/bullseye/g' /etc/apt/sources.list</pre></div>



<p>There here&#8217;s the effect:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># cat /etc/apt/sources.list</pre></div>



<figure class="wp-block-image size-full"><img decoding="async" width="769" height="128" src="https://soban.pl/wp-content/uploads/2021/10/image-25.png" alt="" class="wp-image-114" srcset="https://soban.pl/wp-content/uploads/2021/10/image-25.png 769w, https://soban.pl/wp-content/uploads/2021/10/image-25-300x50.png 300w" sizes="(max-width: 769px) 100vw, 769px" /></figure>



<p>To be sure, we will do a comparison of the backed up file:</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="346" src="https://soban.pl/wp-content/uploads/2021/10/image-2-1024x346.png" alt="" class="wp-image-48" srcset="https://soban.pl/wp-content/uploads/2021/10/image-2-1024x346.png 1024w, https://soban.pl/wp-content/uploads/2021/10/image-2-300x101.png 300w, https://soban.pl/wp-content/uploads/2021/10/image-2-768x260.png 768w, https://soban.pl/wp-content/uploads/2021/10/image-2.png 1156w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>And then we can do update:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># apt update &amp;&amp; apt upgrade -q -y &amp;&amp; apt dist-upgrade -q -y &amp;&amp; apt autoremove -y -q</pre></div>



<p><br>So that it is not too easy, to start the task in the form of:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="186" src="https://soban.pl/wp-content/uploads/2021/10/image-1-1024x186.png" alt="" class="wp-image-47" srcset="https://soban.pl/wp-content/uploads/2021/10/image-1-1024x186.png 1024w, https://soban.pl/wp-content/uploads/2021/10/image-1-300x55.png 300w, https://soban.pl/wp-content/uploads/2021/10/image-1-768x140.png 768w, https://soban.pl/wp-content/uploads/2021/10/image-1.png 1094w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p><br>Specifically about this error:</p>



<pre class="wp-block-preformatted">Err:5 http://security.debian.org bullseye/updates Release
  404  Not Found [IP: 199.232.150.132 80]
Reading package lists... Done
E: The repository 'http://security.debian.org bullseye/updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.</pre>



<p>To fix it, use any editor on the file (vi in ​​my case):</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># vi /etc/apt/sources.list</pre></div>



<p>We remove line 4 &#8211; &#8220;deb http://security.debian.org buster/updates main contrib&#8221; as you can see, we go out and save :</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="378" src="https://soban.pl/wp-content/uploads/2021/10/image-3-1024x378.png" alt="" class="wp-image-49" srcset="https://soban.pl/wp-content/uploads/2021/10/image-3-1024x378.png 1024w, https://soban.pl/wp-content/uploads/2021/10/image-3-300x111.png 300w, https://soban.pl/wp-content/uploads/2021/10/image-3-768x284.png 768w, https://soban.pl/wp-content/uploads/2021/10/image-3.png 1123w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Of course, any other editor like nano is also good for this case.<br>The contents of the /etc/apt/sources.list file now looks like this:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># cat /etc/apt/sources.list
deb http://ftp.debian.org/debian bullseye main contrib
deb http://ftp.debian.org/debian bullseye-updates main contrib
deb http://nginx.org/packages/debian/ bullseye nginx
deb-src http://nginx.org/packages/debian/ bullseye nginx</pre></div>



<p>We can try to update the system again:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># apt update &amp;&amp; apt upgrade -q -y &amp;&amp; apt dist-upgrade -q -y &amp;&amp; apt autoremove -y -q</pre></div>



<p>Now you need get some the system upgrade process has started. You can go for a coffee, or not 😉<br>There will be questions.<br>And more information, albout apt listchanges:<br></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="944" height="904" src="https://soban.pl/wp-content/uploads/2021/10/image-6.png" alt="" class="wp-image-54" srcset="https://soban.pl/wp-content/uploads/2021/10/image-6.png 944w, https://soban.pl/wp-content/uploads/2021/10/image-6-300x287.png 300w, https://soban.pl/wp-content/uploads/2021/10/image-6-768x735.png 768w" sizes="auto, (max-width: 944px) 100vw, 944px" /></figure>



<p>Just press &#8216;q&#8217; and enter.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="166" src="https://soban.pl/wp-content/uploads/2021/10/image-4-1024x166.png" alt="" class="wp-image-51" srcset="https://soban.pl/wp-content/uploads/2021/10/image-4-1024x166.png 1024w, https://soban.pl/wp-content/uploads/2021/10/image-4-300x49.png 300w, https://soban.pl/wp-content/uploads/2021/10/image-4-768x124.png 768w, https://soban.pl/wp-content/uploads/2021/10/image-4-1536x248.png 1536w, https://soban.pl/wp-content/uploads/2021/10/image-4.png 1917w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>In this case we press enter.</p>



<p>Services to restart:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="194" src="https://soban.pl/wp-content/uploads/2021/10/image-8-1024x194.png" alt="" class="wp-image-56" srcset="https://soban.pl/wp-content/uploads/2021/10/image-8-1024x194.png 1024w, https://soban.pl/wp-content/uploads/2021/10/image-8-300x57.png 300w, https://soban.pl/wp-content/uploads/2021/10/image-8-768x146.png 768w, https://soban.pl/wp-content/uploads/2021/10/image-8-1536x291.png 1536w, https://soban.pl/wp-content/uploads/2021/10/image-8.png 1915w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Enter agien.</p>



<p>This is question, about ssh deamon configuration:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="247" src="https://soban.pl/wp-content/uploads/2021/10/image-9-1024x247.png" alt="" class="wp-image-57" srcset="https://soban.pl/wp-content/uploads/2021/10/image-9-1024x247.png 1024w, https://soban.pl/wp-content/uploads/2021/10/image-9-300x72.png 300w, https://soban.pl/wp-content/uploads/2021/10/image-9-768x185.png 768w, https://soban.pl/wp-content/uploads/2021/10/image-9-1536x370.png 1536w, https://soban.pl/wp-content/uploads/2021/10/image-9.png 1905w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>In my case, I press enter because I don&#8217;t want to make changes to its configuration.</p>



<p><br>If all went well, we can reboot the system:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># reboot</pre></div>



<p>Now check the system:</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="621" height="222" src="https://soban.pl/wp-content/uploads/2021/10/image-11.png" alt="" class="wp-image-60" srcset="https://soban.pl/wp-content/uploads/2021/10/image-11.png 621w, https://soban.pl/wp-content/uploads/2021/10/image-11-300x107.png 300w" sizes="auto, (max-width: 621px) 100vw, 621px" /></figure>



<p>Congratulations, we are on the new version of the system!<br>At this point, we can verify all services, for example whether the website is working properly. If it is OK, upgrade the production environment.<br><br>In my cases, I have problem PHP new version.<br>PHP have no persmision on nginx to user &#8211; when I try enter to page:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># tail -f /var/log/nginx/error-*.log 
unix:/var/run/php/php-fpm.sock failed (13: Permission denied)</pre></div>



<p>So we need to fix that in this way:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># service php7.4-fpm status
* php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
     Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2021-10-01 14:59:14 CEST; 3min 28s ago
       Docs: man:php-fpm7.4(8)
    Process: 289 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74 (code=exited, status=0/S&gt;
   Main PID: 116 (php-fpm7.4)
     Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/sec"
        CPU: 364ms
     CGroup: /system.slice/php7.4-fpm.service
             |-116 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
             |-287 php-fpm: pool www
             `-288 php-fpm: pool www

Oct 01 14:59:11 soban-pl systemd[1]: Starting The PHP 7.4 FastCGI Process Manager...
Oct 01 14:59:14 soban-pl systemd[1]: Started The PHP 7.4 FastCGI Process Manager.</pre></div>



<p>There is something wrong with the permissions:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># grep www-data /etc/php/7.4/fpm/pool.d/www.conf
user = www-data
group = www-data
listen.owner = www-data
listen.group = www-data</pre></div>



<p>Let&#8217;s make some backup:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># cp /etc/php/7.4/fpm/pool.d/www.conf /etc/php/7.4/fpm/pool.d/www.conf.backup.$(date +%F)</pre></div>



<p>I will replace www-data to nginx:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># sed -i 's/www-data/nginx/g' /etc/php/7.4/fpm/pool.d/www.conf</pre></div>



<p>Now it&#8217;s looks better:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># grep nginx /etc/php/7.4/fpm/pool.d/www.conf
user = nginx
group = nginx
listen.owner = nginx
listen.group = nginx</pre></div>



<p>And restart services:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># service php7.4-fpm restart</pre></div>



<p>Also checking status:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="195" src="https://soban.pl/wp-content/uploads/2021/10/image-10-1024x195.png" alt="" class="wp-image-58" srcset="https://soban.pl/wp-content/uploads/2021/10/image-10-1024x195.png 1024w, https://soban.pl/wp-content/uploads/2021/10/image-10-300x57.png 300w, https://soban.pl/wp-content/uploads/2021/10/image-10-768x146.png 768w, https://soban.pl/wp-content/uploads/2021/10/image-10-1536x292.png 1536w, https://soban.pl/wp-content/uploads/2021/10/image-10.png 1915w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Another problem is that, mariadb was removed, so I install it agien:</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="urvanov-syntax-highlighter-plain-tag"># apt-get install mariadb-server mariadb-client -y</pre></div>



<p>and that resolved all my problems.</p>



<p>To be 100% sure, I reloaded the entire machine.</p>
<p>Artykuł <a href="https://soban.pl/upgrade-debian-gnu-linux-10-buster-to-11-bullseye/">Upgrade Debian GNU/Linux 10 (buster) to 11 (bullseye)</a> pochodzi z serwisu <a href="https://soban.pl">soban</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
