I solved my problem as: First of all, I will add my CRAN to /etc/apt/sources.list. After that, I ran the following command from my terminal
sudo apt-get update
and then
sudo apt-get upgrade
After a successful upgrade, you will receive a command in console R
install.packages("forecast")
This solved my problem. For more information about this, you can visit cran.r-project.org/bin/linux/ubuntu.
And I thank Dirk Eddelbuettel for his kind suggestions.
source share