snipt

Ctrl+h for KB shortcuts

Text only

set apt-cacher proxy and temporarily disable it

1
2
3
4
5
6
7
In this example an apt-cacher proxy is running on the server at 192.168.0.2.

---- /etc/apt/apt.conf.d/01proxy:
Acquire::http::Proxy "http://192.168.0.2:3142/apt-cacher/";

Bypassing the proxy temporarily:
# apt-get install -o Acquire::http::Proxy=none ack-grep
https://snipt.net/embed/89385dbb43fd8fd9161e08100f3885f0/
/raw/89385dbb43fd8fd9161e08100f3885f0/
89385dbb43fd8fd9161e08100f3885f0
text
Text only
7
2019-08-19T16:54:20
True
False
False
/api/public/snipt/6260/
set-apt-cacher-proxy-and-temporarily-disable-it
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>In this example an apt-cacher proxy is running on the server at 192.168.0.2. </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>---- /etc/apt/apt.conf.d/01proxy: </span><span id="L-4"><a name="L-4"></a>Acquire::http::Proxy &quot;http://192.168.0.2:3142/apt-cacher/&quot;; </span><span id="L-5"><a name="L-5"></a> </span><span id="L-6"><a name="L-6"></a>Bypassing the proxy temporarily: </span><span id="L-7"><a name="L-7"></a># apt-get install -o Acquire::http::Proxy=none ack-grep </span></pre></div> </td></tr></table>
apt, debian, ubuntu

Bash

save/restore debian package selections

1
2
3
$ sudo dpkg --get-selections >packages.txt
$ sudo dpkg --set-selections <packages.txt
$ sudo apt-get dselect-upgrade
https://snipt.net/embed/8eff9d1fde7c40dd7062916beca63dd0/
/raw/8eff9d1fde7c40dd7062916beca63dd0/
8eff9d1fde7c40dd7062916beca63dd0
bash
Bash
3
2019-08-19T17:04:29
True
False
False
/api/public/snipt/5529/
saverestore-debian-package-selections
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ sudo dpkg --get-selections &gt;packages.txt </span><span id="L-2"><a name="L-2"></a>$ sudo dpkg --set-selections &lt;packages.txt </span><span id="L-3"><a name="L-3"></a>$ sudo apt-get dselect-upgrade </span></pre></div> </td></tr></table>
apt, debian, dpkg, ubuntu

Bash

list repositories for a deb package

1
2
3
4
5
6
7
8
$ sudo apt-get install apt-show-versions
$ apt-show-versions -a git-core
git-core 1:1.6.0.4-1ubuntu2 install ok installed
git-core 1:1.5.6.3-1.1ubuntu2   intrepid          fi.archive.ubuntu.com
git-core 1:1.5.6.3-1.1ubuntu2.1 intrepid-security security.ubuntu.com
git-core 1:1.6.0.4-1ubuntu2     jaunty            fi.archive.ubuntu.com
No unstable version
git-core/jaunty uptodate 1:1.6.0.4-1ubuntu2
https://snipt.net/embed/d8d74718b12f9a51c299d2a619db73c8/
/raw/d8d74718b12f9a51c299d2a619db73c8/
d8d74718b12f9a51c299d2a619db73c8
bash
Bash
8
2019-08-19T17:04:48
True
False
False
/api/public/snipt/5465/
list-repositories-for-a-deb-package
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ sudo apt-get install apt-show-versions </span><span id="L-2"><a name="L-2"></a>$ apt-show-versions -a git-core </span><span id="L-3"><a name="L-3"></a>git-core 1:1.6.0.4-1ubuntu2 install ok installed </span><span id="L-4"><a name="L-4"></a>git-core 1:1.5.6.3-1.1ubuntu2 intrepid <span class="k">fi</span>.archive.ubuntu.com </span><span id="L-5"><a name="L-5"></a>git-core 1:1.5.6.3-1.1ubuntu2.1 intrepid-security security.ubuntu.com </span><span id="L-6"><a name="L-6"></a>git-core 1:1.6.0.4-1ubuntu2 jaunty <span class="k">fi</span>.archive.ubuntu.com </span><span id="L-7"><a name="L-7"></a>No unstable version </span><span id="L-8"><a name="L-8"></a>git-core/jaunty uptodate 1:1.6.0.4-1ubuntu2 </span></pre></div> </td></tr></table>
apt, debian, dpkg, query, repository, ubuntu