literate-dotfiles/docs/maintenance.html

211 lines
5.7 KiB
HTML
Raw Permalink 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>
<!-- 2021-10-25 lun. 14:33 -->
<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>
<li><a href="#orgffc515a">Update</a>
<ul>
<li><a href="#org1dbb612">System packages</a></li>
<li><a href="#orge4759bc">NPM</a></li>
<li><a href="#org359ad9e">PIP</a></li>
<li><a href="#org4a73361">Emacs and Vim</a></li>
</ul>
</li>
<li><a href="#org91cdfc6">Check problems in the system</a></li>
<li><a href="#org51b97e6">Check orphan and dropped packages</a></li>
</ul>
</div>
</div>
<p>
<a href="https://wiki.archlinux.org/title/System_maintenance">https://wiki.archlinux.org/title/System_maintenance</a>
</p>
<div id="outline-container-orgffc515a" class="outline-2">
<h2 id="orgffc515a">Update</h2>
<div class="outline-text-2" id="text-orgffc515a">
</div>
<div id="outline-container-org1dbb612" class="outline-3">
<h3 id="org1dbb612">System packages</h3>
<div class="outline-text-3" id="text-org1dbb612">
<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>
<div id="outline-container-orge4759bc" class="outline-3">
<h3 id="orge4759bc">NPM</h3>
<div class="outline-text-3" id="text-orge4759bc">
<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>
<div id="outline-container-org359ad9e" class="outline-3">
<h3 id="org359ad9e">PIP</h3>
<div class="outline-text-3" id="text-org359ad9e">
<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>
<div id="outline-container-org4a73361" class="outline-3">
<h3 id="org4a73361">Emacs and Vim</h3>
<div class="outline-text-3" id="text-org4a73361">
<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>
<div id="outline-container-org91cdfc6" class="outline-2">
<h2 id="org91cdfc6">Check problems in the system</h2>
<div class="outline-text-2" id="text-org91cdfc6">
<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>
<div id="outline-container-org51b97e6" class="outline-2">
<h2 id="org51b97e6">Check orphan and dropped packages</h2>
<div class="outline-text-2" id="text-org51b97e6">
<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>
<p class="date">Created: 2021-10-25 lun. 14:33</p>
</div>
</body>
</html>