<?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: Jasmeet Singh</title>
    <description>The latest articles on DEV Community by Jasmeet Singh (@jasmeet_17).</description>
    <link>https://dev.to/jasmeet_17</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%2F518761%2F5e029d6c-01fd-4a12-9979-a1b2f0cf335f.jpg</url>
      <title>DEV Community: Jasmeet Singh</title>
      <link>https://dev.to/jasmeet_17</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jasmeet_17"/>
    <language>en</language>
    <item>
      <title>Ubuntu Server 20.04.1 set up on Raspberry Pi 4 Model B/2GB</title>
      <dc:creator>Jasmeet Singh</dc:creator>
      <pubDate>Tue, 24 Nov 2020 08:57:55 +0000</pubDate>
      <link>https://dev.to/jasmeet_17/installing-ubuntu-server-20-04-1-on-raspberry-pi-4-model-b-2gb-22cp</link>
      <guid>https://dev.to/jasmeet_17/installing-ubuntu-server-20-04-1-on-raspberry-pi-4-model-b-2gb-22cp</guid>
      <description>&lt;p&gt;I needed to turn my Raspberry Pi 4 Model B/2GB into Ubuntu Server to serve my flask application(Nginx, flask integration in a separate blog). I followed the following steps to achieve the same&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download &lt;a href="https://www.raspberrypi.org/software/" rel="noopener noreferrer"&gt;Raspberry Pi Imager&lt;/a&gt; from their website, which will allow us to write the OS on SD Card.&lt;/li&gt;
&lt;li&gt;Open Raspberry Pi Imager and select OS as Ubuntu Server 20.04.1 LTS and memory card where you want to write OS
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fh5owjiumkmnwh12c59it.png" alt="Alt Text"&gt;
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvi30znsn12e8g2oyphdc.png" alt="Alt Text"&gt;
&lt;/li&gt;
&lt;li&gt;Click WRITE. It will take some time depending on your internet speed.&lt;/li&gt;
&lt;li&gt;Once it finishes writing into SD/USB card, plug the card into Raspberry Pi and turn it ON.&lt;/li&gt;
&lt;li&gt;If your Raspberry PI is connected to ethernet, than it's great and go to Setting up the wifi(Step 9), otherwise go through the painful steps(6, 7 and 8) below to install packages that will help you set up wifi.&lt;/li&gt;
&lt;li&gt;Download the following files from a computer with an internet connection and save them into a USB drive(not the one on which you wrote OS and download packages from &lt;a href="https://ubuntu.pkgs.org/20.04/ubuntu-main-arm64" rel="noopener noreferrer"&gt;Ubuntu Package site&lt;/a&gt;):

&lt;ol&gt;
&lt;li&gt;libnl-route-3-200_3.4.0-1_arm64.deb
&lt;/li&gt;
&lt;li&gt;libpcsclite1_1.8.26-3_arm64.deb
&lt;/li&gt;
&lt;li&gt;wpasupplicant_2.9-1ubuntu4_arm64.deb&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;li&gt;Plug in the USB drive to the Raspberry Pi and let's copy them and install the packages
&lt;code&gt;$ cd /dev/disk/by-label&lt;/code&gt;
&lt;code&gt;$ ls -lt (it will show your USB name and location, it gave &lt;br&gt;
following for me SANDISK -&amp;gt; ../../sda1)&lt;/code&gt;
The USB location in my case was &lt;code&gt;/dev/sda1&lt;/code&gt;. Might be different in your case so check &lt;code&gt;ls -lt&lt;/code&gt; output above&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Now mount the usb and installed packages&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; /media/usb
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mount &lt;span class="nt"&gt;-t&lt;/span&gt; vfat /dev/sda1 /media/usb
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /media/usb
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;dpkg &lt;span class="nt"&gt;-i&lt;/span&gt; libnl-route-3-200_3.4.0-1_arm64.deb&lt;span class="se"&gt;\ &lt;/span&gt;  
libpcsclite1_1.8.26-3_arm64.deb &lt;span class="se"&gt;\&lt;/span&gt;
wpasupplicant_2.9-1ubuntu4_arm64.deb
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Check the name of the network interfaces and the associated IP address&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;ip a
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;br&gt;
will list all networks. In my case they were eth0 for ethernet, Wlan0 for wifi which we will use below.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Now to add set wifi username and password info&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; /etc/netplan/
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;br&gt;
which will output the the name of YAML file, something like XX-cloud-init.yaml. Create back up of it and open it in nano editor and add wifi settings as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo cp &lt;/span&gt;XX-cloud-init.yaml XX-cloud-init.yaml.bak
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano XX-cloud-init.yaml
&lt;span class="c"&gt;# This file is generated from information provided by the datasource.  Changes&lt;/span&gt;
&lt;span class="c"&gt;# to it will not persist across an instance reboot.  To disable cloud-init's&lt;/span&gt;
&lt;span class="c"&gt;# network configuration capabilities, write a file&lt;/span&gt;
&lt;span class="c"&gt;# /etc/cloud/cloud.cfg.d/XX-disable-network-config.cfg with the following:&lt;/span&gt;
&lt;span class="c"&gt;# network: {config: disabled}&lt;/span&gt;
network:
version: 2
ethernets:
    eth0:
        dhcp4: &lt;span class="nb"&gt;true
        &lt;/span&gt;optional: &lt;span class="nb"&gt;true
&lt;/span&gt;wifis:
    wlan0:
        dhcp4: &lt;span class="nb"&gt;true
        &lt;/span&gt;optional: &lt;span class="nb"&gt;true
        &lt;/span&gt;access-points: 
            &lt;span class="s2"&gt;"WIFI-USER-NAME-KEEP-QUOTES"&lt;/span&gt;:
                    password: &lt;span class="s2"&gt;"WIFI-PASSWORD-KEEP-QUOTES"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Save the changes. And try the following to make sure there is no error in YAML file&lt;br&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;

&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;netplan &lt;span class="nt"&gt;--debug&lt;/span&gt; try &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;continue &lt;/span&gt;even &lt;span class="k"&gt;if &lt;/span&gt;fails/pass&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;netplan &lt;span class="nt"&gt;--debug&lt;/span&gt; generate &lt;span class="o"&gt;(&lt;/span&gt;fix all the issues raised&lt;span class="p"&gt;;&lt;/span&gt; mostly regarding tabs/indentation, you can also look https://netplan.io/examples/ &lt;span class="k"&gt;for &lt;/span&gt;examples &lt;span class="k"&gt;if &lt;/span&gt;you are facing any troubles regarding tabs/indentation/spacing&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;netplan &lt;span class="nt"&gt;--debug&lt;/span&gt; apply
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;reboot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Now &lt;code&gt;$ ip a&lt;/code&gt; and you will see local IP address against the wlan0&lt;/li&gt;
&lt;li&gt;check wifi is working &lt;code&gt;ping google.com&lt;/code&gt; and see the packages received and transmitted&lt;/li&gt;
&lt;/ul&gt;

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