Category: Ubuntu

Ubuntu 18.04 Live Installation – How To Reboot

Just a quick tidbit for those who found themselves stuck at the nefarious Please remove installation medium, then reboot. message that restarting/shutting down from a Live Boot of Ubuntu 18.04 presents. I’ve seen several people mention this problem after it popped up for me after running it for a test, but I didn’t see any solution mentioned. Everyone stated that they had to hard reboot their PC by holding in the Power Button. As most will find out, pressing Enter, Esc or any other usual common keystrokes to progress will do nothing. I even tried a console command such as sudo reboot with no luck – even though the screen doesn’t technically present a terminal prompt (just trying anything at that point).

So, do I have a solution? Yep…

CTRL + C

You’ll see your screen magically go black and reboot the PC (even if you chose Shutdown from the exiting menu in the Ubuntu Live Session). The only other nuisance I’ve seen this with (and this could just be something to do with my particular setup) is that the EFI OS boot manager gets altered and sets Windows Boot Manager as the first order option on the machine after running the Live Session. Unsure if that’s something to do with Ubuntu (it happens when testing KDE neon, as well, which is Ubuntu-based) or something to do with the fact that the PC booting is managed via EFI. Some might manage to boot into Linux and reinstall Grub to get around this, but really going into the BIOS/UEFI settings when the PC boots and just rearranging the OS boot manager order in the system configuration gets things back to the way they were before. An easy fix, but just annoying that I’ve had to do this each time I’ve tested a Live Boot of Ubuntu or KDE neon (ended up installing Linux Mint 19 from the first test of the Live Session, so didn’t see if it would cause the same issue).

I do think it’s stupid that the latest LTS version of Ubuntu doesn’t provide a more straight-forward approach to this situation (the historical Remove media and press Enter. has always worked well, and is still how other distros do it), but… there ya go. At least a proper resolution does exist until Canonical sorts out the emotional storm they seem to be going through to get back to the straight and narrow.

As for a return to Gnome… I thought the desktop looked fine. I’ve never been a fan of the Ubuntu purple theme color, but Gnome seems to run as well as Unity did in my previous Ubuntu experiences. I only started using Ubuntu around the coming of 12.04, so I wasn’t familiar with the Gnome 2 Ubuntu of past times. For what it was, Unity seemed fine to me. The only thing that pushed me away from using Ubuntu was Canonical’s more commercial minded moves to forcing Amazon, tracking and profiting off of dash searches and the such. Even if there were ways to get around it all, the problem is that Canonical wanted to force those practices onto its users in the first place. I’ll compare it with phpBB’s attempt to fund itself by profiting from video embeds in newer versions of their software. The difference, however, is that phpBB lets you know that this is something that they would like for you to do upon installing the software on your website, and provide appropriate (and simple) means of opting out of doing so. Like Canonical, the developers of phpBB provide their product as free-to-use, but gain some profits from services related to the product. However, where it seems to stand out to me (and this is from the layman point of view) is that they are being fairly transparent about their practices to attempt funding their work from your use of their otherwise completely free product. Canonical, instead, went about it in a way that seemed to imply that they didn’t want the user to know it was happening. I know this is a dead-horse subject that was beaten to that point several years ago, but that is ultimately why I ditched Ubuntu for other distros – even ones that link back to Ubuntu as a base. Up until recently, I’ve been happy using Linux Mint – and with the discontinuation of their KDE option, I’ll likely also be looking to KDE neon. With alternatives such as these available to me, I’d be quite surprised if I ever install Ubuntu on anything I own as a day-to-day use OS ever again.

ReadyShare USB Storage via NETGEAR Router in Ubuntu

Okay. Maybe I’m missing something here, but I was confused about how to access an external USB drive that I decided to connect to my NETGEAR router and use as for shared network storage in my house. All searched online led to explanations of using fstab to mount the drive and map it to a location such as /media/network, which I instantly thought seemed like too much work for the simple ability of accessing a USB drive connected through the router. After all, finding such a drive is as easy as viewing Network locations in Windows, and I refused to believe that it could be any harder in Linux.

