Showing posts with label #LinuxArticle. Show all posts
Showing posts with label #LinuxArticle. Show all posts

Sunday, May 24, 2020

My Linux Journey

It started out innocent enough. Back around 2003 or 04, I ended up with an old laptop that I had no use for. I’d been interested in Linux, so I decided to obtain the installation files for Debian and install it on this laptop. This all happened prior to getting a cable modem; it would have probably taken a week to download them using my modem. So I paid to obtain the disks for the cost of the CDs and shipping. They arrived one day, and I attempted an install. After some time, I finished the install, and I was staring at a command line. The little cursor blinked at me, or was that a sarcastic wink?

It’s not that I was unfamiliar with working from a command line. I learned my chops first on a DCL machine (that’s Digital Command Language) back in the 80s, and after that, on MSDos. I reluctantly bought in 1994, a laptop with Windows 3.11; I was so reluctant to give up my command line, familiar as I was with typing a program’s name into the terminal to run it. Of course, I grew to love Windows, in a love/hate sort of way, and became an “expert” in that interface even as I had in MSDos.

But this wasn’t MSDos. Only one or two of the commands I recalled from my MSDos days appeared to work in this alien world. So I started the process of figuring how to access the help pages and began the task of learning a new system. However, I didn’t get very far. I tried to install X-windows, a graphical “windows manager” (which I now know is not the same thing as a complete desktop environment). All I ever did back then was to see a big “X” across the screen. No menu, no buttons, nothing. Then, as fate would have it, I did something that trapped me in the X-window. I couldn’t use the command line nor do anything. Even reboots would log me back onto the giant X window. I finally gave up.

Ironically, these last two days I’ve been testing out installing the “Vanilla” Debian first in VirtualBox, then on my living room backup laptop, which I had before I received my current one—about a month before we moved to Colorado in 2018. I’ve successfully installed it, though it has a long install process compared to your average Linux distro.

It ended up crashing it in Virtualbox. But not before I learned enough that I was ready to install it onto my living room laptop. So I did, and it is now up and running. It has progressed a lot since the early 2000s. For instance, when a newbie like myself starts tinkering with attempting to pull together a desktop environment, not knowing that was what I needed, I was lost, alone, and clueless about what direction I needed to go. But, the Debian I installed lately had several desktop environments that I could use. So, I picked my favorite so far—Cinnamon--and when it was finally done, I booted up into a fully functional graphical interface that I was already familiar with along with a system that I only had to make about two or three tweaks to obtain a fully functional system.

“Tweaks to obtain a fully functional system? What?”

Yep, you heard right. And my experience probably only will go to show why installing a system like Debian is a bigger task than Linux Mint, especially for someone who is unfamiliar with how Linux works. I, on the other hand, have been using Linux by this point for 9 years. I realized it had been that long when Facebook offered up one of those “Remember When” post for me to share with everyone (which I didn’t share; you can thank me later) that was 9 years old, and wanted me to share a post I had done on my experience of getting a fully functional Linux system up for the first time that had become my default operating system I used on a regular basis. I kept a dual boot into Windows to run QuickBooks, which doesn’t play very well, even using Wine. I’ll give you one example of what I had to do, right out of the box.

Once the install on Debian was done, I started to work on setting up the ssh server. Ssh is a way for a user using a computer, to log in and work on another computer. One can open it up to the Internet, but in my case, I only needed to go over the network. At any rate, one of the first task in setting up an ssh server is adding a user to the new system that will give me the ability to log in from the other computer. I like to use the adduser command. So, I typed in the command, followed by my user name and group. Well, Debian couldn’t appear to locate the command. I thought “What? How could the system be missing such a foundational command?” It didn’t make any sense. I tried useradd, with the same results.

So after a bit of exploring, I attempted to install the adduser command. It said it was already installed. “Ahhhh!” the problem appeared solved, to a degree. Because Linux has at least one similarity with Windows, the PATH variable. It does the same thing as it does in Windows as well, which is to tell the system where to look for executable programs that you want to run, no matter where you initiate them from in the directory structure. So I went to Google and did a search on what directory adduser would be found in (it was in the /usr/sbin directory). Then I printed out the PATH variable, and sure enough it wasn’t there. So, all I had to do was to include it in the PATH directory, and all would be right in the Debian world, right! Well, sort of, in that even that task became something of a problem.

You see, in Windows, there is one file that the path command goes in. The commands for it are very similar. In windows, it is:

PATH=%PATH%;C:\\directory to add to the path statement

