190 lines
No EOL
8.5 KiB
HTML
190 lines
No EOL
8.5 KiB
HTML
|
||
<!DOCTYPE html>
|
||
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
|
||
|
||
<title>snap-pac — snap-pac documentation</title>
|
||
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
|
||
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
|
||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
|
||
<script src="_static/jquery.js"></script>
|
||
<script src="_static/underscore.js"></script>
|
||
<script src="_static/doctools.js"></script>
|
||
<link rel="index" title="Index" href="genindex.html" />
|
||
<link rel="search" title="Search" href="search.html" />
|
||
<link rel="next" title="Installation" href="installation.html" />
|
||
|
||
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
|
||
|
||
|
||
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
|
||
|
||
</head><body>
|
||
<div class="document">
|
||
|
||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||
<div class="sphinxsidebarwrapper">
|
||
<h1 class="logo"><a href="#">snap-pac</a></h1>
|
||
|
||
|
||
|
||
<p class="blurb">pacman hooks that use snapper to create pre/post btrfs snapshots</p>
|
||
|
||
|
||
|
||
|
||
<p>
|
||
<iframe src="https://ghbtns.com/github-btn.html?user=wesbarnett&repo=snap-pac&type=star&count=true&size=large&v=2"
|
||
allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
|
||
</p>
|
||
|
||
|
||
|
||
|
||
|
||
<h3>Navigation</h3>
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="configuration.html#environment-variables">Environment Variables</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="examples.html">Example</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="troubleshooting.html">Troubleshooting</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
|
||
</ul>
|
||
|
||
<div class="relations">
|
||
<h3>Related Topics</h3>
|
||
<ul>
|
||
<li><a href="#">Documentation overview</a><ul>
|
||
<li>Next: <a href="installation.html" title="next chapter">Installation</a></li>
|
||
</ul></li>
|
||
</ul>
|
||
</div>
|
||
<div id="searchbox" style="display: none" role="search">
|
||
<h3 id="searchlabel">Quick search</h3>
|
||
<div class="searchformwrapper">
|
||
<form class="search" action="search.html" method="get">
|
||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
|
||
<input type="submit" value="Go" />
|
||
</form>
|
||
</div>
|
||
</div>
|
||
<script>$('#searchbox').show(0);</script>
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
</div>
|
||
</div>
|
||
<div class="documentwrapper">
|
||
<div class="bodywrapper">
|
||
|
||
|
||
<div class="body" role="main">
|
||
|
||
<section id="snap-pac">
|
||
<h1>snap-pac<a class="headerlink" href="#snap-pac" title="Permalink to this headline">¶</a></h1>
|
||
<p>This is a set of <a class="reference external" href="https://archlinux.org/pacman/">pacman</a> hooks and script that causes
|
||
<a class="reference external" href="http://snapper.io/">snapper</a> to automatically take a pre and post snapshot before and
|
||
after pacman transactions, similar to how <a class="reference external" href="https://yast.opensuse.org/">YaST</a> does with
|
||
OpenSuse. This provides a simple way to undo changes to a system after a pacman
|
||
transaction.</p>
|
||
<p>Because these are pacman hooks, it doesn’t matter how you call pacman—whether
|
||
directly, through an AUR helper, or using an alias—snapper will create the snapshots
|
||
when pacman installs, upgrades, or removes a package. The pacman command used is
|
||
logged in the snapper description for the snapshots. Additionally the snapshot numbers
|
||
are output to the screen and to the pacman log for each snapper configuration during the
|
||
pacman transaction, so that the user can easily find which changes he or she may want to
|
||
revert.</p>
|
||
<div class="literal-block-wrapper docutils container" id="id1">
|
||
<div class="code-block-caption"><span class="caption-text">When you run pacman, the snapper pre/post snapshots are created automatically. For a fuller example see <a class="reference internal" href="examples.html"><span class="doc">Example</span></a>.</span><a class="headerlink" href="#id1" title="Permalink to this code">¶</a></div>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>$ sudo pacman -S vim
|
||
resolving dependencies...
|
||
looking for conflicting packages...
|
||
|
||
Packages (1) vim-8.2.2489-1
|
||
|
||
Total Installed Size: 3.79 MiB
|
||
Net Upgrade Size: 0.00 MiB
|
||
|
||
:: Proceed with installation? [Y/n]
|
||
(1/1) checking keys in keyring [############] 100%
|
||
(1/1) checking package integrity [############] 100%
|
||
(1/1) loading package files [############] 100%
|
||
(1/1) checking for file conflicts [############] 100%
|
||
(1/1) checking available disk space [############] 100%
|
||
:: Running pre-transaction hooks...
|
||
<span class="hll">(1/1) Performing snapper pre snapshots for the following configurations...
|
||
</span><span class="hll">==> root: 7394
|
||
</span>:: Processing package changes...
|
||
(1/1) installing vim [############] 100%
|
||
:: Running post-transaction hooks...
|
||
(1/4) Arming ConditionNeedsUpdate...
|
||
(2/4) Updating icon theme caches...
|
||
(3/4) Updating the desktop file MIME type cache...
|
||
<span class="hll">(4/4) Performing snapper post snapshots for the following configurations...
|
||
</span><span class="hll">==> root: 7395
|
||
</span></pre></div>
|
||
</div>
|
||
</div>
|
||
<p>To undo changes from a pacman transaction, use <code class="docutils literal notranslate"><span class="pre">snapper</span> <span class="pre">undochange</span></code>. See the <em class="manpage"><a class="manpage reference external" href="https://man.archlinux.org/man/snapper.8">snapper(8)</a></em>
|
||
for more details as well as examples.</p>
|
||
<p>If you have severe breakage—like snapper is gone for some reason and you can’t get it
|
||
back—you’ll have to resort to more extreme methods, such as taking a snapshot of the pre
|
||
snapshot and making it the default subvolume or mounting it as /. Most likely you’ll
|
||
need to use a live USB to get into a chroot environment to do any of these things.
|
||
Snapper has a <code class="docutils literal notranslate"><span class="pre">snapper</span> <span class="pre">rollback</span></code> feature, but your setup has to be properly configured to
|
||
use it. The exact procedure depends on your specific setup. Be careful.</p>
|
||
<p>Note that the pre transaction hooks occur before the pacman transaction but after the
|
||
pacman database is synced, if applicable. In other words, if you run <cite>pacman -Syu</cite> and
|
||
roll back the upgrade according to the above instructions, you will not have rolled back
|
||
the pacman database to the previous state. Thus, if, after upgrading and rolling back
|
||
the upgrade, you then install a package, it will possibly be a partial upgrade, which is
|
||
unsupported.</p>
|
||
<div class="toctree-wrapper compound">
|
||
<ul>
|
||
<li class="toctree-l1"><a class="reference internal" href="installation.html">Installation</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="configuration.html">Configuration</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="configuration.html#environment-variables">Environment Variables</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="examples.html">Example</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="troubleshooting.html">Troubleshooting</a></li>
|
||
<li class="toctree-l1"><a class="reference internal" href="faq.html">FAQ</a></li>
|
||
</ul>
|
||
</div>
|
||
</section>
|
||
|
||
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="clearer"></div>
|
||
</div>
|
||
<div class="footer">
|
||
©2021, Wes Barnett, PhD.
|
||
|
||
|
|
||
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.2.0</a>
|
||
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
||
|
||
|
|
||
<a href="_sources/index.rst.txt"
|
||
rel="nofollow">Page source</a>
|
||
</div>
|
||
|
||
|
||
<a href="https://github.com/wesbarnett/snap-pac" class="github">
|
||
<img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" class="github"/>
|
||
</a>
|
||
|
||
|
||
|
||
</body>
|
||
</html> |