Apparently, I was right. I would have manually entered the location that I expected the drive to be in the file manager, but I don’t have an address bar that I can manually enter locations into (or I haven’t configured Nautilus to show on if it’s capable of doing so). But, as soon as I opened Nautilus and looked in the left-pane displaying locations such as Locations, Devices, Bookmarks and Network, I saw a hint as to what I was looking for: Browse Network.

As soon as I select Browse Network, I see exactly what I’m looking for. Two options, among several others, listed as READYSHARE and readyshare(for Time Machine). Both lead to the same place, a location listing USB_Storage, which was exactly what I needed. Clicking on USB_Storage reveals the contents of my USB drive that I have connected to the router’s USB port. Just to be sure I could, I created a new text file on the drive and saved a small string of text into it to make sure I would be able to alter the drive in some way from my Ubuntu PC. Everything worked as expected.

So, I really don’t know the benefit of following other explanations of accessing and manipulating storage devices in Ubuntu that are connected to NETGEAR’s ReadyShare port, but this way worked fine for me.

Install Oracle Java 8 in Ubuntu with Updates via PPA

Thanks to WebUpd8, you can install the most up-to-date JDK and JRE directly from Oracle, as opposed to using OpenJDK which is the default in the Ubuntu repositories. As far as I know, this should work for any *buntu OSes, including Linux Mint and elementaryOS. They should also get updates automatically via the Update Manager while they are within the support window for the OS version you’re using.

I know this isn’t exactly news, and WebUpd8 posted this information over two years ago now, but I was shocked to find out about it myself just recently, and figured I’d just go ahead and post it on my blog for anyone else who happens across it without knowing as well.

Here are the steps, all together, for adding the PPA and installing Java 8 (currently update 40). I also included an additional step to remove all remnants of the OpenJDK package. I’m uncertain if the presence of OpenJDK would cause any problems, but I figured its not needed and so worth it to clear up an easy ~50-100MB of space anyway.

sudo apt-get purge openjdk*
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default

The PPA is hosted at this location on Launchpad. As you will see if you visit the page, WebUpd8 doesn’t actually maintain any Java binary packages for on the PPA. Instead, it simply hosts the installers that pull the packages from Oracle’s own servers. An alternative might be to manually download and install the software from Oracle, but you would have to manually update it every time Oracle pushes out a new version. With this PPA, you will get updates for it automatically through the Update Manager for as long as your OS is within its support window.

If you prefer to use version 7 instead, you can issue the following commands to install the JDK and JRE packages installer for version and alternate the versions used.

sudo apt-get install oracle-java7-installer
sudo update-java-alternatives -s java-7-oracle

Then just use the following command to return to version 8, if you decide to.

sudo update-java-alternatives -s java-8-oracle

BIND Authoritative-Only DNS Server on Ubuntu Server 14.04 or Debian 7

This post will explain how to get a DNS server setup going on Ubuntu Server 14.04 or Debian 7 using BIND. The arrangement assumes the following:

  • You’re using a master/slave configuration.
  • Your server host provides the rDNS for you. Most VPS hosting services handle the rDNS, so you’re not required to configure it on your own DNS server.
  • Your hostnames for the servers have been configured as fully qualified domain names.

For the example, the master server will be located at ns1.mydomain.com with an IP address of 10.0.0.1 and the slave server will be located at ns2.mydomain.com with an IP address of 10.0.0.2. Our test domain that is being handled by the DNS servers will be testdomain.com and will be configured to point to the same IP address as the master DNS, which is where we would assume the web server servicing the domain will be located.

For the commands shown in the explanations, it’s assumed that you’re logged in or acting as the root user. If not, you need to precede the commands with sudo, this includes when opening configuration files for editing. You’ll get a permissions error when you try to save the file if you don’t.

Installation

Start by installing BIND on both servers:

apt-get update
apt-get install bind9 bind9utils bind9-doc

If you’re notified that the file /etc/init.d/bind9 already exists on the server, and asked what you would like to do about it, respond with Y or I to install the version that is included with the package.

Configuration