Pre-XP, to make it permanent, one would add it to the “autoexec.bat” file, a file Windows would run every time the system booted up. XP and those that followed, it was added to the advanced system under “Environmental Variables” graphically. So, in Windows, for any one version, there was only one file or place you had to edit to add a directory to the PATH variable and have it stick from session to session.

Not so in Linux. First you have several spots you could add it to for the individual user (at least 3 files), or several spots (at least 4 files) for every user. Now, these are easy enough to find upon searching on the internet, as I did. However, whether it was due to it being entered in at the wrong time so that it was overwritten, or the system ignored each file that I put the path statement in, for whatever reason, None of them worked. I believe I tried every file I could find to put my path statement in, which was:

Export PATH=$Path:/usr/sbin

The export command is the part unique to Linux, but it shouldn’t always be used, as I soon discovered. One of the system-wide files I entered this command into was located in the file: /etc/profiles. Once I entered the command in and rebooted, it booted up as far as the login screen. I entered my password, and it went away, only to have the login reappear. So, figuring I must have entered the password in wrong, I entered it again only to have it do the same thing. I must have entered my password in 5-7 times, the last couple of times carefully entering in my password. It still came back. I had to come to one conclusion: that the file required the path statement without the export command. Why? I don’t know. That’s just the way it is.

Now, I could have just deleted the system off of Virtualbox. It was, after all, just a test. However, I wasn’t ready to give up on it, just yet. I had to figure out a way to get into the system, edit that file, and take the “export” part out. After doing a few searches on the internet, the only solution I had found was a cryptic editing of the kernel, by adding a -l on the end of it, that would allow me to bypass the login screen. However, when I reached the point of adding that to the kernel file, it didn’t quite look the same. I was unsure where to put the -l and I said to myself, “There has to be an easier way to do this. Editing the load kernel command was too deep and crazy way to do this.” And, behold! There was an easier, more user friendly way to accomplish this.

I sort of stumbled upon it, though it is probably common knowledge among experienced Linux users. Once the grub boot menu appeared, I selected the “Advanced” option of the operating system. Then I opted for the recovery/command line to go into root. I was in! I edited the “export” off the file, saved it, then rebooted. I went into the login screen and upon entering the password, I stood on the pathway to success! All was well, once again, in the Debian world.

Sort of, because when I checked the PATH variable, it still didn’t show the sbin directory under the usr directory. So I was back to square one. I checked the websites once again, and there was one file I had yet to try: bashrc in the HOME directory. However, the preferred way to add any changes to that file was to enter them in a different file, under a different directory, and include them in the bashrc file. I knew the system processed this file too, because I had already done this with some aliases I had set up. Aliases like twifi, which ran the command:

bash /home/rick/MyScripts/ToggleWiFi.sh

To turn on and off my wifi. All I would have to do in a terminal window to run that would be to enter twifi.

I started to edit the .bashrc file to have it include a different file, when it dawned upon me that the first system upgrade would replaced that file, then I would have to add those lines back in. Though it was sort of like cheating, I knew the .bash_aliases file would to included by default in any new file. So I edited that file to add to the path the desired directories. Once I had saved it, rebooted, and checked the path statement. I held my hands up in a victory shout as the desired directories were in the PATH variable, finally!

That is just one example of my “tweaks” I did to get a more fully functional system. I do have to say, that a major Linux distribution upon which Ubuntu (and several others that are based off of Ubuntu) as well as a smattering of others, who has been around for this long, could have such a simple-to-fix-bug in it. This is exactly the kind of experience that keeps Windows users from moving to Linux. But be assured, Windows user, that distributions such as Ubuntu and Linux Mint don’t have this problem. They generally work like you would expect them too. I’d point any Linux newbie to install one of those distros as your first one. But in Debian’s favor, it has come a long way toward being more user friendly than when I installed it almost 20 years ago.

But between my first attempt at installing Debian and the last successful attempt to install it on my backup laptop—an Acer Aspire—I’ve installed several different distributions on the old laptop. All of the distros, a small handful requiring some tweaking, have been successful installs. I’ve used them for various lengths of time. Most all of them picked up my Brother network printer without a hitch, which for my previous experience is very, very good. In the past, I’ve had to fiddle with the drivers and various settings before I could get it to work.

