<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: logix2</title>
    <description>The latest articles on DEV Community by logix2 (@logix2).</description>
    <link>https://dev.to/logix2</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F211633%2F4486cc88-ee4d-46cb-8797-6e9ffb3817d6.png</url>
      <title>DEV Community: logix2</title>
      <link>https://dev.to/logix2</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/logix2"/>
    <language>en</language>
    <item>
      <title>Installing Oracle Java 15 On Ubuntu / Linux Mint via PPA</title>
      <dc:creator>logix2</dc:creator>
      <pubDate>Fri, 11 Dec 2020 13:43:55 +0000</pubDate>
      <link>https://dev.to/logix2/installing-oracle-java-15-on-ubuntu-linux-mint-via-ppa-2ha8</link>
      <guid>https://dev.to/logix2/installing-oracle-java-15-on-ubuntu-linux-mint-via-ppa-2ha8</guid>
      <description>&lt;p&gt;&lt;strong&gt;If you must use &lt;a href="https://www.oracle.com/java/technologies/javase-downloads.html"&gt;Oracle Java&lt;/a&gt; on Ubuntu and Ubuntu-based Linux distributions (Linux Mint, Zorin OS, Pop OS, etc.), and can't use something like OpenJDK, here's how to install it easily, set it as the default Java version, and set the &lt;code&gt;JAVA_HOME&lt;/code&gt; environment variable, among others.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Oracle does provide its JDK in a DEB package, but it's useless. All the DEB does is copy the files to &lt;code&gt;/usr/lib/jvm&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Using this PPA, maintained by &lt;a href="https://www.linuxuprising.com/2020/09/how-to-install-oracle-java-15-on-ubuntu.html"&gt;Linux Uprising&lt;/a&gt;, you can make Oracle Java 15 the default Java version on your system (which also exports &lt;code&gt;JAVA_HOME&lt;/code&gt;), associate .jar files with Oracle JDK, have applications menu entries (and context menu entries in the file manager) for the various tools available in the JDK, tweaks the Java fonts, installs Java man pages, and more.&lt;/p&gt;

&lt;p&gt;The PPA packages don't have any Oracle Java binaries, as that's not allowed by the Oracle Java license. Instead, the package automatically downloads Oracle Java and sets up everything for you.&lt;/p&gt;

&lt;p&gt;Add the PPA and install Oracle Java 15 on Ubuntu and Ubuntu-based Linux distributions using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo add-apt-repository ppa:linuxuprising/java
sudo apt update
sudo apt install oracle-java15-installer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Ubuntu-based Linux distributions that automatically install recommended dependencies, Oracle Java 15 will be made the default Java on the system when installing &lt;code&gt;oracle-java15-installer&lt;/code&gt;. If you don't want it to be default, remove the automatically installed recommended dependency &lt;code&gt;oracle-java15-set-default&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt remove oracle-java15-set-default
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or, if your Ubuntu-based Linux distribution doesn't automatically install recommended packages (Linux Mint used to do this), and you want to make Oracle JDK 15 default, install this package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install oracle-java15-set-default
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>How To Get Dark GNOME Shell Menus And Dialogs On Ubuntu 20.04 Focal Fossa With Yaru Theme</title>
      <dc:creator>logix2</dc:creator>
      <pubDate>Wed, 29 Apr 2020 12:05:30 +0000</pubDate>
      <link>https://dev.to/logix2/how-to-get-dark-gnome-shell-menus-and-dialogs-on-ubuntu-20-04-focal-fossa-with-yaru-theme-451p</link>
      <guid>https://dev.to/logix2/how-to-get-dark-gnome-shell-menus-and-dialogs-on-ubuntu-20-04-focal-fossa-with-yaru-theme-451p</guid>
      <description>&lt;p&gt;Ubuntu 20.04 uses a mixed light and dark GTK theme by default (Yaru), with light and dark alternatives available in &lt;code&gt;Settings -&amp;gt; Appearance&lt;/code&gt;. The default GNOME Shell theme (the menus used for the top panel and Ubuntu Dock, and system dialogs) is light / white by default, and stays that way even when changing the GTK theme to Yaru-dark.&lt;/p&gt;