Once the installation is complete, you already have a DNS server running on your Ubuntu installation. We only have to make some configuration changes to ensure master and slave servers are communicating with each other and that the master has been configured with the zone information for the domains being serviced by the DNS servers.

First, open /etc/bind/named.conf.options for editing. You should have something like the following:

options {
        directory "/var/cache/bind";

        // If there is a firewall between you and nameservers you want
        // to talk to, you may need to fix the firewall to allow multiple
        // ports to talk.  See http://www.kb.cert.org/vuls/id/800113

        // If your ISP provided one or more IP addresses for stable
        // nameservers, you probably want to use them as forwarders.
        // Uncomment the following block, and insert the addresses replacing
        // the all-0's placeholder.

        // forwarders {
        //      0.0.0.0;
        // };

        //========================================================================
        // If BIND logs error messages about the root key being expired,
        // you will need to update your keys.  See https://www.isc.org/bind-keys
        //========================================================================
        dnssec-validation auto;

        auth-nxdomain no;    # conform to RFC1035
        listen-on-v6 { any; };
};

We need to add the following two lines anywhere within the brackets defining the options block:

recursion no;
allow-transfer { none; };

Example with added lines:

options {
        directory "/var/cache/bind";

        recursion no;
        allow-transfer { none; };

        // If there is a firewall between you and nameservers you want
        // to talk to, you may need to fix the firewall to allow multiple
        // ports to talk.  See http://www.kb.cert.org/vuls/id/800113

        // If your ISP provided one or more IP addresses for stable
        // nameservers, you probably want to use them as forwarders.
        // Uncomment the following block, and insert the addresses replacing
        // the all-0's placeholder.

        // forwarders {
        //      0.0.0.0;
        // };

        //========================================================================
        // If BIND logs error messages about the root key being expired,
        // you will need to update your keys.  See https://www.isc.org/bind-keys
        //========================================================================
        dnssec-validation auto;

        auth-nxdomain no;    # conform to RFC1035
        listen-on-v6 { any; };
};

Save the changes and close the file.

Next, we need to configure the local file to point to the zone files for the domains that will be serviced by the DNS servers. Assuming that we’re servicing a domain called testdomain.com, open /etc/bind/named.conf.local and add the following – as designated for master and slave configurations:

Master

zone "testdomain.com" {
        type master; also-notify { 10.0.0.2; };
        file "/etc/bind/zones/db.testdomain.com";
};

Slave

zone "testdomain.com" {
        type slave; masters { 10.0.0.1; };
        file "/etc/bind/zones/db.testdomain.com";
};

Since the zone block within the local file is pointing to a sub-directory within BIND’s primary directory to house the zone files, we need to create the zones directory and change its owner to the bind user. This needs to be done for both the master and slave servers:

mkdir /etc/bind/zones
chown bind: /etc/bind/zones

Now, you can create the zone file for the domain. For the example, we called the file db.testdomain.com, and configured BIND to look for the file in the /etc/bind/zones directory.

An example of our zone file would look like:

$ORIGIN testdomain.com.
$TTL 1800
@       IN      SOA     ns1.mydomain.com.       admin.testdomain.com. (
                        2015010101              ; serial number
                        3600                    ; refresh
                        900                     ; retry
                        1209600                 ; expire
                        1800                    ; ttl
                        )
; Name servers
                    IN      NS      ns1.mydomain.com.	; master DNS
                    IN      NS      ns2.mydomain.com.	; slave DNS

; A records for name servers
ns1                 IN      A       10.0.0.1		; master DNS IP
ns2                 IN      A       10.0.0.2		; slave DNS IP

; Additional A records
@                   IN      A       10.0.0.1		; www IP

; CNAME records
www                 IN      CNAME   testdomain.com.	; www IP

The settings above are fairly straightforward for configuring a zone with NS records and records to point to a web server for serving pages. Just be aware that the value for serial needs to be changed every time the zone file is updated, otherwise the DNS server will not update other servers. For the appended www, you could include an A record that points to the web server’s IP address, just like the origin does, but I believe it is more appropriate to point it to the origin with a CNAME record, as I updated this example to do. Feel free to correct me if you know better.

