snipt

Ctrl+h for KB shortcuts

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-06-23T23:48:55
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

Bash

Show installed Debian packages sorted by size

dpkg-query -W -f='${Installed-Size} ${Package}\n' | sort -n
https://snipt.net/embed/9fcc084bb02f57627c9e76fa8ff3c636/
/raw/9fcc084bb02f57627c9e76fa8ff3c636/
9fcc084bb02f57627c9e76fa8ff3c636
bash
Bash
1
2019-06-20T00:27:14
True
False
False
/api/public/snipt/4920/
show-installed-debian-packages-sorted-by-size
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>dpkg-query -W -f<span class="o">=</span><span class="s1">&#39;${Installed-Size} ${Package}\n&#39;</span> <span class="p">|</span> sort -n </span></pre></div> </td></tr></table>
bash, deb, debian, dpkg, sort

Bash

Sorting debian packages by size

dpkg-query -W -f='${Installed-Size} ${Package}\n' | sort -n
https://snipt.net/embed/bef1cfd9511b675a73ce39b8cfc357e5/
/raw/bef1cfd9511b675a73ce39b8cfc357e5/
bef1cfd9511b675a73ce39b8cfc357e5
bash
Bash
1
2019-06-24T07:45:34
True
False
False
/api/public/snipt/4292/
sorting-debian-packages-by-size
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>dpkg-query -W -f<span class="o">=</span><span class="s1">&#39;${Installed-Size} ${Package}\n&#39;</span> <span class="p">|</span> sort -n </span></pre></div> </td></tr></table>
debian

Bash

Find files larger than 10MB in the current dir (debian)

$ find . -type f -size +10000k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }'
https://snipt.net/embed/3d1e762043b1e72de69b359774c01b83/
/raw/3d1e762043b1e72de69b359774c01b83/
3d1e762043b1e72de69b359774c01b83
bash
Bash
1
2019-06-25T06:59:00
True
False
False
/api/public/snipt/1869/
find-files-larger-than-10mb-in-the-current-dir-debian
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ find . -type f -size +10000k -exec ls -lh <span class="o">{}</span> <span class="se">\;</span> <span class="p">|</span> awk <span class="s1">&#39;{ print $8 &quot;: &quot; $5 }&#39;</span> </span></pre></div> </td></tr></table>
bash, debian, filesize