How To Install r-cran-rgdal on Ubuntu 20.04
Introduction
In this tutorial we learn how to install r-cran-rgdal
on Ubuntu 20.04.
What is r-cran-rgdal
r-cran-rgdal is:
Provides bindings to the ‘Geospatial’ Data Abstraction Library (‘GDAL’) (>= 1.11.4) and access to projection/transformation operations from the ‘PROJ.4’ library. The ‘GDAL’ and ‘PROJ.4’ libraries are external to the package, and, when installing the package from source, must be correctly installed first. From ‘rgdal’ 1.4.1, provision is made for ‘PROJ6’ accommodation, with ‘PROJ6’ functionality to follow; from 1.4.1 ‘rgdal’ will build and function when ‘PROJ’ >= 6. Both ‘GDAL’ raster and ‘OGR’ vector map data can be imported into R, and ‘GDAL’ raster data and ‘OGR’ vector data exported. Use is made of classes defined in the ‘sp’ package. Windows and Mac Intel OS X binaries (including ‘GDAL’, ‘PROJ.4’ and ‘Expat’) are provided on ‘CRAN’.
There are three methods to install r-cran-rgdal
on Ubuntu 20.04. We can use apt-get
, apt
and aptitude
. In the following sections we will describe each method. You can choose one of them.
Install r-cran-rgdal Using apt-get
Update apt database with apt-get
using the following command.
sudo apt-get update
After updating apt database, We can install r-cran-rgdal
using apt-get
by running the following command:
sudo apt-get -y install r-cran-rgdal
Install r-cran-rgdal Using apt
Update apt database with apt
using the following command.
sudo apt update
After updating apt database, We can install r-cran-rgdal
using apt
by running the following command:
sudo apt -y install r-cran-rgdal
Install r-cran-rgdal Using aptitude
If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude
using the following command.
sudo aptitude update
After updating apt database, We can install r-cran-rgdal
using aptitude
by running the following command:
sudo aptitude -y install r-cran-rgdal
How To Uninstall r-cran-rgdal on Ubuntu 20.04
To uninstall only the r-cran-rgdal
package we can use the following command:
sudo apt-get remove r-cran-rgdal
Uninstall r-cran-rgdal And Its Dependencies
To uninstall r-cran-rgdal
and its dependencies that are no longer needed by Ubuntu 20.04, we can use the command below:
sudo apt-get -y autoremove r-cran-rgdal
Remove r-cran-rgdal Configurations and Data
To remove r-cran-rgdal
configuration and data from Ubuntu 20.04 we can use the following command:
sudo apt-get -y purge r-cran-rgdal
Remove r-cran-rgdal configuration, data, and all of its dependencies
We can use the following command to remove r-cran-rgdal
configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge r-cran-rgdal
References
Summary
In this tutorial we learn how to install r-cran-rgdal
package on Ubuntu 20.04 using different package management tools: apt
, apt-get
and aptitude
.