Check Configurations

At this point, all configuration is done. You simply need to check the configuration and zone files for errors, and then restart the servers.

You can check the local configuration by issuing:

named-checkconf /etc/bind/named.conf.local

If it returns nothing (line-breaks directly back to the command prompt), then everything checked good.

You can then check the zone configuration with (on the master server):

named-checkzone testdomain.com /etc/bind/zones/db.testdomain.com

If all checked well, it should return something like:

zone testdomain.com/IN: loaded serial 2015010101
OK

Now, simply restart the two servers.

service bind9 restart

After waiting for the configurations to propogate (varies in time – could be over 24 hours), you can pull up a prompt on your local linux machine and issue the following to see if the DNS has updated the domain to point to your master DNS server’s IP address:

nslookup testdomain.com

A successful setup should return something similar to:

Non-authoritative answer:
Name:	testdomain.com
Address: 10.0.0.1

An unsuccessful setup would return something more like this:

** server can't find testdomain.com: SERVFAIL

If you get an error, it could be that you didn’t give the servers enough time to update the information for the domains. Either way, you can view the system log on the servers to see if there are any errors:

tail -f /var/log/syslog

Look for the following to indicate successful zone information loading and communication between master and slave servers:

named[4215]: zone testdomain.com/IN: loaded serial 2015010101
named[4215]: zone testdomain.com/IN: sending notifies (serial 2015010101)

Anything else, pertaining specifically to the domain you configured, might indicate there is a problem with either the zone file or that the master and slave are not communicating. Ensure your firewall is allowing traffic on port 53.

Ubuntu Software Center: ‘Available from the “main” source’

For anyone who comes across this problem, which I did tonight on my laptop, you may want to first try closing Software Center and re-opening it. Several suggestions on askubuntu.com and other results from searches online mentioned removing entries from the source lists and so forth. As I said, just closing and re-opening solved the problem where it happened to me. I’m not going to assume this is something new, as people asking about it on those sites when I searched it were experiencing it with 12.04. I never experienced it in 12.04 and have only experienced it once so far on one machine running 14.04.

What occurred was when clicking on an application in the Software Center I was shown no reviews or info for the application, but instead only the message Available from the “main” source with a button saying Use This Source where Install would normally be.

LibreOffice (Latest Version) Installation for Ubuntu, Linux Mint and elementaryOS

This is somewhat of a follow-up post to a previous post regarding updating LibreOffice for Ubuntu and Ubuntu-based OS.

Because each version of Ubuntu and any OS based on it usually pulls from a specific repository where software that has been deemed stable for that version is stored, getting the latest version of a particular software can be impossible without some configurations. Having used both Ubuntu and Linux Mint, and successfully installed and updated LibreOffice using the LibreOffice PPA, I thought the same could be done for elementaryOS, which is also based on Ubuntu (the latest version, Luna, being specifically based on Ubuntu 12.04 Precise Pangolin).

However, after installing eOS and installing LibreOffice from the default repository, I then added the LibreOffice PPA and found that it caused some issues with the Update Manager in eOS. Not only would it not allow me to update to the latest version of LibreOffice, but it even seemed to interfere with eOS being able to get other updates. I couldn’t even alter the settings in the Update Manager. After removing the LibreOffice PPA from the software sources, all problems seemed to vanish with non-LibreOffice updates. The biggest problem for me at that particular moment, however, was that I couldn’t get LibreOffice updated. A few sites mentioned compiling LibreOffice source to install the latest version, which I didn’t care to do (updating was not that big of a deal for me, if compiling the source was my only option), and so I came across someone else who mentioned following the same steps I had done before, yet adding the PPA before installing the software. So, I followed the necessary steps to completely remove LibreOffice (credit to an answer on askubuntu.com).

sudo apt-get remove --purge libreoffice*
sudo apt-get clean
sudo apt-get autoremove

And then I removed the PPA by opening Update Manager, going to Settings… at the bottom-left, going to the Software Sources tab and removing it from the list. After, I simply re-added the PPA and reinstalled the software back onto the computer using the terminal.

