<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title type="text">Blog entries tagged ubuntu :: mwop.net</title>
  <updated>2023-12-06T17:15:00-06:00</updated>
  <generator uri="https://getlaminas.org" version="2">Laminas_Feed_Writer</generator>
  <link rel="alternate" type="text/html" href="https://mwop.net/blog/tag/ubuntu"/>
  <link rel="self" type="application/atom+xml" href="https://mwop.net/blog/tag/ubuntu/atom.xml"/>
  <id>https://mwop.net/blog/tag/ubuntu</id>
  <entry xmlns:xhtml="http://www.w3.org/1999/xhtml">
    <title type="html"><![CDATA[Advent 2023: MOTD on Ubuntu]]></title>
    <published>2023-12-06T17:15:00-06:00</published>
    <updated>2023-12-06T17:15:00-06:00</updated>
    <link rel="alternate" type="text/html" href="https://mwop.net/blog/2023-12-05-advent-motd.html"/>
    <id>https://mwop.net/blog/2023-12-05-advent-motd.html</id>
    <author>
      <name>Matthew Weier O'Phinney</name>
      <email>contact@mwop.net</email>
      <uri>https://mwop.net</uri>
    </author>
    <content xmlns:xhtml="http://www.w3.org/1999/xhtml" type="xhtml">
      <xhtml:div xmlns:xhtml="http://www.w3.org/1999/xhtml"><xhtml:p>I never intended for this <xhtml:a href="https://mwop.net/blog/tag/advent2023">Advent 2023 series</xhtml:a> to be
