How to force auto upgrade control dependency in a debian package - unix

I am installing a custom debian package on debian 6 machine.
This is my control file
Package: [[name]]
Version: 5.1
Section: hello/world
Priority: Optional
Architecture: all
Essential: no
Depends: my-dependent-package (>> 0.2.1)
Installed-Size: 1000
Maintainer: Test test#test.com
Description: _DESCRIPTION_
Here the my-dependent-package doesnt get auto upgraded when newer versions are released.
i always do sudo apt-get update before installing.
installing the debian from an internal mirror and using
sudo apt-get install mypackage
the dependent package "my-dependent-package" is also available in the same internal mirror.
the internal mirrors are defined in /etc/apt/sources.list
both the packages come from same mirror
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
my-package : Depends: my-dependent-package (>> 0.2.1) but it is not going to be installed
E: Broken packages
Installation succeeds when I manually install the "my-dependent-package". I was expecting it to be auto installed by the "my-package" as I have mentioned it in control file.
How can I enable it ?

Debian assigns priorities to suites and packages.
Most likely your local repository has a low priority, which results in being excluded from automatic updates.
Configure apt to assign a higher priority to your repository, so it get's automatically selected.
See the AptPreferences documentation for more information.
(It's really impossible to give you a walkthrough without more knowledge on your actual setup)

Related

r-cran-rquantlib does not install in R 3.6.1 and Debian 9

I have had problems compiling Quantlib for Debian 9 and tried to install r-cran-rquantlib via apt from https://cloud.r-project.org/bin/linux/debian stretch-cran35/
I get the following error which I do not understand since I have both Rcpp and zoo already installed.
$ sudo apt install r-cran-rquantlib
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
r-cran-rquantlib : Depends: r-cran-rcpp (>= 0.11.0) but it is not going to be installed
Depends: r-cran-zoo but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Is this a version mismatch problem? r-cran-rquantlib installs fine in Debian 10

R 3.6 on debian stretch [duplicate]

This question already has an answer here:
R: Cannot install rJava; what is r-api-3.4?
(1 answer)
Closed 3 years ago.
I need to run 3.6 on debian stretch - I followed the instructions here:
https://cran.r-project.org/bin/linux/debian/
and used this repo:
http://lib.stat.cmu.edu/R/CRAN/bin/linux/debian stretch-cran35/
I was able to install it. But 2 packages I need, r-cran-caret and
r-cran-ggplot2 will not install:
# apt-get install r-cran-ggplot2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
r-cran-ggplot2 : Depends: r-api-3
Depends: r-cran-digest but it is not going to be installed
Depends: r-cran-gtable (>= 0.1.1) but it is not
going to be installed
Depends: r-cran-plyr (>= 1.7.1) but it is not going
to be installed
Depends: r-cran-reshape2 but it is not going to be installed
Depends: r-cran-scales (>= 0.4.1) but it is not
going to be installed
Depends: r-cran-tibble but it is not going to be installed
Depends: r-cran-lazyeval but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Is there a way to get these 2 packages for my environment?
I am not sure if this will solve your problem.
sudo dpkg --configure -a
In these cases I find it easier to use aptitude
sudo apt install aptitude
sudo aptitude install r-cran-ggplot2
of course you can try the same with caret if ggplot2 works.
A question is however if you load R in a terminal and try to install these packages within R what kind of error messages do you get, if you get any?
type R in a terminal and after it loads type
install.packages("ggplot2",dependencies=TRUE)
what error messages do you get when you do that?
Another common problem is that the version of a package you are trying to install does install in the version of R you are using. In that case you have to download the package from cran, untar it and install from local files.
open a terminal and type R then inside the session type
packageurl <- "https://cran.r-project.org/src/contrib/ggplot2_3.2.0.tar.gz"
install.packages(packageurl, repos=NULL, type="source", dependencies=TRUE)
If you have the common problem of versioning this command will hopefully not bother checking the version of ggplot and the version of R.
Alternatively if you do not want to explicitly start an R session type in terminal
wget https://cran.r-project.org/src/contrib/ggplot2_3.2.0.tar.gz
R CMD INSTALL ggplot2_3.2.0.tar.gz repos=NULL type="source" dependencies=TRUE
You're missing dependencies and apt-get tells you that these are broken.
You need to remove the broken dependencies from your R library, which should be in /usr/lib/R/site-library.
Why don't you just install it directly within R?
install.packages(c("caret", "ggplot2"), dependencies = TRUE)
As you have mentioned you want to use docker: See the littler package by Dirk Eddelbuettel: https://github.com/eddelbuettel/littler especially install2.r function and it's option -d
For examples how others use it see the rocker docker images.
Another edit: If you decide to use littler, I think you'll need this syntax
install2.r -d TRUE caret ggplot2

R package build failing on Unix machines due to missing GSL - GNU Scientific Library

I am facing a particularly vexing problem with R package development. My own package, called ggstatsplot (https://github.com/IndrajeetPatil/ggstatsplot), depends on userfriendlyscience, which depends on another package called MBESS, which itself ultimately depends on another package called gsl. There is no problem at all for installation of ggstatsplot on a Windows machine (as assessed by AppVeyor continuous integration platform: https://ci.appveyor.com/project/IndrajeetPatil/ggstatsplot).
But whenever the package is to be installed on Unix machines, it throws the error that ggstatsplot can't be downloaded because userfriendlyscience and MBESS can't be downloaded because gsl can't be downloaded. The same thing is also revealed on Travis continuous integration platform with virtual Unix machines, where the package build fails (https://travis-ci.org/IndrajeetPatil/ggstatsplot).
Now one way to solve this problem for the user on the Unix machine is to configure GSL (as described here:
installing R gsl package on Mac), but I can't possibly expect every user of ggstatsplot to go through the arduous process of configuring GSL. I want them to just run install.packages("ggstatsplot") and be done with it.
So I would really appreciate if anyone can offer me any helpful advice as to how I can make my package user's life simpler by removing this problem at its source. Is there something I should include in the package itself that will take care of this on behalf of the user?
This may not have a satisfying solution via changes to your R package (I'm not sure either way). If the gsl package authors (which include a former R Core member) didn't configure it to avoid a pre-req installation of a linux package, there's probably a good reason not to.
But it may be some consolation that most R+Linux users understand that some R packages first require installing the underlying Linux libraries (eg, through apt or dnf/yum).
Primary Issue: making it easy for the users to install
Try to be super clear on the GitHub readme and the CRAN INSTALL file. The gsl package has decent CRAN directions. This leads to the following bash code:
sudo apt-get install libgsl0-dev
The best example of clear (linux pre-req package) documentation I've seen is from the curl and sf packages. sf's CRAN page lists only the human names of the 3 libraries, but the GitHub page provides the exact bash commands for three major distribution branches. The curl package does this very well too (eg, CRAN and GitHub). For example, it provides the following explanation and bash code:
Installation from source on Linux requires libcurl. On Debian or Ubuntu use libcurl4-openssl-dev:
sudo apt-get install -y libcurl-dev
Ideally your documentation would describe how do install the gsl linux package on multiple distributions.
Disclaimer: I've never developed a package that directly requires a Linux package, but I use them a lot. In case more examples would help, this doc includes a script I use to install stuff on new Ubuntu machines. Some commands were stated explicitly in the package documentation; some had little or no documentation, and required research.
edit 2018-04-07:
I encountered my new favorite example: the sys package uses a config file to produce the following message in the R console. While installing 100+ packages on a new computer, it was nice to see this direct message, and not have to track down the R package and the documentation about its dependencies.
On Debian/Ubuntu this package requires AppArmor.
Please run: sudo apt-get install libapparmor-dev
Another good one is pdftools, that also uses a config file (and is also developed by Jeroen Ooms).
Secondary Issue: installing on Travis
The userfriendly travis config file apparently installs a lot of binaries directly (including gsl), unlike the current ggstatsplot version.
Alternatively, I'm more familiar with telling travis to install the linux package, as demonstrated by curl's config file. As a bonus, this probably more closely replicates what typical users do on their own machines.
addons:
apt:
packages:
- libcurl4-openssl-dev
Follow up 2018-03-13 Indrajeet and I tweaked the travis file so it's working. Two sections were changed in the yaml file:
The libgsl0-dev entry was added under the packages section (similar to the libcurl4-openssl-dev entry above).
Packages were listed in the r_binary_packages section so they install as binaries. The build was timing out after 50 minutes, and now it's under 10 min. In this particular package, the r_binary_packages section was nested in the Linux part of the Travis matrix so it wouldn't interfere with his two OS X jobs on Travis.

"rgdal" installation failed on ubuntu

I use travis to check my R package, it's based on a virtual machine of ubuntu. One of my dependencies is rgdal from CRAN, which cannot be installed correctly on travis.
First it said:
ERROR: dependencies ‘rgdal’ is not available for package ‘my package’
I followed the instruction here, then comes the endless dependencies, I installed one by one, according to the instruction of every trial. Finally I installed packages is as below:
libproj-dev
libcurl4-gnutls-dev
libdap-dev
libgdal-dev
libgdal1h
libhdf5-dev
libhdf5-serial-dev
libgdal-dev
libgdal1-dev
It said I still need to install libhdf5-7 = 1.8.11-3ubuntu1~precise1~ppa1
But when I install package libhdf5-7 = 1.8.11-3ubuntu1~precise1~ppa1, it gives another error:
E: Unable to locate package
E: Unable to locate package 1.8.11-3ubuntu1~precise1~ppa1
E: Couldn't find any package by regex '1.8.11-3ubuntu1~precise1~ppa1'
And it seems no more solutions now.
I wonder how to fix this on travis? Is it a common issue on only travis virtual machine or it could happen on any ubuntu machine? Or the package rgdal has some problems with ubuntu?`
Background:
All my installation above used apt-packages of travis, which is explained as below by travis:
apt_packages: A list of packages to install via apt-get. Common examples here include entries in SystemRequirements. This option is ignored on non-linux builds
As of this week, you can opt into using Ubuntu 14.04 on Travis:
See this blog post from Travis for details
See this .travis.yml where I enable Trusty aka 14.04
Switching to 14.04 may be enough in this case. If not, also note that you can prepare your own .deb packages. I mention this in an blog post from this summer.
As the geospatial packages are a little involved that is probably your best. You would need to know how to build Debian packages, and how to use Launchpad to have them auto-built for you. Both topics have lots of tutorials.

devtools::install_git Over SSH

I've written an R package that I keep in a (bare) git repository on an SSH server, and I want to be able to install it on a local machine without needing to clone the repository by hand.
I've attempted the following:
devtools::install_git("ssh://user_name#remote/path/to/repository")
but I get the error
Downloading git repo ssh://user_name#remote/path/to/repository
Error in git2r::clone(x$url, bundle, progress = FALSE) :
Error in 'git2r_clone': Failed to start SSH session: Unable to exchange encryption keys
I'm on a Windows 7 machine, using R 3.1.2, git2r version 0.11.0 and devtools version 1.9.1. Any help would be greatly appreciated. Thanks!
Ran into this issue myself. I know this question is a bit old, but for anybody else running into the same issue (like me), here's what I've found.
The Problem
Likely you don't have the library that git2r (the package that devtools uses to interact with git) uses to communicate over SSH.
The Solution
Install it. The example below assumes Ubuntu.
sudo apt-get install libssh2-1 libssh2-1-dev
git2r uses a library called LibSSH2 to enable transport over SSH. You can install it using your package manager if you're on Linux. NOTE if you're on Windows, git2r does not support the SSH protocol yet :/ As of git2r version 0.11.0 (which uses an updated version of libgit2) it looks like SSH is supported on Windows as well. As of this edit, the newest version of git2r is 0.15, so if you don't have SSH support on Windows, try updating git2r (shout out to zeehio for the news).
After you've installed LibSSH2 you'll need to reinstall the git2r package to enable SSH transport (since it's enabled/disabled during the package build).
Sources
Issues on GitHub:
https://github.com/hadley/devtools/issues/796
https://github.com/ropensci/git2r/issues/140
Why do I need LibSSH2 at all? git doesn't use it, right?
You're right! git doesn't use it (to my knowledge). However, libgit2, which is the pure C git API implementation that git2r uses, does.

Resources