My first working Linux distro (short for distribution) was Lubuntu using the LXDE desktop environment. I used it on a test laptop that was “resource challenged” before being confident that I could install it on my main laptop. I worked on and off for over 4 or 5 months of setting it up just the way I liked it. This is when I made that Facebook post 9 years ago. I stuck with that OS (operating system) for quite some time before trying other distros. From there I installed Xubuntu (uses the Xfce desktop environment) on my main computer. Then a few months ago, back around Aug. 2018, I ordered a new computer, an HP Laptop with 2 T of HD space. It had Windows 10 installed on it. Up until then, I had a dual-boot system, MS Windows 8 and Xubuntu on my Aspire. With this computer, however, I decided to go totally Linux, something I could do since I no longer needed to use Quickbooks. More on that in a future post. And, I decided to go with a totally new distro, Linux Mint. I was impressed with Mint’s Cinnamon desktop, which I fell in love with. Mainly because of both the slick looking interface and the flexible and intuitive structure of the settings menus. In short, it simply works as a desktop environment.

I also need to back up a bit to describe my Linux HD transplant. My son had bought, some years ago, a new Asus laptop. After a period of use, his hard drive crashed and he was ready to throw it away. I told him to hold on, I would take it. I figured I would get a hard drive for it and I would have a new computer. But, I promptly forgot all about it. Then, a few years later I discovered Lubuntu, a version of Ubuntu that used the memory efficient LXDE desktop environment. While I was on it, I accidentally spilled some coffee on the keyboard, effectively causing the keyboard to be near usable. My immediate solution was to go and get a usb keyboard, and I continued using the computer that way.

Meanwhile, I came across my son’s old Asus laptop. It had been long enough that I forgot what was even wrong with it. An attempt to boot up failed, reminding me that it was the hard drive’s boot blocks on the disk that caused the issue. So I did a search on Amazon for hard drives, and discovered a 1 terabyte drive I could obtain for a reasonable price, so I bought it, and I installed Lubutu on it successfully. Once I had it up and running, I liked using it better than my old Acer computer. So after transferring my files over to the Asus laptop, it became my primary laptop that I used day in and day out. That is, until another cup of coffee, or it may have been sweet tea, was dumped over the keyboard, yet again. This time, it totally made the keyboard unusable as well as affecting the computer itself. I could use the external keyboard, but it became difficult to get around to the point that it was an unusable computer.

Problem was, I didn’t have enough money to buy a new computer. All I had was my Acer Aspire computer to fall back on. The problem with that was my current files and work was on the hard drive now trapped inside an unusable computer. What to do?

Then I had an idea, though I didn’t know if it was even possible at the time. So I did a search on the Internet to find out if it was possible to move a hard drive, and transplant it into a different laptop, and have it work. I expected to find a big negative to that question, but to my surprise I discovered that it was indeed possible. However, in my case, since I was moving from a “Legacy” computer to an EFI booting computer, that I would need to go in and adjust the partitions on the drive to make space to create an EFI partition. Naturally I found this out after I attempted to simply move the HD over to the new computer and it failed to boot. I was successful in reducing the size of the main partition, and creating an EFI partition, and installing the boot software to it, that when I plugged it in the next time, I saw my old system’s login, and after a little checking, I could access all my files. I hadn’t lost one of them. I breathed a big sigh of relief.

For the record, just know that this is something that cannot be done if I still had a Windows system. They link their OS to the computer it comes with. You take that HD out and stick in another computer, you’ll have two broken systems. I was a wee bit proud that I had successfully navigated the “Linux rapids” and had pulled off such a major operation that when I turned on the computer and it began booting up into my familiar system, I said, “It lives! It LIVES!!! Haaaaaa, ha, ha, ha, ha!”

Of course, I was back to using my old computer which required me to use an external keyboard. But hey, at least I was operational again, except this time with a full terabyte HD. So I used it until I had the money for a new computer which happened in the summer of 2018. By that time, I had installed Xubuntu on my old Acer Aspire and had been using it for a few months. So when I bought this HP laptop, that I am currently using, I decided I would move the pre-installed Windows 10 from a dual boot situation and install it in VirtualBox once I had my new Linux system up and running.

I also decided I would install a completely new distro, and I decided to first try Linux Mint. After installing that distro, I immediately fell in love with it. It simply worked out of the box, and it was fairly intuitive. I’ll probably do a post on why I like Linux Mint and why I recommend it to Linux newbies in a later post. I’ve also installed and used briefly the following Linux distros, in no particular order: Linux Mint Debian (this is a version of Linux Mint based on Debian instead of Ubuntu, which the standard one is based on Ubuntu), PCLinusOS with the MATE DE (desktop environment), POP OS, Ubuntu Studio (current installed as a dual boot on my main computer)Ubuntu Bungee, Zorin OS, Manjaro (this is the only Arch-based distro that I tried), and possibly one or two others I might have forgotten. Distro hopping? No, not really. I basically wanted to get a good feel and flavor of the different distros out there. So for a time I was installing a new distro nearly every week. I’ve had Debian installed on it for 2 or 3 weeks now. I’ll probably stick with it, using it to test out desktop environments as well as other distros in a VirtualBox. No more crashed on my main computer in VB. This last crash took out my Windows virtual drive. Luckily I didn’t have much on it of importance.