sudo apt-add-repository ppa:libreoffice/ppa
sudo apt-get install libreoffice

I open LibreOffice and find the latest version (4.1.4.2 as of writing this post) installed.

As far as complications with updating the software further, or interfering with other updates, I can’t say. I had already ran all other updates before reinstalling LibreOffice, and so the system is showing up-to-date. I will post a comment if I see the PPA in the sources list causing any other problems, or not updating LibreOffice beyond 4.1.4.2.

There are also some articles posted on elementaryupdates.com regarding ways to configure LibreOffice and other applications to fit more into the eOS appearance, in case anyone is interested.

Update 2015.08.31

On Linux Mint 17.2, I’ve realized that there is one additional step required in addition to what I had mentioned above to update to the latest version of LibreOffice (5.0.1 as I’m writing this). You have to set the priority for the package so that Mint’s update system will allow it to be updated/installed from the PPA. To do that, you need to create the file /etc/apt/preferences.d/libreoffice.pref and place the following inside of it:

Package: *
Pin: release o=LP-PPA-libreoffice
Pin-Priority: 700

This information was taken from the Mint here.

Windows RDP and Remmina: “Unable to connect to RDP server”

If you’ve been using Remmina to RDP to a Windows machine for some time and then all of suddenly find yourself running into the error Unable to connect to RDP server <address>, take a minute to read my experience before you go through some possibly-unnecessary steps.

I occasionally reboot my modem and router, and after doing so tonight, I found I was unable to RDP into a machine running Windows 7 Ultimate on my LAN from Remmina. I immediately checked to see if I could RDP to a Windows Server machine on the same LAN from the same Remmina client and could. So, I ruled out Remmina being the problem – or so I thought.

My next check was at the network. I figured that maybe the machine was either not connected to the network or had been assigned a different IP. So I then connected a monitor the machine and checked via ipconfig to verify that the IP address was the same. I still decided to reboot my router again.

Next, I checked and rechecked the RDP settings on the Windows machine to ensure that RDP was enabled. Everything looked fine on that end, so I moved to the firewall settings. The firewall was set to allow access to RDP on the machine.

Next, I went to the net for support. I searched “unable to RDP into Windows” and naturally found lots of various explanations and solutions. Knowing that I have VirtualBox setup on the computer with network drivers installed, I decided to narrow my search to include that. That’s when I found explanations regarding issues caused by the Host-Only virtual network connection that Windows sees as an “unidentifiable” network connection type. Having had issues with this limiting my network access on a computer in the past due to Windows taking precautions in thinking it is connected to an insecure network, I jumped at several solutions that involved registry edits to tell Windows that the network connection was virtual and host-only – and that it terminated at the machine itself. Re-enabled the driver and found problem was not resolved.

I then decided to boot into Windows on my laptop and see if Windows’ own RDP client could connect to the machine. It did, but the connection seemed sluggish. I then became suspicious that either the network or the machine’s NIC were somehow at fault – which didn’t rule out in my mind that the connection on the machine created by VirtualBox could be to blame as well. I then went into the Network and Sharing settings on the machine and disabled the connection. Rebooted the machine and found myself facing the same problem.

Finally, I wisened up and searched for help: “unable to connecto to Windows RDP using Remmina” and found the solution to my problem. Again, there were several suggested solutions, but I did find the one that worked for me. One solution suggested changing the Advanced > Security value in the connection’s profile in Remmina to RDP. This not only didn’t fix my problem, but caused additional problems with connecting to the machine.

The solution, surprising enough, was as simple as removing an entry in a file. I simply opened .~./freerdp/known_hosts and removed the line that corresponded to the host. I restarted Remmina and tried to connect, getting prompted to accept the host’s key, and was happily connected. Was a little agitated that I spent so much time and work trying to resolve a problem that was so easily fixed, but happy to again have the ability to RDP into my machine.

Ubuntu Unity Dash: Removing Links

There are occasions when applications that have been removed have stale links left behind in the Unity Dash. Though it is harmless, it is annoying to see them popup as results to searches in the dash when they are useless – creating a problem by taking up search results that could lead to what you’re searching for more quickly.

