A gentle guide on setting up ElementaryOS (Linux distribution)
And you can still keep using Windows at the same time.
Forewords: I have been a Windows user for all my life. I still used Windows 10 for my Python work in data science, until I found out that Linux-based systems have more significant benefits. Firstly, I frequently have problems with PATH in Windows when working with Python, either in VS Code or Pycharm. Windows seems to be unstable and buggy in this respect. Secondly, most of server computers use Linux systems, so getting started with Linux will be beneficial for you in the long term.
For these reasons, I highly recommend you to give Linux-based systems a try. There are many Linux distributions (distros), and Ubuntu 18.04 Long-term support (LTS) is currently the most popular among others. You can also try Linux Mint, Xubuntu for a weak computer. You can see a full list of completely free available Linux distributions by hitting Google. However, my personal choice is Elementary OS.
I — Installing ElementaryOS
Here is a quick overview of the Elementary OS: https://elementary.io/ The main reason I choose Elementary OS is because it is very similar to Ubuntu (the installation and command lines are absolutely the same), yet it gives a unique elegant MacOS-like feel for an open-sourced operating system. In my opinion, ElementaryOS is the most beautiful and possibly most stable Linux distribution among others. In the sea of many Linux distros, ElementaryOS has made a lot of improvements recently and I believe it won’t make you disappointed. In fact, I have been working in ElementaryOS for a few months now. It is not only bug-free, but also significantly boosts my creativity and productivity :)
To install Elementary OS, just follow this tutorial: https://itsfoss.com/guide-install-elementary-os-luna/ This will explain everything you need to install your Elementary OS. However, you can find the latest Elementary OS package from its homepage. At this time of writing, it is Elementary OS 5.1.3 Hera.
Since I have had a lot of problems installing dual-boot Linux and Windows systems, I am just gonna give you 2 important notes:
- Firstly, make sure you read and follow the tutorial carefully, especially at the steps of choosing partitions, creating volume and swap area. I wish I had followed this tutorial before wasting tons of time reinstalling and fixing the systems over again.
- Secondly, if you want to have dual-boot Linux and Windows systems: first install Windows 10, then install Elementary OS. Because from my experience, if you install Elementary OS first then Windows 10, the Windows 10 setup will damage Elementary OS’ boot files, making it unable to load. I had to fix this problem by reinstalling Elementary OS afterwards.
II — Brushing up Elementary installation
Typical problems encountered by many ElementaryOS and Ubuntu users after installation include the run-time error message screen at shutdown and long shutdown time (up to 2 minutes). This makes me feel very insecure as if the system is so fragile and full of bugs. However, these can be fixed easily as following.
1. Fixing ‘PCI Error severity’ shutdown screen
- Step 1: make a backup of your grub config file. Open a terminal and use the following command:
$ cp /etc/default/grub ~/grub.back
- Step 2: open the grub file to edit:
$ sudo nano /etc/default/grub
Step 3: Edit this line as following:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pci=nomsi"
- Step 4: Save the file by Ctrl+O → Enter, then exit by Ctrl+X.
- Step 5: Update grub and reboot the system
$ sudo update-grub
2. Fixing Ubuntu’s slow shutdown
- Step 1: open the system.conf file
$ sudo nano /etc/systemd/system.conf
- Step 2: Uncomment and set these lines as following:
RuntimeWatchdogSec=0
ShutdownWatchdogSec=0min
DefaultTimeoutStartSec=10s
DefaultTimeoutStopSec=5s
DefaultRestartSec=100ms
- Step 3: Save the file by Ctrl+O →Enter, then exit by Ctrl+X.
- Step 4: Reboot.
Now you can expect to have your ElementaryOS running smoothly.
Reference:
https://itsfoss.com/pcie-bus-error-severity-corrected/
https://medium.com/@sbyang/slow-shut-down-of-ubuntu-18-04-e5fcc31255e2
III — Customizing ElementaryOS
1. Customizing keyboard shortcuts
To customize keyboard shortcuts, choose System settings > Keyboard > Shortcuts.
Here you can edit the keyboard shortcuts for almost everything in ElementaryOS, such as tiling apps in a window, switching workspaces, setting shortcuts for Applications (opening Terminal, web browser, home folder and so on).
There are many things you can do to customize ElementaryOS, you can find out by searching specific things on Google. Here I will only show you one thing not many people know.
Install AppEditor in AppCenter.
This app will let you know the command lines of app entries, which you can use to add customized keyboard shortcuts which you cannot find elsewhere. For example I can create a new keyboard shortcut for opening System Settings as following. First copy the command line for this app in AppEditor, then add it in the Shortcuts tab of Keyboard settings and bind with a key combination such as Alt+A. Now I can open System Settings by hitting Alt+A:
Another important keyboard shortcut is for shutting down. Copy the following command line to the Custom section in Shorcuts tab of System Settings > Keyboard:
gnome-session-quit --power-off
then combine with Alt+F3. Now I can turn off the computer by hitting Alt+F3. Of course you can use any key combination of your choice, as this is only my preference.
2. Customizing boot menu
Install Grub customizer by following this tutorial: https://itsfoss.com/grub-customizer-ubuntu/
IV— Git
1. Install git
$ sudo apt-get install git
2. Essential git commands
- Step 1: create a new repository (repo) on github and copy its link.
- Step 2: open your local project directory in your Terminal and type the following commands by this order:
git init # to initialize an empty repo in your local directory
git add . # to add all files
git commit -m 'your message or note'
git remote add origin <your copied github repo link>
git push origin master
For more git guide and commands:
What is Git?
GitHub credential settings
https://rogerdudler.github.io/git-guide/
V— Setting up Python IDE
Anaconda
You should probably know that to start working with Python, one of the most stable distributions to install is Anaconda. This tutorial also works seamlessly for ElementaryOS. Just look for the latest Anaconda package.
https://www.digitalocean.com/community/tutorials/how-to-install-anaconda-on-ubuntu-18-04-quickstart
Atom
Atom is regarded as the one of the most stable, powerful and customizable text editors in Linux. It is also my #1 choice.
How to install Atom: https://flight-manual.atom.io/getting-started/sections/installing-atom/
Kite
Kite has a lot of support for coding. My favorite feature is Kite copilot, which shows details of every function and object, making my coding a lot easier and more enjoyable.
Install Kite
Using Kite plugin in Atom
VI — Setting up R programming IDE
1. Install the latest version of R:
R-base installations by default command lines are often outdated. Here is the instruction for installing the latest version of R from the CRAN project website: https://cran.r-project.org Especially, you need to adjust the entry in/etc/apt/sources.list
to force it install the latest version (at the time of writing, it is R version 4.0.0)
deb http://cloud.r-project.org/bin/linux/debian stretch-cran40/
2. Install the ‘tidyverse’ package in R Studio:
Initially, RStudio failed multiple times as it attempted to install ‘tidyverse’. This is because my Linux system lacks several prerequisite non-R packages. I took me quite a long time to search for a solution and luckily this guy did a wonderful job: https://blog.zenggyu.com/en/post/2018-01-29/installing-r-r-packages-e-g-tidyverse-and-rstudio-on-ubuntu-linux/ . I hope this will help if you encounter the same problem as I did.
VI —Linux command lines for installing and uninstalling packages
To install a package:
$ sudo apt-get install <package_name>
To remove a package:
$ dpkg --list # check the installed package
$ sudo apt-get remove <package_name> # uninstall a package
$ sudo apt-get purge <package_name> # uninstall a package + its config files
$ sudo apt-get autoremove
$ sudo apt-get clean
That’s it today for my ElementaryOS tutorial. I would be very happy if this can help or give you a new idea in your coding journey. Feel free to leave a comment if you have other issues installing ElementaryOS and I will try my best to help you.
Have a nice day :)