If you have any suggestions as to topic I could tackle, let me know in the comments. Thanks for reading. My posts are usually not this long.

Wednesday, April 8, 2020

Which Linux Distro Should I Use?

One reason why many haven’t hopped on the Linux bandwagon yet is the difference between every other OS (Operating System) and the vast array of confusing Linux distributions, at last count, close to 600 of them . You have the big ones, like RedHat, Debian, Arch, openSUSE, CentOS, Gentoo, and others. Additionally, these major Linux distros have “children.” Ubuntu, being the biggest one and based on Debian, which also has distros based on it such as Lubuntu, Xubuntu, Linux Mint, ElementaryOS, Ubuntu Studio, just to name a few off the top of my head.

Confusing? For the new Linux user trying to decide what distro to start with, it can be very confusing. There is no hope that your average user will try each distro and make a decision. How does one decide among the various distributions what will fit you? The answer is in the question: deciding why you want to get on Linux and what your needs are. Until you know that, you’ll be shooting at the wind.

Before we get into that, it could be helpful to know why there are so many distros. Yes, one big reason there are so many distros is because Linux is a community effort. Instead of one company like Microsoft or Apple owning and controlling one OS, you have a large community of people who put together the Linux kernel (the base of an OS), a desktop environment and a set of pre-installed programs to create customized OS’s. However, while the vast array of choices may appear to be a disadvantage, it is also true that it is an advantage. Because you are more likely to find a distro that will not only meet your needs but you will fall in love with.

The main parts of a distribution of note for a new user are a GUI (Graphical User Interface)--also called a “desktop environment”, a set of pre-installed software packages, and the list of software packages in their repositories that you can download, usually for free. The way they combine the various elements of these things together, with the Linux kernel, makes up a Linux distro.

So, for example, if you wanted to install Linux onto an older computer that can barely run Windows, whatever version, you would likely pick from among the distros that have a GUI and collection of software that minimize CPU load, RAM load, and the like. Examples of such systems would be Puppy Linux, Lubuntu, Xubuntu. Note, in such a case, you’ll likely have to be able to do some things more manually. For example, to set the date in Linux Mint, it is a full, graphical process. But, in Lubuntu’s GUI, it only pops up a link indicating that you need to plug in a specialized code to get the date to display or show in the panel the way you want. I would always have to go and check on the Internet what those codes were. There are many examples similar to that example.

So, first, why are you wanting to switch to Linux? Are you fed up with how slow MSWin OS is going? You might want to try Xubuntu or even Linux Mint is said to be a low-memory, faster-running system. Lubuntu is a good choice—for someone who likes to use the command line and edit files. However, truth is, most any Linux distro will be faster than MS Windows. Or do you have a power computer that has plenty of disk space and memory, and you want to take advantage of that? Or, do you want an OS that simply will work out of the box with little set up, or are you a tinkerer who wants to get you feet wet in a terminal at a command prompt? There are other potential needs a person may list. The point is, there is a distro out there for you.

For example, let’s say you like the Windows environment, but the slowness of it is getting to you. You keep clearing out stuff, only to have Windows slow down again. Plus, my experience has been that the older a Windows system gets, the slower it gets, for some reason. That is one of the reasons I switched to Linux: everything usually runs snappy, and it stays that way. But let’s assume that you are afraid of having to learn a lot of new stuff, and operate with an unfamiliar system. Is there a system that has the look and feel of Windows? Why, yes there is! It is called Lindoz, a Makutu distro. You can switch the desktop environment to a “classical Win98”, or XP, Win7, or Win10. I installed it on my backup laptop recently, and it is pretty cool.