Removing them is fairly simple, but it can be easy to forget if you haven’t done it before – or at least not for a while.

Most of the links in the Unity Dash are stored in the /share/applications folder. However, depending on if the application was installed for just one user or for all users determines which folder the links are stored at. If the application was installed on the system for all users, you will have to use root access to remove them from the /usr/share/applications directory. If they were installed by a user strictly for that user, they will be in the .local/share/applications directory within that user’s home.

Make sure you empty your Trash after you delete the links. They will not be removed from the Dash until you do.

Ubuntu: Creating non-buntu Startup Disks

I ran into this problem while trying to create a startup disk for OpenSUSE in Ubuntu using the included Startup Disk Creator. I noticed that only Ubuntu and Ubuntu-based isos were being listed in the program, and even when browsing to the other isos, I found that clicking to open them in the program did nothing.

After some brief searching, I came across the following thread in Ubuntu Forums. The second post within the thread was extremely helpful to me, and following its instructions led to a successful bootable USB drive with which I was able to test OpenSUSE. On top of that, I learned from the post that the Startup Disk Creator software included in Ubuntu is actually limited to only Ubuntu-based isos.

So, I thought it would be worthwhile to repost the command here on my blog for both my own records and for anyone else who might not have managed to come across the use of dd to create bootable disks in Ubuntu. From what I understand, it should work for just about any type of bootable disk. However, I can only testify that it worked for the OpenSUSE disk from my own experience so far. As always, make sure you are certain of what you’re inputting when working with CLI, and this command could cause some serious pain in terms of data loss if you accidentally designated the wrong location.

sudo dd if=/path-to-iso of=/dev/sdX bs=4096

The command should be fairly straight-forward. The if argument should be the full path that points to the location of the iso. The of argument should be the device that is being written to as the startup disk. That’s probably obvious, but I felt it was necessary to clarify just in case. I’m assuming that bs is referring to the boot sector location of the device being written to, but that is purely speculation on my part and the value was simply left as-is when I used this method of creating the boot disk.

You can also use the mount  command to list all mounted devices currently connected to your computer. If you know the name of the device (which you can see by hovering over the USB drive’s icon on the Unity launcher) you can then look through the list of devices displayed from mount  and find what device it is so that you supply the right value for the of argument when using dd. A more graphical method would be to open the Disk Utility and find the USB drive listed in the left pane. Clicking on it will then display the device information in the right pane, including where the device is mounted.

I’ve been meaning to create a Windows boot disk using this, to at least see if it would work. I need to re-install Windows on a laptop that doesn’t have a disc drive built into it, and the USB method seems my best option. I’ll add a comment or update the post with the results once I run it.

Ubuntu / Linux Mint: Adding the LibreOffice PPA

If you’re using a previous version of Ubuntu or Linux Mint, such as 12.04 or 13 (the last LTS releases), then you’re probably using an old LibreOffice suite – at least if you choose to use LibreOffice. I believe version 3.6 is in the 12.04 repositories – which I also believe is what is used by Linux Mint 13. There’s nothing wrong with LibreOffice 3.6, but there’s also nothing wrong with wanting the latest and greatest, and 3.6 is quite a few releases behind the current LibreOffice update.

Luckily, whether you wish to re-install LibreOffice or simply update the installation that comes pre-packaged with Ubuntu / Linux Mint, getting the latest version is easy as one command line in terminal.

Simply add the LibreOffice PPA:

sudo add-apt-repository ppa:libreoffice/ppa

You will also want to update the package index:

sudo apt-get update

After this is done, simply load up the Update Manager for whichever OS you’re running, click Check and you’ll find updates listed for LibreOffice. Ubuntu typically prompts to run a partial upgrade, which is fine. I didn’t see this in Linux Mint.

If you’ve removed LibreOffice and need to install from the PPA after you’ve added it, simply submit the following command:

sudo apt-get install libreoffice

That’s it. Whether you upgrading or doing a fresh install, you’ll have the latest release of LibreOffice, along with continuous updates to the application through your Update Manager.