&lt;p&gt;One of the first things I did after installing Ubuntu 20.04 was to change this GNOME Shell theme to its dark variant, and in this post I'll show you how to do it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;About that. In case you want to see a list of top things to do after installing Ubuntu 20.04 LTS Focal Fossa, check out &lt;a href="https://www.linuxuprising.com/2020/04/top-things-to-do-after-installing.html"&gt;this&lt;/a&gt; article. It has information on how to tweak the Ubuntu Dock, how to change the GTK/Shell theme based on the Night Light schedule (so the theme changes to dark too when switching to night mode), fix the ugly default style of Qt5 applications under GNOME Shell, how to enable flatpak and install flatpak apps using the Software tool, and much more.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Changing the GNOME Shell theme is a bit trickier than changing the GTK theme&lt;/strong&gt;. You'll need to install GNOME Tweaks app and the User Themes extension (part of the &lt;code&gt;gnome-shell-extensions&lt;/code&gt; package which contains the default/official GNOME Shell extensions) to be able to do that. Install these by using the command that follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install gnome-tweaks gnome-shell-extensions
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;After installing these 2 packages, restart GNOME Shell. To do that in the default Ubuntu 20.04 X11 session just press &lt;code&gt;Alt + F2&lt;/code&gt;, type &lt;code&gt;r&lt;/code&gt; and then press the &lt;code&gt;Enter&lt;/code&gt; key. If you've switched to the Wayland session, you'll need to logout and relogin.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ne5Fr7ZR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2dvfeejndq3aiofmov5a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ne5Fr7ZR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2dvfeejndq3aiofmov5a.png" alt="GNOME Tweaks Ubuntu 20.04 Yaru-dark Shell theme"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, open Tweaks and under &lt;code&gt;Extensions&lt;/code&gt; enable the &lt;code&gt;User themes&lt;/code&gt; extension. Close, and relaunch Tweaks (without this you still can't change the GNOME Shell theme), and under &lt;code&gt;Appearance&lt;/code&gt; you'll be able to change the Shell theme to Yaru-dark, as shown in the screenshot above.&lt;/p&gt;

&lt;p&gt;This is the default Ubuntu 20.04 GNOME Shell theme:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pPCmQf5r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pifvfk7s9104tze9i7uo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pPCmQf5r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pifvfk7s9104tze9i7uo.png" alt="Ubuntu 20.04 light gnome shell theme"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After making the change suggested in this article, Ubuntu 20.04 Focal Fossa will use a dark GNOME Shell theme:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1bxYMOTI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3tjb5jw11tonxxllblyk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1bxYMOTI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3tjb5jw11tonxxllblyk.png" alt="Ubuntu 20.04 dark gnome shell theme"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ubuntu</category>
    </item>
    <item>
      <title>How To Stop Automatic Updates On Ubuntu Or Debian</title>
      <dc:creator>logix2</dc:creator>
      <pubDate>Wed, 22 Jan 2020 13:55:27 +0000</pubDate>
      <link>https://dev.to/logix2/how-to-stop-automatic-updates-on-ubuntu-or-debian-2nf7</link>
      <guid>https://dev.to/logix2/how-to-stop-automatic-updates-on-ubuntu-or-debian-2nf7</guid>
      <description>&lt;p&gt;&lt;a href="[https://ubuntu.com/](https://ubuntu.com/)"&gt;Ubuntu&lt;/a&gt; installs some updates automatically, and so does &lt;a href="[https://www.debian.org/](https://www.debian.org/)"&gt;Debian&lt;/a&gt; 9+ with GNOME. This is due to unattended-upgrades being installed and enabled by default.&lt;/p&gt;

&lt;p&gt;When enabled, unattended upgrades automatically downloads and installs some important updates, and that's ok in many cases except:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;if you need to quickly shut down or reboot the system&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;when you need to install some package ASAP and you notice you can't, because an upgrade is in process&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What's more, I've noticed on multiple systems that this can cause quite frequent errors like: "Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)", which are not easy to fix, especially for new users (by the way, see &lt;a href="https://www.linuxuprising.com/2018/07/how-to-fix-could-not-get-lock.html" rel="noopener noreferrer"&gt;Linux Uprising Blog&lt;/a&gt; for a how-to on recovering from such dpkg lock errors). Sometimes this error never goes away without user intervention (probably because some upgrade failed) which is quite bad since because of this error you're not able to install or upgrade packages until you fix it.&lt;/p&gt;

&lt;p&gt;For this reason, I personally prefer to disable unattended upgrades, and just perform the upgrades myself when time permits it. &lt;strong&gt;To stop automatic updates on Ubuntu or Debian, you have two options:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1) &lt;strong&gt;Reconfigure unattended-upgrades to stop installing updates automatically&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fv3wmodvzjr05boaz4kav.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fv3wmodvzjr05boaz4kav.png" alt="disable unattended upgrades on Ubuntu"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Use this command:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    sudo dpkg-reconfigure unattended-upgrades
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This will ask you if you want to automatically download and install stable updates or not. Choose No and you're done, Debian / Ubuntu should stop installing automatic updates.&lt;/p&gt;