So, what do I recommend for you? That depends on what your needs are. That said, for the first Linux distro someone coming from another operating system should get, I would suggest you start with Linux Mint using the Cinnamon desktop environment. Why? Because it is the easiest to install, has one of the more refined intuitive interfaces out there, requiring minimal learning curve, and it just flat out works. It also has a low profile in RAM, leaving plenty of space to run programs before hitting the swap file. Are there other good beginning distros out there? Sure. Straight up Ubuntu is a good choice, as would be many others I could list. But I would recommend that for most first time users start with Linux Mint. Once you’ve gotten your feet wet with Linux in general, you may want to try out other distros to find one that more suits your needs if Mint doesn’t quite “do it for you.” For instance, if you are a creator of streaming and/or uploading YouTube videos, you may want to try Ubuntu Studio. It comes prepackaged with a lot of the best software for doing that and is designed creators, both artists and YouTube creators.

One final note, a warning really. If you are ready to jump ship and ditch your Windows OS, don’t immediately go out and download a Linux distro, and install it over your Windows OS. That is the way of a lot of potential pain. Rather, I would find a backup laptop or desktop that you don’t mind loosing most of the files on, for the purpose of installing and learning more about Linux. Do not, I repeat, do not use your primary computer for this purpose. Once you’ve used it for a while on a backup computer, and you’ve backed up your files, then you may want to install it, once you know it will meet your needs.

Whatever computer you install it on, if you wish to keep the Windows on it, first make a ISO copy of the OS (Sorry, how to do that would be the topic of another tip), and make sure you have the Windows ID key for your specific version of Windows, before you install. I failed to get the key, though I did create and ISO of the OS. Why? Because you may wish to install it into a VirtualBox (a program that will run other OS’s inside of Linux through using it as a virtual machine). Luckily, for me, I found the key stored in a Linux variable so I was able to fully install it in a VirtualBox.

But, what about a dual boot system? You can do that. I heard another recommend against it, because sometimes there are install issues. I did do a dual boot for a long time, with no problems. Because I needed to have access to Excel to run some highly customized spreadsheets that couldn’t run in LibreOffice due to the difference in programming languages. I didn’t want to go through the process of translating that to LibreOffice’s language, so I opted for a dual boot.

Aside from the potential for installation issues I mentioned above, however, I encountered a couple of issues that I didn’t like.

One, it was hard to transfer information back to the Linux side and even more so back to Windows. That’s because if I stored a file while in Windows, I could reboot into Linux and still see, get, and read the file, even though that was a lot of trouble. However, Windows couldn’t read the files on the Linux system. Only if I stored them in the Windows drive from Linux. So if I had a lot of that type of thing to do, I could spend a lot of time waiting for a system to boot up. Windows in a VirtualBox, however, you can drag and drop, or copy and paste between the two OS’s with just a little setup.

Two, realistically, I would usually only go into Windows when I had too. That caused another issue. What is the slowest time you normally experience in a Windows OS? During the initial startup, correct? Sometimes it seems you have to wait forever for all the background apps to load, and everything to get put into place before it gets to a “normal” speed. Compound that with downloading updates in the background, which due to how infrequently I would boot into Windows, meant nearly every time I did boot into Windows, that slowed things down that much longer. Then, once they were downloaded, the only way to install them in Windows appeared to be when you shutdown, and boot into the system, and we all know how long that can take. In some cases, nearly 24 hours.

What about Wine? I did use that on my previous computer to install my copy of MSOffice 2003 (I know, it’s ancient, but hey, it still works.) to access Excel for those spreadsheets. It took a little arm-twisting of the software to accomplish it, but I was able to install it in Wine and have it fully operational. Then I read that Wine had security issues. So that’s why I installed Linux alongside of Windows in a dual-boot system. But for the reasons listed above, I decided when I installed Mint (which I’m using as I type), I would move to a VirtualBox install of Windows, which has worked out wonderful for me so far.

But the point being, that before you overwrite MS Windows, you may want to make sure, if you need it again, you can reinstall it using the ISO file and your ID key. Also, goes without saying, but you’ll want to create a backup of any user files you wish to keep. So the best way is to get a older backup laptop that you can “play” on without worries about if it crashes and such.

Also, another way you can easily “try out” a system initially is most Linux distros have a “Live Boot” option. As a matter of fact, it tends to be the default option when you plug in a bootable flash drive containing a Linux ISO file. It means that the flash drive has the whole operating system on it, and it will give you a taste of the distro before you install it to your hard drive. You can easily see if it will recognize all your hardware, wi-fi, printers, etc. instead of discovering such problems after the install.

So, I’ve rambled on long enough about this. I think you should have an idea, if you’ve been researching this already, about your top 3 or so distros to try out. If not, do your research, do some live boot test of some distros you want to try out, then install one or two or three of them, then make a decision.

Welcome to the Linux world, and good luck!