<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Debian on bramp.net</title>
    <link>https://blog.bramp.net/</link>
    <description>Recent content in Debian on bramp.net</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-GB</language>
    <lastBuildDate>Sun, 15 Apr 2012 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://blog.bramp.net/tags/debian/" rel="self" type="application/rss+xml" />
    
    <item>
      <title>LaTeX Error: File `layaureo.sty’ not found</title>
      <link>https://blog.bramp.net/post/2012/04/15/latex-error-file-layaureo.sty-not-found/</link>
      <pubDate>Sun, 15 Apr 2012 00:00:00 +0000</pubDate>
      
      <guid>https://blog.bramp.net/post/2012/04/15/latex-error-file-layaureo.sty-not-found/</guid>
      <description><p>I was getting the error <code>./cv.tex:11: LaTeX Error: File `layaureo.sty' not found.</code> when trying to compile an <a href="https://github.com/bramp/curriculum-vitae" title="Curriculum Vitae latex project">old tex document</a> of mine.</p>
<p>It seems layaureo is missing from <a href="http://www.tug.org/texlive/" title="TeX Live">TexLive</a> 2009, the default on Debian at the moment (even though it’s 2012 now!). So I had to install TexLive 2011 from Debian Unstable using <a href="http://wiki.debian.org/AptPreferences">Apt Pinning</a> to fix this problem.</p>
<p>Once TexLive 2011 is installed <code>apt-get install -t unstable texlive-lang-italian</code> to bring in the layaureo package.</p>
<p>I also encountered the following problems that was easier to resolve:</p>
<pre tabindex="0"><code>LaTeX Error: File `marvosym.sty&#39; not found. solution: apt-get install texlive-fonts-recommended
LaTeX Error: File `fullpage.sty&#39; not found. solution: apt-get install texlive-latex-extra
LaTeX Error: File `multibib.sty&#39; not found. solution: apt-get install texlive-bibtex-extra
LaTeX Error: File `algorithm.sty&#39; not found. solution: apt-get install texlive-science
</code></pre></description>
    </item>
    
    <item>
      <title>Building PHP’s Debian package nightmare</title>
      <link>https://blog.bramp.net/post/2011/11/22/building-phps-debian-package-nightmare/</link>
      <pubDate>Tue, 22 Nov 2011 00:00:00 +0000</pubDate>
      
      <guid>https://blog.bramp.net/post/2011/11/22/building-phps-debian-package-nightmare/</guid>
      <description><p>I just tried to compile the Debian PHP packages, so I could make some <a href="http://www.howtoforge.com/recompiling-php5-with-bundled-support-for-gd-on-ubuntu">minor tweaks</a> to the source, to fix a bug I’m hopefully going to document shortly. This turned out to be very problematic, mainly due to the testing phase!</p>
