How to install R studio in Ubuntu 20.04?

How to install R studio in Ubuntu 20.04?

Hello readers,
Today As of the time of writing this article there is no any official specific RStudio available for Ubuntu 20.04 (Code-name: focal) but Rstudio for Ubuntu 18.04 works fine for Ubuntu 20.04. I am using R studio in 20.04 for a weak ago and it's working fine for me.
Now visit the  RStudio downloads page and check for it to grab the latest release of RStudio for Debian based Linux distributions "Ubuntu 18/" or if available "Ubuntu 20/" download .deb file from here.

Installation process is almost same for 18.04 and 20.04.

Here in this article, we’ll dive to the installation of Open source edition of RStudio released under AGPL License.

Steps to Install RStudio:

  • Update system

Update System package index (this is the good practice) and optionally upgrade all installed package.
  • sudo apt update
  • sudo apt -y upgrade
  • Install R on Ubuntu/Debian

At this point, we’re ready to install R with the following command.
We need to install r-base package which contains the basic R functions that let you perform basic R programming and arithmetic operations. Use the command below to install.

  • sudo apt -y install r-base

If prompted to confirm installation, press y to continue.
verify your R Installation
  • sudo -i R
Output



This confirms that we’ve successfully installed R and entered its interactive shell.

Exit to the shell

press "ctrl+z"

  • Download and Install RStudio

Visit to RStudio downloads to download the latest release of RStudio for Ubuntu.
As of the time of writing, the latest version is rstudio-1.3.1056

  • sudo apt -y install wget
  • wget https://download1.rstudio.org/desktop/bionic/amd64/rstudio-1.3.1056-amd64.deb
Note: This link maybe outdated.

jump to your local directory where your file downloaded in terminal and run
  • sudo apt install ./rstudio-1.3.1056-amd64.deb

Enjoy! Your installation of R and RStudio on Ubuntu / Debian and Linux Mint has been successful.


Compile C program with pthread.h header library in Linux.

Compile C program with pthread.h header library in Linux.
Hello readers
In this post I will tell you “how to compile a C program with '#include <pthread.h>' header library in GCC or G++ compiler using Linux?".
2-3 min of read this post will help you what is basic and how to do?

Let's begin
C compiler needs to extra argument on compilation time when we use threading in our program.

The solution of this problem is 

Use -lpthread after compile command.
Read this article will give you better understating.

Compile C program with "pthread.h" header in linux.

I am assuming you know about Threading concept in Programming world.
usually we face the problem in Linux with threading in C program, when we use "pthread.h" library in our code. Then simple compile command doesn't able to execute your program. And compiler throw an error(s). see below

Suppose your file name is multithread.c
  • user@ubuntu:~/$ gcc multithread.c
  • thread.c: undefined reference to 'pthread_create'

Then Question is "How to compile our C Program with '#include <pthread.h>' library"?

Solution:: 

When you are using pthread.h library into your C program, you have to add >space<-lpthread just after the compile command "gcc multithread.c" , or "g++ multithread.c -o multithread", this command will tell to compiler, this program have threading active so compile this program with pthread.h library.

Command:
  • user@ubuntu:~/$ gcc multithread.c -lpthread
  • user@ubuntu:~/$ ./a.out

Here:
  • gcc is your compiler.
  • multithread.c is the source file name of your C program.
  • -lpthread is to execute pthread.h libreary file
  • ./a.out is the object file "I think you know better".

Hope you find this article helpful,
😂"Enjoy your code"😁

Thanks for visit

Home 
 

"sources.list file empty" or "E: Package package_name has no installation candidate" in ubuntu 20.04

"sources.list file empty" or "E: Package package_name has no installation candidate" in Ubuntu 20.04



Hello Ubuntu users, I  am writing this article because i faced this problem as follow by other old solutions on internet when i was upgrading my Ubuntu v18.04 to v20.04, accidentally i remove or clear "sources.list" file from location /etc/apt/sources.list

I don't have screenshots of errors because i didn't taught to write article on this error. but it works for me.

first check your Ubuntu version
lsb_release -a

I don't even know this will work for other Ubuntu versions or not.

If your sources.list file is empty then it will not allow you to install any packages.

I was getting error "E: Package 'lsb-core' has no installation candidate"
after investing couples of hrs. to solve E: Package 'lsb-core' has no installation candidate i got about sources.list but it was empty for,  and start searching to regenerate sources.list file contents back, and finally i collect information from different sources and combine them and got solution.

Let's start!

Solution:: It Works For Me( You Can Try )

Copy of your sources.list file backed-up to your "/etc/apt/" directory by named "sources.list.save" In my case it was there if you didn't get this file name you can skip this article.
  sudo apt update
  cd /etc/apt/
  ls 
 Check file name "sources.list.save" If file exists open and check contents available or not.

Copy file using
  cp sources.list.save sources.list
 
open sources.list
  vi sources.list
Note: You can use any editor to edit

change all text "bionic" to focal
Note: line starts with # is comment so you can leave this unchanged.

once all bionic changed to focal save file and exit

  sudo apt update
  sudo apt upgrade

 