&lt;p&gt;2) &lt;strong&gt;Remove the unattended-upgrades package&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You also have the option of removing the unattended-upgrades package. This will stop future automatic upgrades, but do note that unattended-upgrades may be pulled in as a dependency (e.g. if it's a "recommended" dependency for some other package - Ubuntu installs these &lt;a href="https://askubuntu.com/questions/179060/how-to-not-install-recommended-and-suggested-packages" rel="noopener noreferrer"&gt;automatically&lt;/a&gt;) in the future. So while this will stop automatic upgrades, it may come back in the future.&lt;/p&gt;

&lt;p&gt;If you want to go this route, remove unattended-upgrades using:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    sudo apt remove unattended-upgrades
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>linux</category>
      <category>ubuntu</category>
    </item>
    <item>
      <title>Another Gksu Alternative For Ubuntu (Xorg)</title>
      <dc:creator>logix2</dc:creator>
      <pubDate>Tue, 13 Aug 2019 14:17:52 +0000</pubDate>
      <link>https://dev.to/logix2/another-gksu-alternative-for-ubuntu-xorg-2356</link>
      <guid>https://dev.to/logix2/another-gksu-alternative-for-ubuntu-xorg-2356</guid>
      <description>&lt;p&gt;Back when Debian and Ubuntu &lt;a href="https://jeremy.bicha.net/2018/04/18/gksu-removed-from-ubuntu/"&gt;removed the gksu package&lt;/a&gt;, which was used to allow elevating your permissions when running graphical applications, the recommendations were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  for application developers to use PolicyKit and only use elevated privileges for specific actions&lt;/li&gt;
&lt;li&gt;  for users to take advantage of the gvfs admin backend, by &lt;a href="https://www.linuxuprising.com/2018/04/gksu-removed-from-ubuntu-heres.html"&gt;using the &lt;code&gt;admin://&lt;/code&gt; prefix&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Using &lt;code&gt;admin://&lt;/code&gt; has an issue on Ubuntu though - it asks for your password twice the first time you use it during a session. This does not happen in Fedora, but it happens in both Ubuntu 18.04 and 19.04.&lt;/p&gt;

&lt;p&gt;So what's a good alternative for gksu to use on Ubuntu under its default Xorg session, which doesn't ask for the password twice? An alternative that doesn't depend on the Linux distribution or desktop environment you use (you do need PolicyKit installed), is the following command, which works with any graphical application (GUI) that you want to run with elevated permissions / as root:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS`
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The command exports your current &lt;code&gt;$DISPLAY&lt;/code&gt;, &lt;code&gt;$XAUTHORITY&lt;/code&gt; and &lt;code&gt;$DBUS_SESSION_BUS_ADDRESS&lt;/code&gt; environment variables, allowing you to run any GUI application as root (with no need of having PolicyKit files for those apps), and without asking for the password twice, like &lt;code&gt;admin://&lt;/code&gt; does on Ubuntu. &lt;/p&gt;

&lt;p&gt;To make it easier to use, since the command is quite long, you can create an alias for this command, called &lt;code&gt;gksu&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To make this &lt;code&gt;gksu&lt;/code&gt; alias for the &lt;code&gt;pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS&lt;/code&gt; command permanent, add the following to your &lt;code&gt;~/.bashrc&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alias gksu='pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You can add it to &lt;code&gt;~/.bashrc&lt;/code&gt; by issuing the following command (run this command only once since it adds this line every time you run it):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo "alias gksu='pkexec env DISPLAY=\$DISPLAY XAUTHORITY=\$XAUTHORITY DBUS_SESSION_BUS_ADDRESS=\$DBUS_SESSION_BUS_ADDRESS'" &amp;gt;&amp;gt; ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;After this, source &lt;code&gt;~/.bashrc&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;. ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now you can run this alias exactly like you'd use the old gksu command.&lt;/p&gt;

&lt;p&gt;For example, you can use it to run Gedit (replace with any other GUI text editor you wish) with elevated privileges and edit the /etc/default/grub file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gksu gedit /etc/default/grub
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Another example - run Nautilus (or some other file manager) and open the system themes folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gksu nautilus /usr/share/themes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;For more articles I've written, check out &lt;a href="https://www.linuxuprising.com/"&gt;LinuxUprising.com&lt;/a&gt;, a Linux &amp;amp; open source blog.&lt;/p&gt;

</description>
      <category>ubuntu</category>
    </item>
  </channel>
</rss>