a "Matthew's Bash Tips" series, but evidently, that's where things
are going.</xhtml:p>
<xhtml:p>Today, I detail how to get the "message of the day" on
Ubuntu</xhtml:p>
<xhtml:h3>Why "message of the day"?</xhtml:h3>
<xhtml:p>A long-standing tradition on Unix and Linux servers is to emit a
"message of the day" when somebody logs in to the server. Often
these are setup to only display to the user the first time they
login for the day (hence "of the day").</xhtml:p>
<xhtml:p>In the old days, this was generally found in
<xhtml:code>/etc/motd</xhtml:code>, and would be manually updated by systems
admins on the machine.</xhtml:p>
<xhtml:h3>What's changed?</xhtml:h3>
<xhtml:p>In today's world, the operating system will often have a way to
aggregate messages, which simultaneously allows the OS to inject
important information: OS and kernel version, uptime, whether or
not security patches are available, and more.</xhtml:p>
<xhtml:p>On Ubuntu systems, these are pushed to the directory
<xhtml:code>/etc/update-motd.d</xhtml:code>, and each is a script that can be
run to emit information. By using this approach, a script can run
commands and determine if anything needs to be communicated,
ensuring that you only get up-to-date information.</xhtml:p>
<xhtml:p>However... this means you can't just run <xhtml:code>cat
/etc/motd</xhtml:code> anymore in case you missed it, or your session is
still active, or, if you use Linux on the desktop, you want to see
it, but are in a graphical shell and never got to see the
message.</xhtml:p>
<xhtml:p>So, how do you do it?</xhtml:p>
<xhtml:pre><xhtml:code class="language-bash hljs bash" data-lang="bash">sudo run-parts /etc/update-motd.d`
</xhtml:code></xhtml:pre>
<xhtml:div class="h-entry"><xhtml:img class="u-photo photo" width="50" src="https://avatars0.githubusercontent.com/u/25943?v=3&amp;u=79dd2ea1d4d8855944715d09ee4c86215027fa80&amp;s=140" alt="matthew"/> <xhtml:a class="u-url u-uid p-name" href="https://mwop.net/blog/2023-12-05-advent-motd.html">Advent 2023:
MOTD on Ubuntu</xhtml:a> was originally published <xhtml:time class="dt-published" datetime="2023-12-06T17:15:00-06:00">6 December
2023</xhtml:time> on <xhtml:a href="https://mwop.net">https://mwop.net</xhtml:a> by
<xhtml:a rel="author" class="p-author" href="https://mwop.net">Matthew
Weier O'Phinney</xhtml:a>.</xhtml:div>
</xhtml:div>
    </content>
  </entry>
  <entry xmlns:xhtml="http://www.w3.org/1999/xhtml">
    <title type="html"><![CDATA[Managing Multiple PHP versions via the ondrej/php PPA]]></title>
    <published>2019-04-30T17:10:00-05:00</published>
    <updated>2020-04-16T11:46:00-05:00</updated>
    <link rel="alternate" type="text/html" href="https://mwop.net/blog/2019-04-30-ondrej-multiversion-php.html"/>
    <id>https://mwop.net/blog/2019-04-30-ondrej-multiversion-php.html</id>
    <author>
      <name>Matthew Weier O'Phinney</name>
      <email>contact@mwop.net</email>
      <uri>https://mwop.net</uri>
    </author>
    <content xmlns:xhtml="http://www.w3.org/1999/xhtml" type="xhtml">
      <xhtml:div xmlns:xhtml="http://www.w3.org/1999/xhtml"><xhtml:p>Last week, I did some system updates, and then decided to
compile the most recent PHP releases. I've used <xhtml:a href="https://phpbrew.github.io/phpbrew/">phpbrew</xhtml:a> to manage multiple
PHP releases for a number of years, and having it install a new
version is fairly routine.</xhtml:p>
<xhtml:p>Except this time, it wasn't. Due to updates I installed, I was
getting errors first with compiling the GD extension, then with
ext-intl:</xhtml:p>
<xhtml:ul>
<xhtml:li>
<xhtml:p>If you want Freetype support in ext-gd, you are expected to
install the package libfreetype-dev. On Ubuntu, this now installs
libfreetype6-dev, which no longer includes the
<xhtml:code>freetype-config</xhtml:code> binary that PHP's
<xhtml:code>configure</xhtml:code> script uses to determine what features it
supports.</xhtml:p>
</xhtml:li>
<xhtml:li>
<xhtml:p>Similarly, ext-intl depends on the package libicu-dev. Ubuntu's
package now omits the <xhtml:code>icu-config</xhtml:code> binary used by PHP to
determine feature support.</xhtml:p>
</xhtml:li>
</xhtml:ul>
<xhtml:p>I searched for quite some time to find packages that would
resolve these problems. I could have found the source code and
compiled it and linked to that, but that would mean keeping that
up-to-date on top of my PHP installs.</xhtml:p>
<xhtml:p>I even looked in the <xhtml:a href="https://deb.sury.org/">ondrej/php
PPA</xhtml:a>, as that repository has multiple PHP versions already,
including source packages.</xhtml:p>
<xhtml:p>And then I thought: why not try using those instead of
phpbrew?</xhtml:p>
<xhtml:p>The rest of this post is how I made that work.</xhtml:p>
<xhtml:blockquote>
<xhtml:p>I use Ubuntu for my operating system. The instructions I present
here should work on any Debian-based system, but your mileage may
vary. If you are using an RPM-based system, <xhtml:code>yum</xhtml:code> will
be your friend, but I have no idea how to add repositories in that
system, nor if <xhtml:code>update-alternatives</xhtml:code> is available. As
such, these instructions may or may not help you.</xhtml:p>
<xhtml:p>Which is okay. I mainly wrote them to help future me.</xhtml:p>
</xhtml:blockquote>
<xhtml:h2>Register the PPA</xhtml:h2>
<xhtml:p>First, I had to add the PPA to the system:</xhtml:p>
<xhtml:pre><xhtml:code class="language-bash hljs bash" data-lang="bash">$ sudo add-apt-repository ppa:ondrej/php
</xhtml:code></xhtml:pre>
<xhtml:p>Then the usual:</xhtml:p>
<xhtml:pre><xhtml:code class="language-bash hljs bash" data-lang="bash">$ sudo apt update
</xhtml:code></xhtml:pre>
<xhtml:h2>Approach to installation</xhtml:h2>
<xhtml:p>I first identified the extensions I typically install, matched
them to packages in the PPA, and made a list. I knew I'd be
installing the same extensions across all PHP versions I wanted, so
I figured I could script it a bit.</xhtml:p>
<xhtml:p>From there, I executed the following from the CLI:</xhtml:p>
<xhtml:pre><xhtml:code class="language-bash hljs bash" data-lang="bash">$ <xhtml:span class="hljs-keyword">for</xhtml:span> VERSION <xhtml:span class="hljs-keyword">in</xhtml:span> 5.6 7.0 7.1 7.2 7.3;<xhtml:span class="hljs-keyword">do</xhtml:span>
<xhtml:span class="hljs-keyword">for</xhtml:span>&gt; <xhtml:span class="hljs-keyword">for</xhtml:span> EXTENSION <xhtml:span class="hljs-keyword">in</xhtml:span> {listed all extensions here};<xhtml:span class="hljs-keyword">do</xhtml:span>
<xhtml:span class="hljs-keyword">for</xhtml:span> <xhtml:span class="hljs-keyword">for</xhtml:span>&gt; sudo apt install php<xhtml:span class="hljs-variable">${VERSION}</xhtml:span>-<xhtml:span class="hljs-variable">${EXTENSION}</xhtml:span>
<xhtml:span class="hljs-keyword">for</xhtml:span> <xhtml:span class="hljs-keyword">for</xhtml:span>&gt; <xhtml:span class="hljs-keyword">done</xhtml:span>
<xhtml:span class="hljs-keyword">for</xhtml:span>&gt; <xhtml:span class="hljs-keyword">done</xhtml:span>
</xhtml:code></xhtml:pre>
<xhtml:p>This grabbed and installed each PHP I needed along with all
extensions I wanted.</xhtml:p>
<xhtml:h2>Switching between versions</xhtml:h2>
<xhtml:p>To switch between versions, you have two options:</xhtml:p>
<xhtml:ul>
<xhtml:li>
<xhtml:p>Use the version-specific binaries: <xhtml:code>/usr/bin/php5.6</xhtml:code>,
<xhtml:code>/usr/bin/php7.0</xhtml:code>, etc.</xhtml:p>
</xhtml:li>
<xhtml:li>
<xhtml:p>Set a default via <xhtml:code>update-alternatives</xhtml:code>:</xhtml:p>
<xhtml:pre><xhtml:code class="language-bash hljs bash" data-lang="bash">$ sudo update-alternatives --<xhtml:span class="hljs-built_in">set</xhtml:span> php /usr/bin/php5.6
</xhtml:code></xhtml:pre>
<xhtml:p>If you're not sure what you have installed, use:</xhtml:p>
<xhtml:pre><xhtml:code class="language-bash hljs bash" data-lang="bash">$ sudo update-alternatives --config php
</xhtml:code></xhtml:pre>
<xhtml:p>which will give you a listing, and an ability to select the one
to use.</xhtml:p>
</xhtml:li>
</xhtml:ul>
<xhtml:h3>Rootless alternatives</xhtml:h3>
<xhtml:p>What if you'd rather not be root to switch the default version,
though? Fortunately, <xhtml:code>update-alternatives</xhtml:code> allows
specifying alternate config and admin directories.</xhtml:p>
<xhtml:p>Define the following alias in your shell's configuration:</xhtml:p>
<xhtml:pre><xhtml:code class="language-bash hljs bash" data-lang="bash"><xhtml:span class="hljs-built_in">alias</xhtml:span> update-my-alternatives=<xhtml:span class="hljs-string">'update-alternatives \
 --altdir ~/.local/etc/alternatives \
 --admindir ~/.local/var/lib/alternatives'</xhtml:span>
</xhtml:code></xhtml:pre>
<xhtml:p>Additionally, make sure you add <xhtml:code>$HOME/.local/bin</xhtml:code> to
your <xhtml:code>$PATH</xhtml:code>; since defining <xhtml:code>$PATH</xhtml:code> varies
based on the shell you use, I'll leave that for you to
accomplish.</xhtml:p>
<xhtml:p>If you open a new shell, the alias will now be available;
alternately, source the file in which you defined it to have it
take effect immediately.</xhtml:p>
<xhtml:p>Once you've done that, you can run the following, based on the
PHP versions you've installed:</xhtml:p>
<xhtml:pre><xhtml:code class="language-bash hljs bash" data-lang="bash">$ <xhtml:span class="hljs-keyword">for</xhtml:span> VERSION <xhtml:span class="hljs-keyword">in</xhtml:span> 5.6 7.0 7.1 7.2 7.3;<xhtml:span class="hljs-keyword">do</xhtml:span>
<xhtml:span class="hljs-keyword">for</xhtml:span>&gt; update-my-alternatives --install <xhtml:span class="hljs-variable">$HOME</xhtml:span>/.<xhtml:span class="hljs-built_in">local</xhtml:span>/bin/php php /usr/bin/php<xhtml:span class="hljs-variable">${VERSION}</xhtml:span> <xhtml:span class="hljs-variable">${VERSION//./0}</xhtml:span>
<xhtml:span class="hljs-keyword">for</xhtml:span>&gt; <xhtml:span class="hljs-keyword">done</xhtml:span>
</xhtml:code></xhtml:pre>
<xhtml:p>This will create alternatives entries local to your own user,
prioritizing them by version; as a result, the default,
auto-selected version will be the most recently installed.</xhtml:p>
<xhtml:p>You can verify this by running <xhtml:code>update-my-alternatives
--config php</xhtml:code>:</xhtml:p>
<xhtml:pre><xhtml:code class="language-text">There are 5 choices for the alternative php (providing $HOME/.local/bin/php).

  Selection    Path             Priority   Status
------------------------------------------------------------
* 0            /usr/bin/php7.3   703       auto mode
  1            /usr/bin/php5.6   506       manual mode
  2            /usr/bin/php7.0   700       manual mode
  3            /usr/bin/php7.1   701       manual mode
  4            /usr/bin/php7.2   702       manual mode
  5            /usr/bin/php7.3   703       manual mode

Press &lt;enter&gt; to keep the current choice[*], or type selection number:
</xhtml:code></xhtml:pre>
<xhtml:p>To switch between versions using the alias:</xhtml:p>
<xhtml:ul>
<xhtml:li>
<xhtml:p>Switch to a specific, known version:</xhtml:p>
<xhtml:pre><xhtml:code class="language-bash hljs bash" data-lang="bash">$ update-my-alternatives --<xhtml:span class="hljs-built_in">set</xhtml:span> php /usr/bin/php{VERSION}
</xhtml:code></xhtml:pre></xhtml:li>
<xhtml:li>
<xhtml:p>Switch back to the default version (version with highest
priority):</xhtml:p>
<xhtml:pre><xhtml:code class="language-bash hljs bash" data-lang="bash">$ update-my-alternatives --auto php
</xhtml:code></xhtml:pre></xhtml:li>
<xhtml:li>
<xhtml:p>List available versions:</xhtml:p>
<xhtml:pre><xhtml:code class="language-bash hljs bash" data-lang="bash">$ update-my-alternatives --list php
</xhtml:code></xhtml:pre></xhtml:li>
<xhtml:li>
<xhtml:p>Interactively choose a version when you're not sure what's
available:</xhtml:p>
<xhtml:pre><xhtml:code class="language-bash hljs bash" data-lang="bash">$ update-my-alternatives --config php
</xhtml:code></xhtml:pre></xhtml:li>
</xhtml:ul>
<xhtml:blockquote>
<xhtml:p>The above was cobbled together from:</xhtml:p>
<xhtml:ul>
<xhtml:li><xhtml:a href="https://serverfault.com/a/811377">https://serverfault.com/a/811377</xhtml:a></xhtml:li>
<xhtml:li><xhtml:a href="https://williamdemeo.github.io/linux/update-alternatives.html">https://williamdemeo.github.io/linux/update-alternatives.html</xhtml:a></xhtml:li>
</xhtml:ul>
</xhtml:blockquote>
<xhtml:h2>PECL</xhtml:h2>
<xhtml:p>Compiling and installing your own extensions turns out to be a
bit of a pain when you have multiple PHP versions installed, mainly
because there is exactly one PECL binary installed.</xhtml:p>
<xhtml:p>First, you need to install a few packages, including the one
containing PEAR (PECL uses the PEAR installer), and the development
packages for each PHP version you use (as those contain the tools
necessary to compile extensions, including <xhtml:code>phpize</xhtml:code> and
<xhtml:code>php-config</xhtml:code>):</xhtml:p>
<xhtml:pre><xhtml:code class="language-bash hljs bash" data-lang="bash">$ sudo apt install php-pear
$ <xhtml:span class="hljs-keyword">for</xhtml:span> VERSION <xhtml:span class="hljs-keyword">in</xhtml:span> 5.6 7.0 7.1 7.2 7.3;<xhtml:span class="hljs-keyword">do</xhtml:span>
<xhtml:span class="hljs-keyword">for</xhtml:span>&gt; sudo apt install php<xhtml:span class="hljs-variable">${VERSION}</xhtml:span>-dev
<xhtml:span class="hljs-keyword">for</xhtml:span>&gt; <xhtml:span class="hljs-keyword">done</xhtml:span>
</xhtml:code></xhtml:pre>
<xhtml:h3>Compiling extensions</xhtml:h3>
<xhtml:p>From there, you need to:</xhtml:p>
<xhtml:ol>
<xhtml:li>Ensure the correct <xhtml:code>phpize</xhtml:code> and
<xhtml:code>php-config</xhtml:code> are selected.</xhtml:li>
<xhtml:li>Install the extension.</xhtml:li>
<xhtml:li>Tell PECL to deregister the extension in its own registry.</xhtml:li>
</xhtml:ol>
<xhtml:p>Normally, you would accomplish the first point by doing the
following:</xhtml:p>
<xhtml:pre><xhtml:code class="language-bash hljs bash" data-lang="bash">$ sudo update-alternatives --<xhtml:span class="hljs-built_in">set</xhtml:span> php /usr/bin/php7.3
$ sudo update-alternatives --<xhtml:span class="hljs-built_in">set</xhtml:span> php-config /usr/bin/php-config7.3
$ sudo update-alternatives --<xhtml:span class="hljs-built_in">set</xhtml:span> phpize /usr/bin/phpize7.3
</xhtml:code></xhtml:pre>
<xhtml:blockquote>
<xhtml:p>Note that the above is <xhtml:strong>not</xhtml:strong> using the
<xhtml:code>update-my-alternatives</xhtml:code> alias detailed in the previous
section. This is because extensions must be installed at the
<xhtml:strong>system</xhtml:strong> level.</xhtml:p>
<xhtml:p>That said, the above won't be necessary, as I detail below.</xhtml:p>
</xhtml:blockquote>
<xhtml:p>However, PECL now has a really nice configuration flag,
<xhtml:code>php_suffix</xhtml:code>, that allows specifying a string <xhtml:em>to
append to each of the php, phpize, and php-config binary
names</xhtml:em>. So, for example, if I specify <xhtml:code>pecl -d
php_suffix=7.3</xhtml:code>, the string <xhtml:code>7.3</xhtml:code> will be appended
to those, so that they become <xhtml:code>php7.3</xhtml:code>,
<xhtml:code>phpize7.3</xhtml:code>, and <xhtml:code>php-config7.3</xhtml:code>,
respectively. This ensures that the correct scripts are called
during the build process, and that the extension is installed to
the correct location.</xhtml:p>
<xhtml:p>As for the last point in that numbered list, it's key to being
able to install an extension in multiple PHP versions; otherwise,
each subsequent attempt, even when using a different PHP version,
will result in PECL indicating it's already installed. The
<xhtml:code>-r</xhtml:code> switch tells PECL to remove the package from its
own registry, <xhtml:em>but not to remove any build artifacts</xhtml:em>.</xhtml:p>
<xhtml:p>As a complete example:</xhtml:p>
<xhtml:pre><xhtml:code class="language-bash hljs bash" data-lang="bash">$ sudo pecl -d install php_suffix=7.3 swoole &amp;&amp; sudo pecl uninstall -r swoole
</xhtml:code></xhtml:pre>
<xhtml:h3>Registering extensions</xhtml:h3>
<xhtml:p>From there, you still have to register, and optionally
configure, the extension. To do this, drop a file named after the
extension in
<xhtml:code>/etc/php/${PHP_VERSION}/mods-available/${EXTENSION}.ini</xhtml:code>,
with the following contents:</xhtml:p>
<xhtml:pre><xhtml:code class="language-dosini">; configuration for php ${EXTENSION} module
; priority=20
extension=${EXTENSION}.so
</xhtml:code></xhtml:pre>
<xhtml:p>Now that this is in place, enable it:</xhtml:p>
<xhtml:pre><xhtml:code class="language-bash hljs bash" data-lang="bash">$ sudo phpenmod -v <xhtml:span class="hljs-variable">${PHP_VERSION}</xhtml:span> -s cli <xhtml:span class="hljs-variable">${EXTENSION}</xhtml:span>
</xhtml:code></xhtml:pre>
<xhtml:p>(To disable it, use <xhtml:code>phpdismod</xhtml:code> instead.)</xhtml:p>
<xhtml:h2>Thoughts</xhtml:h2>
<xhtml:p>When thinking in terms of phpbrew:</xhtml:p>
<xhtml:ul>
<xhtml:li>
<xhtml:p>Like <xhtml:code>phpbrew</xhtml:code>, you can temporarily choose an
alternative PHP binary by simply referring to its path. With
<xhtml:code>phpbrew</xhtml:code>, this would be something like
<xhtml:code>~/.phpbrew/php/php-{PHP_VERSION}/bin/php</xhtml:code>. With the
ondrej PPA, it becomes
<xhtml:code>/usr/bin/php{PHP_MINOR_VERSION}</xhtml:code>. (E.g.
<xhtml:code>~/.phpbrew/php/php-7.2.36/bin/php</xhtml:code> would become just
<xhtml:code>/usr/bin/php7.2</xhtml:code>.)</xhtml:p>
</xhtml:li>
<xhtml:li>
<xhtml:p>There is no equivalent to <xhtml:code>phpbrew use</xhtml:code>. That feature
would change the symlink only for the duration of the current
terminal session. Opening a new terminal session would revert to
the previous selection. With <xhtml:code>update-alternatives</xhtml:code>, it's
all or nothing. I mainly used <xhtml:code>phpbrew use</xhtml:code> to ensure my
default PHP did not change in case I forgot to call it again.</xhtml:p>
</xhtml:li>
<xhtml:li>
<xhtml:p>Usage of <xhtml:code>update-alternatives</xhtml:code> is more like
<xhtml:code>phpbrew switch</xhtml:code>, as it affects both the current and all
later terminal sessions. Once switched, that selection is in use
until you switch it again. This means I have to remember to switch
to my default version. However, it's relatively easy to add a line
to my shell profile to call <xhtml:code>update-my-alternatives --auto
php</xhtml:code>.</xhtml:p>
</xhtml:li>
</xhtml:ul>
<xhtml:p>Basically, if you can use the binary directly, but don't want to
use that one as your default, refer to it by absolute path. If you
are using a command that will use the current environment's PHP,
use <xhtml:code>update-my-alternatives</xhtml:code> to switch PHP versions
first.</xhtml:p>
<xhtml:p>The other issue I see is that if I want to test against a
<xhtml:em>specific</xhtml:em> PHP version, I'll still need to compile it myself
— which leads me back to the original problem that led me here in
the first place. I'll cross that bridge when I get to it. Until
then, I have a workable solution — and finally a single document I
can refer to when I need to remember again at a later date, instead
of cobbling it together from multiple sources!</xhtml:p>
<xhtml:h3>Updates</xhtml:h3>
<xhtml:ul>
<xhtml:li>2020-04-16: fixes reference to PPA in command that adds it to
system.</xhtml:li>
<xhtml:li>2019-05-01: added breakpoint so that full post is not presented
in lists.</xhtml:li>
</xhtml:ul>
<xhtml:div class="h-entry"><xhtml:img class="u-photo photo" width="50" src="https://avatars0.githubusercontent.com/u/25943?v=3&amp;u=79dd2ea1d4d8855944715d09ee4c86215027fa80&amp;s=140" alt="matthew"/> <xhtml:a class="u-url u-uid p-name" href="https://mwop.net/blog/2019-04-30-ondrej-multiversion-php.html">Managing
Multiple PHP versions via the ondrej/php PPA</xhtml:a> was originally
published <xhtml:time class="dt-published" datetime="2019-04-30T17:10:00-05:00">30 April 2019</xhtml:time> on <xhtml:a href="https://mwop.net">https://mwop.net</xhtml:a> by <xhtml:a rel="author" class="p-author" href="https://mwop.net">Matthew Weier
O'Phinney</xhtml:a>.</xhtml:div>
</xhtml:div>
    </content>
  </entry>
  <entry xmlns:xhtml="http://www.w3.org/1999/xhtml">
    <title type="html"><![CDATA[Fixing gnome-shell app indicators in Ubuntu]]></title>
    <published>2019-04-02T08:30:00-05:00</published>
    <updated>2019-04-02T08:30:00-05:00</updated>
    <link rel="alternate" type="text/html" href="https://mwop.net/blog/2019-04-02-ubuntu-gnome-appindicators.html"/>
    <id>https://mwop.net/blog/2019-04-02-ubuntu-gnome-appindicators.html</id>
    <author>
      <name>Matthew Weier O'Phinney</name>
      <email>contact@mwop.net</email>
      <uri>https://mwop.net</uri>
    </author>
    <content xmlns:xhtml="http://www.w3.org/1999/xhtml" type="xhtml">
      <xhtml:div xmlns:xhtml="http://www.w3.org/1999/xhtml"><xhtml:p>I am a long-time <xhtml:a href="https://wiki.gnome.org/Projects/GnomeShell">gnome-shell</xhtml:a> user.
I appreciate the simplicity and elegance it provides, as I prefer
having a minimalist environment that still provides me easy access
to the applications I use.</xhtml:p>
<xhtml:p>That said, just as with any desktop environment, I've still run
into problems now and again. One that's been plaguing me since at
least the 18.04 release is with display of app indicators,
specifically those using legacy system tray APIs.</xhtml:p>
<xhtml:p>Normally, gnome-shell ignores these, which is suboptimal as a
number of popular programs still use them (including Dropbox,
Nextcloud, Keybase, Shutter, and many others). To integrate them
into Gnome, Ubuntu provides the gnome-shell extension
"kstatusnotifieritem/appindicator support" (via the package
<xhtml:code>gnome-shell-extension-appindicator</xhtml:code>). When enabled,
they show up in your gnome-shell panel. Problem solved!</xhtml:p>
<xhtml:p>Except that if you suspend your system or lock your screen, they
disappear when you wake it up.</xhtml:p>
<xhtml:p>Now, you can get them back by hitting <xhtml:code>Alt-F2</xhtml:code>, and
entering <xhtml:code>r</xhtml:code> (for "restart") at the prompt. But having
to do that after every time you suspend or lock is tedious.</xhtml:p>
<xhtml:p>Fortunately, I recently came across this gem:</xhtml:p>
<xhtml:pre><xhtml:code class="language-bash hljs bash" data-lang="bash">$ sudo apt purge indicator-common
</xhtml:code></xhtml:pre>
<xhtml:p>This removes some packages specific to Ubuntu's legacy Unity
interface that interfere with how appindicators are propagated to
the desktop. Once I did this, my appindicators persisted after all
suspend/lock operations!</xhtml:p>
<xhtml:div class="h-entry"><xhtml:img class="u-photo photo" width="50" src="https://avatars0.githubusercontent.com/u/25943?v=3&amp;u=79dd2ea1d4d8855944715d09ee4c86215027fa80&amp;s=140" alt="matthew"/> <xhtml:a class="u-url u-uid p-name" href="https://mwop.net/blog/2019-04-02-ubuntu-gnome-appindicators.html">Fixing
gnome-shell app indicators in Ubuntu</xhtml:a> was originally published
<xhtml:time class="dt-published" datetime="2019-04-02T08:30:00-05:00">2
April 2019</xhtml:time> on <xhtml:a href="https://mwop.net">https://mwop.net</xhtml:a> by <xhtml:a rel="author" class="p-author" href="https://mwop.net">Matthew Weier
O'Phinney</xhtml:a>.</xhtml:div>
</xhtml:div>
    </content>
  </entry>
  <entry xmlns:xhtml="http://www.w3.org/1999/xhtml">
    <title type="html"><![CDATA[Fixing AMD Radeon Display Issues in Ubuntu 14.10]]></title>
    <published>2014-11-03T14:15:00-06:00</published>
    <updated>2014-11-03T14:15:00-06:00</updated>
    <link rel="alternate" type="text/html" href="https://mwop.net/blog/2014-11-03-utopic-and-amd.html"/>
    <id>https://mwop.net/blog/2014-11-03-utopic-and-amd.html</id>
    <author>
      <name>Matthew Weier O'Phinney</name>
      <email>contact@mwop.net</email>
      <uri>https://mwop.net</uri>
    </author>
    <content xmlns:xhtml="http://www.w3.org/1999/xhtml" type="xhtml">
      <xhtml:div xmlns:xhtml="http://www.w3.org/1999/xhtml"><xhtml:p>After upgrading to <xhtml:a href="https://wiki.ubuntu.com/UtopicUnicorn/ReleaseNotes">Ubuntu
14.10</xhtml:a>, I faced a blank screen after boot. As in: no GUI login
prompt, just a blank screen. My monitors were on, I'd seen the
graphical splash screen as Ubuntu booted, but nothing once
complete.</xhtml:p>
<xhtml:p>Fortunately, I <xhtml:em>could</xhtml:em> switch over to a TTY prompt (using
Alt+F1), so I had some capacity to try and fix the situation. The
question was: what did I need to do?</xhtml:p>
<xhtml:h2>Go Back To Basics</xhtml:h2>
<xhtml:p>While the Linux kernel was recognizing my Radeon 6750, and even
the X server had no problems detecting it and setting it up, I
still faced a display issue. Fortunately, there's a fix for that:
remove the proprietary drivers.</xhtml:p>
<xhtml:p>The steps for removing the proprietary drivers are as
follows:</xhtml:p>
<xhtml:pre><xhtml:code class="language-bash hljs bash" data-lang="bash">$ sudo apt-get purge <xhtml:span class="hljs-string">'fglrx*'</xhtml:span>
$ sudo update-alternatives --remove-all x86_64-linux-gnu_gl_conf
$ sudo apt-get install --reinstall libgl1-mesa-dri libgl1-mesa-glx
</xhtml:code></xhtml:pre>
<xhtml:p>Some people will tell you then to reinstall the fglrx drivers
Ubuntu ships, or even the "fglrx-updates" set, but I found it best
to go all the way back to basics.</xhtml:p>
<xhtml:p>After executing the above steps, reboot so that they drivers are
present in the kernel.</xhtml:p>
<xhtml:p>Once you do, you can try your luck with the proprietary drivers,
using the "Additional Drivers" tool built into Ubuntu. I personally
found that neither the proprietary fglrx drivers, fglrx-updates,
nor the official AMD Catalyst sources worked — and, after each
failed attempt, I'd run the above to get back to a working
state.</xhtml:p>
<xhtml:p>My conclusion is that the proprietary drivers are likely not yet
tested with the kernel sources currently in use by 14.10.
Fortunately, the OSS variants with which Ubuntu ships appear to be
quite stable, and cover all the features that the proprietary
versions covered previously.</xhtml:p>
<xhtml:p>As always with a post like this: your mileage may vary.
Hopefully the steps above will help at least a few of you; they
worked for me on both my workstation and laptop.</xhtml:p>
<xhtml:div class="h-entry"><xhtml:img class="u-photo photo" width="50" src="https://avatars0.githubusercontent.com/u/25943?v=3&amp;u=79dd2ea1d4d8855944715d09ee4c86215027fa80&amp;s=140" alt="matthew"/> <xhtml:a class="u-url u-uid p-name" href="https://mwop.net/blog/2014-11-03-utopic-and-amd.html">Fixing AMD
Radeon Display Issues in Ubuntu 14.10</xhtml:a> was originally published
<xhtml:time class="dt-published" datetime="2014-11-03T14:15:00-06:00">3
November 2014</xhtml:time> on <xhtml:a href="https://mwop.net">https://mwop.net</xhtml:a> by <xhtml:a rel="author" class="p-author" href="https://mwop.net">Matthew Weier
O'Phinney</xhtml:a>.</xhtml:div>
</xhtml:div>
    </content>
  </entry>
  <entry xmlns:xhtml="http://www.w3.org/1999/xhtml">
    <title type="html"><![CDATA[Server Upgrades... lost entries...]]></title>
    <published>2008-05-16T09:05:13-05:00</published>
    <updated>2008-05-21T14:35:27-05:00</updated>
    <link rel="alternate" type="text/html" href="https://mwop.net/blog/171-Server-Upgrades...-lost-entries....html"/>
    <id>https://mwop.net/blog/171-Server-Upgrades...-lost-entries....html</id>
    <author>
      <name>Matthew Weier O'Phinney</name>
      <email>contact@mwop.net</email>
      <uri>https://mwop.net</uri>
    </author>
    <content xmlns:xhtml="http://www.w3.org/1999/xhtml" type="xhtml">
      <xhtml:div xmlns:xhtml="http://www.w3.org/1999/xhtml"><xhtml:p>My good friend, Rob, hosts my site for me, in return for helping
with server maintenance. After being on Gentoo for the past three
years, though, we decided it was time to switch to something a
little easier to maintain, so last night we wiped the system
partitions and installed Ubuntu server.</xhtml:p>
<xhtml:p>I'll say this: the setup is much faster! However, we had a few
gotchas that surprised us — it didn't setup our RAID array
out-of-the-box, which led to a good hour of frustration as we tried
to verify that the install wouldn't wipe it, and then to verify
that we could re-assemble it. (We succeeded.) Additionally, we
second-guessed a few things we shouldn't have, which led to needing
to back out and reconfigure. But what was over a 12 hour install
with Gentoo we accomplished in a matter of a few hours with Ubuntu
server — so it was a huge success that way.</xhtml:p>
<xhtml:p>Unfortunately, our mysqldump of all databases… wasn't, a fact we
discovered only after importing it into the new system. I ended up
losing my blog database and PEAR channel database. Fortunately, the
PEAR channel has not changed at all in the past year, so we had an
old backup that worked, and I had a snapshot of my blog database
from three weeks ago I was able to use. As a result, there are a
few missing entries, but for the most part, all works. If you
commented on one of those missing entries, my apologies.</xhtml:p>
<xhtml:p>Now that the install is done, I'm also finalizing some design
changes to my blog — it's time to leave the black and white for
more colorful grounds. Look for a revamp in the coming weeks!</xhtml:p>
<xhtml:div class="h-entry"><xhtml:img class="u-photo photo" width="50" src="https://avatars0.githubusercontent.com/u/25943?v=3&amp;u=79dd2ea1d4d8855944715d09ee4c86215027fa80&amp;s=140" alt="matthew"/> <xhtml:a class="u-url u-uid p-name" href="https://mwop.net/blog/171-Server-Upgrades...-lost-entries....html">
Server Upgrades... lost entries...</xhtml:a> was originally published
<xhtml:time class="dt-published" datetime="2008-05-16T09:05:13-05:00">16
May 2008</xhtml:time> on <xhtml:a href="https://mwop.net">https://mwop.net</xhtml:a>
by <xhtml:a rel="author" class="p-author" href="https://mwop.net">Matthew
Weier O'Phinney</xhtml:a>.</xhtml:div>
</xhtml:div>
    </content>
  </entry>
  <entry xmlns:xhtml="http://www.w3.org/1999/xhtml">
    <title type="html"><![CDATA[Gutsy Gibbon review]]></title>
    <published>2007-10-20T07:55:00-05:00</published>
    <updated>2016-07-04T12:10:00-05:00</updated>
    <link rel="alternate" type="text/html" href="https://mwop.net/blog/147-Gutsy-Gibbon-review.html"/>
    <id>https://mwop.net/blog/147-Gutsy-Gibbon-review.html</id>
    <author>
      <name>Matthew Weier O'Phinney</name>
      <email>contact@mwop.net</email>
      <uri>https://mwop.net</uri>
    </author>
    <content xmlns:xhtml="http://www.w3.org/1999/xhtml" type="xhtml">
      <xhtml:div xmlns:xhtml="http://www.w3.org/1999/xhtml"><xhtml:p>Early in the week, I decided to avoid the release rush and go
ahead and update my laptop to <xhtml:a href="http://www.ubuntu.com">Ubuntu's</xhtml:a> Gutsy Gibbon release. Overall,
it's quite good, with one caveat I'll elaborate on later.</xhtml:p>
<xhtml:p>I'd been having some issues with fonts following a session at
ZendCon where I hooked my laptop up to a widescreen display, and
the updates fixed all those issues. Most things that worked before
continued to work, and often in an improved way. The various new
themes available — from GDM to GTK to window manager themes — make
for some pretty displays, and I've found a new look for my desktop
that I really like.</xhtml:p>
<xhtml:p>Among the improvements, it installed <xhtml:a href="http://www.gnome.org/projects/tracker/">trackerd</xhtml:a>, a desktop
search tool. I'd tried installing this on my own before, but ran
into a ton of dependency issues I couldn't fix. Prior to this, I'd
used beagle, which worked okay, but tended to overlook a lot of
files. Trackerd, on the other hand, indexed my entire box
overnight, and stays on top of new files easily. Couple this with
the 'deskbar', and I now have the type of desktop search I've only
seen in Macs.</xhtml:p>
<xhtml:p>Last night, I stumbled upon <xhtml:a href="https://web.archive.org/web/20061110204904/https://help.ubuntu.com/community/CompositeManager/Xgl#head-3138701daf76c1fd11c0b68bf5745c1d1ccacca5">
a forum thread</xhtml:a> detailing how to get X compositing working with
ATI cards. This was something I've been continually disappointed
with; my card supposedly supports it, but every time I've tried
using it, I find it unusable — lots of wierd screen artifacts, and
a huge slowdown in responsiveness. After following the directions
in the linked article, however, I now have compositing going —
window drop shadows, translucency for inactive windows, etc. It
looks really nice, and doesn't seem to be slowing down the machine
at all.</xhtml:p>
<xhtml:p>No review would be complete without a gripe though, right? And
I've got a big one. In the past, one of the strengths of ubuntu for
me has been that suspend and hibernate have just worked. With this
upgrade, however, they no longer work for me. Evidently, a new
kernel option was enabled that is supposed to speed up these
operations… However, the available ATI drivers do not support this
option, which leads, in my case, to a complete inability to suspend
or hibernate, and for others, lockup on resume. Supposedly ATI will
be releasing new drivers that will fix the issue, but there's no
published time frame for when that will happen. Additionally,
ubuntu made no announcements about the issue, and provides no
workarounds. To me, this is a huge BC break, and should have been
addressed prior to the release, particularly as there were many,
many complaints about it in the weeks prior to the release.</xhtml:p>
<xhtml:p>Gripes aside, I find the new functionality fantastic, and look
forward to ATI's release of new drivers for its Radeon series
cards. Perhaps this release will keep me happy enough that I won't
keep lusting for a shiny new Macbook too much.</xhtml:p>
<xhtml:h3>Updates</xhtml:h3>
<xhtml:ul>
<xhtml:li><xhtml:em>2016-07-04</xhtml:em>: Updated the link to the forum thread to
point to an archived version on the Wayback Machine.</xhtml:li>
</xhtml:ul>
<xhtml:div class="h-entry"><xhtml:img class="u-photo photo" width="50" src="https://avatars0.githubusercontent.com/u/25943?v=3&amp;u=79dd2ea1d4d8855944715d09ee4c86215027fa80&amp;s=140" alt="matthew"/> <xhtml:a class="u-url u-uid p-name" href="https://mwop.net/blog/147-Gutsy-Gibbon-review.html">Gutsy Gibbon
review</xhtml:a> was originally published <xhtml:time class="dt-published" datetime="2007-10-20T07:55:00-05:00">20 October 2007</xhtml:time> on
<xhtml:a href="https://mwop.net">https://mwop.net</xhtml:a> by <xhtml:a rel="author" class="p-author" href="https://mwop.net">Matthew Weier
O'Phinney</xhtml:a>.</xhtml:div>
</xhtml:div>
    </content>
  </entry>
</feed>
