literate-dotfiles/docs/maintenance.html

211 lines
5.7 KiB
HTML
Raw Normal View History

2021-10-25 14:37:10 +02:00
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
2022-05-09 10:05:23 +02:00
<!-- 2022-05-09 lun. 10:04 -->
2021-10-25 14:37:10 +02:00
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>System maintenance</title>
<meta name="author" content="Dehaeze Thomas" />
<meta name="generator" content="Org Mode" />
<link rel="stylesheet" type="text/css" href="./dist/style.css"/>
<script type="text/javascript" src="./dist/script.js"></script>
</head>
<body>
<div id="org-div-home-and-up">
<a accesskey="h" href="./index.html"> UP </a>
|
<a accesskey="H" href="./index.html"> HOME </a>
</div><div id="content" class="content">
<h1 class="title">System maintenance</h1>
<div id="table-of-contents" role="doc-toc">
<h2>Table of Contents</h2>
<div id="text-table-of-contents" role="doc-toc">
<ul>
2022-05-09 10:05:23 +02:00
<li><a href="#orgcee4f36">Update</a>
2021-10-25 14:37:10 +02:00
<ul>
2022-05-09 10:05:23 +02:00
<li><a href="#orga1d17d9">System packages</a></li>
<li><a href="#org7a43bdd">NPM</a></li>
<li><a href="#org1a3938d">PIP</a></li>
<li><a href="#org02e5c0d">Emacs and Vim</a></li>
2021-10-25 14:37:10 +02:00
</ul>
</li>
2022-05-09 10:05:23 +02:00
<li><a href="#org57b56ea">Check problems in the system</a></li>
<li><a href="#org04cbee1">Check orphan and dropped packages</a></li>
2021-10-25 14:37:10 +02:00
</ul>
</div>
</div>
<p>
<a href="https://wiki.archlinux.org/title/System_maintenance">https://wiki.archlinux.org/title/System_maintenance</a>
</p>
2022-05-09 10:05:23 +02:00
<div id="outline-container-orgcee4f36" class="outline-2">
<h2 id="orgcee4f36">Update</h2>
<div class="outline-text-2" id="text-orgcee4f36">
2021-10-25 14:37:10 +02:00
</div>
2022-05-09 10:05:23 +02:00
<div id="outline-container-orga1d17d9" class="outline-3">
<h3 id="orga1d17d9">System packages</h3>
<div class="outline-text-3" id="text-orga1d17d9">
2021-10-25 14:37:10 +02:00
<p>
To check packages to update:
</p>
<div class="org-src-container">
<pre class="src src-bash">paru -Qu
</pre>
</div>
<p>
And then to perform the update:
</p>
<div class="org-src-container">
<pre class="src src-bash">paru
</pre>
</div>
</div>
</div>
2022-05-09 10:05:23 +02:00
<div id="outline-container-org7a43bdd" class="outline-3">
<h3 id="org7a43bdd">NPM</h3>
<div class="outline-text-3" id="text-org7a43bdd">
2021-10-25 14:37:10 +02:00
<p>
First update <code>npm</code> itself
</p>
<div class="org-src-container">
<pre class="src src-bash"><span class="org-type">sudo</span> npm install npm@latest -g
</pre>
</div>
<p>
Then, we can list outdated packages:
</p>
<div class="org-src-container">
<pre class="src src-bash">npm outdated -g --depth=<span class="org-highlight-numbers-number">0</span>
</pre>
</div>
<p>
And finally perform the update:
</p>
<div class="org-src-container">
<pre class="src src-bash"><span class="org-type">sudo</span> npm update -g
</pre>
</div>
</div>
</div>
2022-05-09 10:05:23 +02:00
<div id="outline-container-org1a3938d" class="outline-3">
<h3 id="org1a3938d">PIP</h3>
<div class="outline-text-3" id="text-org1a3938d">
2021-10-25 14:37:10 +02:00
<p>
First upgrade <code>pip</code> itself:
</p>
<div class="org-src-container">
<pre class="src src-bash">/usr/bin/python3 -m pip install --upgrade pip
</pre>
</div>
<p>
Then list outdated packages:
</p>
<div class="org-src-container">
<pre class="src src-bash">pip3 list --outdated
</pre>
</div>
<p>
And update everything with:
</p>
<div class="org-src-container">
<pre class="src src-bash">pip3 list --outdated --format=freeze | <span class="org-type">grep</span> -v <span class="org-string">'^\-e'</span> | cut -d = -f <span class="org-highlight-numbers-number">1</span> | xargs -n1 pip3 install -U
</pre>
</div>
</div>
</div>
2022-05-09 10:05:23 +02:00
<div id="outline-container-org02e5c0d" class="outline-3">
<h3 id="org02e5c0d">Emacs and Vim</h3>
<div class="outline-text-3" id="text-org02e5c0d">
2021-10-25 14:37:10 +02:00
<p>
Update Doom emacs with:
</p>
<div class="org-src-container">
<pre class="src src-bash">doom up
</pre>
</div>
<p>
And Vim packages with:
</p>
<div class="org-src-container">
<pre class="src src-bash">nvim -c PlugUpgrade -c PlugUpdate
</pre>
</div>
</div>
</div>
</div>
2022-05-09 10:05:23 +02:00
<div id="outline-container-org57b56ea" class="outline-2">
<h2 id="org57b56ea">Check problems in the system</h2>
<div class="outline-text-2" id="text-org57b56ea">
2021-10-25 14:37:10 +02:00
<p>
First check for failed services:
</p>
<div class="org-src-container">
<pre class="src src-bash">systemctl --failed
</pre>
</div>
<p>
Same for user services:
</p>
<div class="org-src-container">
<pre class="src src-bash">systemctl --user --failed
</pre>
</div>
<p>
Look for errors in the logs:
</p>
<div class="org-src-container">
<pre class="src src-bash"><span class="org-type">sudo</span> journalctl -p <span class="org-highlight-numbers-number">3</span> -b
</pre>
</div>
</div>
</div>
2022-05-09 10:05:23 +02:00
<div id="outline-container-org04cbee1" class="outline-2">
<h2 id="org04cbee1">Check orphan and dropped packages</h2>
<div class="outline-text-2" id="text-org04cbee1">
2021-10-25 14:37:10 +02:00
<p>
Run the following to list all orphan packages:
</p>
<div class="org-src-container">
<pre class="src src-bash">pacman -Qtdq | fzf --preview <span class="org-string">'pacman -Qil {}'</span> --layout=reverse --bind <span class="org-string">'enter:execute(pacman -Qil {} | </span><span class="org-type"><span class="org-string">less</span></span><span class="org-string">)'</span>
</pre>
</div>
<p>
Then, either remove the unused packages or set the package to &ldquo;explicitly installed&rdquo; with:
</p>
<div class="org-src-container">
<pre class="src src-bash"><span class="org-type">sudo</span> pacman -D --asexplicit package_name
</pre>
</div>
<p>
Use the <code>ancient-packages</code> (<a href="https://aur.archlinux.org/packages/ancient-packages/">link</a>) command to list dropped packages (packages may longer in the remote repositories, but still on the local system):
</p>
<div class="org-src-container">
<pre class="src src-bash">ancient-packages
</pre>
</div>
</div>
</div>
</div>
<div id="postamble" class="status">
<p class="author">Author: Dehaeze Thomas</p>
2022-05-09 10:05:23 +02:00
<p class="date">Created: 2022-05-09 lun. 10:04</p>
2021-10-25 14:37:10 +02:00
</div>
</body>
</html>