some files will not upgrade directly using upgrade command.
you can manually install them if you know up-gradable package name.
  sudo apt install package_name
I hope this will work for you i am also a beginner in Ubuntu, and if you have query related to this feel free to write in comment section.

If you have another solution related this can share your solution in comment section it help others.

Thanks


Home
 

Error “Device /dev/ttyUSB0 is locked” in linux

Error “Device /dev/ttyS0 is locked”


Sometimes terminal gives error "Device /dev/ttyS0 is locked" or
"Device /dev/ttyUSB0 is locked" that is happens, if the connection to Linux from external device which was made via Minicom is lost, and then the next time you start Minicom, you could see an error:

Device /dev/ttyS0 is locked
Error Device /dev/ttyUSB0 is locked
Device /dev/ttyS0 is locked
or
Device /dev/ttyUSB0 is locked

or The name /dev/tty*** may be different, depending on what COM-port you have.
To avoid such error, it is necessary to properly shut down Minicom using the command

"CTRL+A" keys and then the "Q" key on keyboard.

There are different  options available to overcome this error, some are:

1- Kill the process as a root user with the command:

   "$ killall -9 minicom"

   In Ubuntu, use the command:

   "$ sudo killall -9 minicom"

2- Or can simply delete the file «LCK..tty***» in the /var/lock/ directory.

Now try to open the minicom. Error will not be display.

😂️Enjoy😂️

Home    email us   

When to apply for Adsense after creating a blog?


When to apply for AdSense approval

Everyone wants to earn money by creating a blog.  But if you also want to earn money from a blog and are a new blogger, then stop for a bit and see what are the shortcomings in your blog.

So in this post I will tell you “When to apply for Adsense after creating a blog.

I read many of questions regards AdSense application is rejected. People make mistake and I too had made these mistakes.  After creating a blog, apply for Adsense after writing 5-7 posts in it. Smoetimes they apply without any additional information like about us, disclaimer, privacy policy pages etc.

So often new blogger do this so that Adsense becomes 100% Disapprove.  Those who are new blogger, I would like to tell them that do not get sweet fruits before working hard on the tree.  After creating a blog, do not think that you have to earn money from the blog, but think that the blog has to be made successful and only you can be successful by working hard.

It's few words about myself.
I Manish Kumar Singh
B-Tech in Electronics and Comm.
And struggle to become good Embedded system developer.

When to apply for Adsense after creating a blog?

Now I am going to tell you some tips which you can follow and approve Adsense Account.
It is my personal experience to purchase a domain first and then create some good quality posts or add blogspot article to your domain.

Let's get it in detail.

It is very important that your blog has good traffic. Daily pageviews from Google of your blog should be minimum 50-60 or more pageviews is good sign to your website. And add some additional information (I explained it in detail read carefully) then you can apply for Adsense.
I will suggest you, increase the traffic of your website first, then apply for Adsense.

Content
The information that you share in your blog is known content.  Your blog should have minimum 10 posts and each post should have minimum of 500 words.  Your post must be written by you, meaning it should be 100% original. It's my openion but you can take help from other related posts.

Author Talent
When you apply for Adsense, the Adsense team reviews your blog and see how the post you have written is written.  And they will try to get all the information about you.

CSitemap
Create a sitemap for your blog. Submit it to popular search engines. This will index your site in search engines and traffic will be high. Sometimes it is very helpful to rank your website. I don't done anything like this with my blog.

Bdesign
If the design of your blog is simple then it is good. So that fast loading and viewing is good. And add some necessary widgets to it as well. You must have seen many such blogs in which design is very colorful but you must have also seen how slow loading time is. So keep your blog very simple and pure.

Bounce rate
Bounce rate means how long your visitors stay in your site, how much they liked your information and spend time with your articles. The bounce rate of your site should be low.
Collect more information from internet about bounce rate analysis.

Labels
Article labels is also an important part that help you to improve your blog search.

Remember your article labels must be related to your article directly or indirectly. Sometimes or may be Everytime review team keep attention on labels.

Some Imformative pages
It is very important to have some important pages in your blog. Such as About us, Privacy and Policy, Contact us and Disclaimer page is very important. These all pages must important that tells about yourself and about your website. AdSense application review team will check all the information given by you is match to your website and you.

If you do not create these pages, then Adsense will have trouble in knowing about you, so that they can disapprove your account. I also rejected 3-4 times for this reason.

Global & Traffic Rank
Global rank of your blog should be good and traffic rank of your site is also very important.  If you want to know the traffic rank of your blog, then if your blog is verified in Alexa, then you can go to Alexa's site and find your site and check its global and traffic rank.

Copyright
Ensure that all posts in the blog should be written by you. Meaning that the content you put in the blog should not be copied from anywhere and if you use the image in the blog, then it should also be created or edited by you. If any content copyright is found by Adsense team in your blog, then Adsense will become Disapprove.

I hope you enjoy this information. If you have any problem in this, feel free to  tell me in the comment box.

If you get this article helpful Share this post in social media so that your friends can also take advantage of it by reading this post.

Thank you😊