<p>To build the Debian packages you typically do the following:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">mkdir php
</span></span><span class="line"><span class="cl"><span class="nb">cd</span> php
</span></span><span class="line"><span class="cl">apt-get <span class="nb">source</span> php5
</span></span><span class="line"><span class="cl"><span class="nb">cd</span> php5-*
</span></span><span class="line"><span class="cl">debuild -us -uc -j4
</span></span></code></pre></div><p>While testing, the debian/setup_mysql.sh script is called, to create a temporary MySQL database. This however failed to execute correctly because I had some custom options in my <a href="http://dev.mysql.com/doc/refman/5.1/en/option-files.html">~/.my.cnf</a>. Thus it failed like so:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># start our own mysql server for the tests</span>
</span></span><span class="line"><span class="cl">/bin/sh debian/setup-mysql.sh <span class="m">1029</span> /home/bramp/vendor/php/php5-5.3.8.0/mysql_db
</span></span><span class="line"><span class="cl">mysqladmin: connect to server at <span class="s1">&#39;localhost&#39;</span> failed
</span></span><span class="line"><span class="cl">error: <span class="s1">&#39;Access denied for user &#39;</span>root<span class="s1">&#39;@&#39;</span>localhost<span class="s1">&#39; (using password: YES)&#39;</span>
</span></span><span class="line"><span class="cl">make: *** <span class="o">[</span>test-results.txt<span class="o">]</span> Error <span class="m">1</span>
</span></span><span class="line"><span class="cl">dpkg-buildpackage: error: debian/rules build gave error <span class="nb">exit</span> status <span class="m">2</span>
</span></span><span class="line"><span class="cl">debuild: fatal error at line 1348:
</span></span><span class="line"><span class="cl">dpkg-buildpackage -rfakeroot -D -us -uc -j8 failed
</span></span></code></pre></div><p>After removing the my.cnf things were ok. The below patch fixes it in a more general way:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-diff" data-lang="diff"><span class="line"><span class="cl"><span class="gd">-- debian/setup-mysql.sh.org	2011-11-21 21:57:07.244481175 -0500
</span></span></span><span class="line"><span class="cl"><span class="gi">+++ debian/setup-mysql.sh	2011-11-21 21:40:39.384455880 -0500
</span></span></span><span class="line"><span class="cl"><span class="gu">@@ -16,7 +16,7 @@
</span></span></span><span class="line"><span class="cl"> 
</span></span><span class="line"><span class="cl"> socket=$datadir/mysql.sock
</span></span><span class="line"><span class="cl"> # Commands:
</span></span><span class="line"><span class="cl"><span class="gd">-mysqladmin=&#34;mysqladmin -u root -P $port -h localhost --socket=$socket&#34;
</span></span></span><span class="line"><span class="cl"><span class="gi">+mysqladmin=&#34;mysqladmin --no-defaults -u root -P $port -h localhost --socket=$socket&#34;
</span></span></span><span class="line"><span class="cl"> mysqld=&#34;/usr/sbin/mysqld --no-defaults --bind-address=localhost --port=$port --socket=$socket --datadir=$datadir&#34;
</span></span><span class="line"><span class="cl"> 
</span></span><span class="line"><span class="cl"> # Main code #
</span></span></code></pre></div><p>The next problem I encountered is that all the automated PHP unit tests were failing, and they would eventually get stuck and use all my RAM and swap space (at least 16GiB of it) :( I’m not sure what made the machine run out of RAM, but the tests were failing because the version of PHP that was running the tests was incorrectly loading extensions from my system. The quick fix for this was to disable any extensions I had installed to my system. I just</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">sudo mv /etc/php5/conf.d /etc/php5/conf.d.tmp
</span></span></code></pre></div><p>to do that.</p>
<p>This made me think that in future I should perhaps find a cleaner environment to build these packages. In fact, it makes me wonder if the builds are just broken if my environment clearly impacts the successful run of tests.</p>
<p>One trick I found while building again and again, is that you can pass “-nc” to debuild so that it does not clean, and thus reuses the existing build materials for a faster build. Either way, I now have my own version of PHP built and installed! Next time I might just ignore the .deb files and build direct from source.</p>
</description>
    </item>
    
    <item>
      <title>Grub2 and Windows</title>
      <link>https://blog.bramp.net/post/2009/09/10/grub2-and-windows/</link>
      <pubDate>Thu, 10 Sep 2009 00:00:00 +0000</pubDate>
      
      <guid>https://blog.bramp.net/post/2009/09/10/grub2-and-windows/</guid>
      <description><p>I’ve just installed grub2 on my Debian laptop, and I wanted to write a quick note on how to get dual booting working. Grub2 seems to have a far more complex configuration system than grub, this may be a good or a bad thing. One feature of this is a /etc/grub.d directory which contains a set of scripts to configure what items should be listed on the boot menu.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ ls /etc/grub.d/
</span></span><span class="line"><span class="cl">00_header  05_debian_theme  10_linux  30_os-prober  40_custom  README
</span></span></code></pre></div><p>The scripts get run in order, each adding features to the boot menu. To dual boot Windows you can acheive this in two ways.</p>
<ol>
<li>Write a script which manual adds windows</li>
<li>Use the os-prober script.</li>
</ol>
<p>I opted for option 2 since it seemed the easiest. However, this os-prober script does not work unless the package os-prober is installed. So:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo apt-get install os-prober
</span></span></code></pre></div><p>Once that is installed you can reconfigure grub by doing:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">$ sudo update-grub2
</span></span><span class="line"><span class="cl">Generating grub.cfg ...
</span></span><span class="line"><span class="cl">Found Debian background: moreblue-orbit-grub.png
</span></span><span class="line"><span class="cl">Found linux image: /boot/vmlinuz-2.6.30-1-amd64
</span></span><span class="line"><span class="cl">Found initrd image: /boot/initrd.img-2.6.30-1-amd64
</span></span><span class="line"><span class="cl">Found Microsoft Windows XP Professional on /dev/sda1
</span></span><span class="line"><span class="cl"><span class="k">done</span>
</span></span></code></pre></div><p>When you reboot you should now have Windows on your boot menu.</p>
</description>
    </item>
    
  </channel>
</rss>
