1

I used sudo dpkg --configure -a but it shows like below.

dpkg: dependency problems prevent configuration of r-cran-class:
 r-cran-class depends on r-base-core (>= 3.5.0-1); however:
  Package r-base-core is not configured yet.
 r-cran-class depends on r-api-3.5; however:
  Package r-api-3.5 is not installed.
  Package r-base-core which provides r-api-3.5 is not configured yet

How do I fix it?

Output of apt depends r-cran-class:

r-cran-class
  Depends: r-base-core
  Depends: r-cran-mass
  Depends: libc6 (>= 2.4)

Output of apt-cache policy r-cran-class:

r-cran-class:
  Installed: 7.3-15-1cran1ppabionic0
  Candidate: 7.3-15-1cran1ppabionic0
  Version table:
 *** 7.3-15-1cran1ppabionic0 500
        500 http://ppa.launchpad.net/marutter/c2d4u3.5/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status
     7.3-15-1bionic0 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        500 http://ppa.launchpad.net/marutter/rrutter3.5/ubuntu bionic/main amd64 Packages
     7.3-14-2xenial0 500
        500 http://cran.rstudio.com/bin/linux/ubuntu xenial/ Packages
     7.3-14-2cranArtful0~ubuntu18.04.1~ppa1 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     7.3-14-2build1 500
        500 http://bd.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
     7.3-14-1xenial0 500
        500 http://cran.rstudio.com/bin/linux/ubuntu xenial/ Packages

Output of apt-cache policy r-api-3.5:

r-api-3.5:
  Installed: (none)
  Candidate: (none)
  Version table:

Output of sudo dpkg --configure r-base-core:

Setting up r-base-core (3.6.1-1bionic) ...
dpkg: error processing package r-base-core (--configure):
 installed r-base-core package post-installation script subprocess returned error exit status 10
Errors were encountered while processing:
 r-base-core

Output of sudo apt install --reinstall r-base-core:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 2 not upgraded.
20 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
E: Internal Error, No file name for r-base-core:amd64

Output of apt-cache policy r-base-core:

r-base-core:
  Installed: 3.6.1-1bionic
  Candidate: 3.6.1-1bionic
  Version table:
 *** 3.6.1-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
        100 /var/lib/dpkg/status
     3.6.0-2bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.6.0-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.3.20190412-1~ubuntu18.04.1~ppa1 500
        500 http://ppa.launchpad.net/marutter/rdev/ubuntu bionic/main amd64 Packages
     3.5.3-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.2-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.1-2bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.1-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.5.0-1bionic 500
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
     3.4.4-1xenial0 500
        500 http://cran.rstudio.com/bin/linux/ubuntu xenial/ Packages
     3.4.4-1ubuntu1 500
        500 http://bd.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
     3.4.3-1xenial0 500
        500 http://cran.rstudio.com/bin/linux/ubuntu xenial/ Packages
     3.4.2-2xenial2 500
        500 http://cran.rstudio.com/bin/linux/ubuntu xenial/ Packages
     3.4.2-1xenial1 500
        500 http://cran.rstudio.com/bin/linux/ubuntu xenial/ Packages
     3.4.1-2xenial0 500
        500 http://cran.rstudio.com/bin/linux/ubuntu xenial/ Packages
     3.4.1-1xenial0 500
        500 http://cran.rstudio.com/bin/linux/ubuntu xenial/ Packages
     3.4.0-1xenial0 500
        500 http://cran.rstudio.com/bin/linux/ubuntu xenial/ Packages
     3.3.3-1xenial0 500
        500 http://cran.rstudio.com/bin/linux/ubuntu xenial/ Packages
     3.3.2-1xenial0 500
        500 http://cran.rstudio.com/bin/linux/ubuntu xenial/ Packages
     3.3.1-1xenial0 500
        500 http://cran.rstudio.com/bin/linux/ubuntu xenial/ Packages
     3.3.0-2xenial0 500
        500 http://cran.rstudio.com/bin/linux/ubuntu xenial/ Packages
     3.3.0-1xenial0 500
        500 http://cran.rstudio.com/bin/linux/ubuntu xenial/ Packages
     3.2.5-1xenial 500
        500 http://cran.rstudio.com/bin/linux/ubuntu xenial/ Packages
W: Target Packages (non-free/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:91 and /etc/apt/sources.list.d/opera-stable.list:4
W: Target Packages (non-free/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:91 and /etc/apt/sources.list.d/opera-stable.list:4
W: Target Packages (non-free/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:91 and /etc/apt/sources.list.d/opera-stable.list:4
W: Target Translations (non-free/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:91 and /etc/apt/sources.list.d/opera-stable.list:4
W: Target Translations (non-free/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:91 and /etc/apt/sources.list.d/opera-stable.list:4
W: Target DEP-11 (non-free/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:91 and /etc/apt/sources.list.d/opera-stable.list:4
W: Target DEP-11 (non-free/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:91 and /etc/apt/sources.list.d/opera-stable.list:4
W: Target DEP-11-icons-small (non-free/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:91 and /etc/apt/sources.list.d/opera-stable.list:4
W: Target DEP-11-icons (non-free/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:91 and /etc/apt/sources.list.d/opera-stable.list:4
W: Target CNF (non-free/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:91 and /etc/apt/sources.list.d/opera-stable.list:4
W: Target CNF (non-free/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:91 and /etc/apt/sources.list.d/opera-stable.list:4

After removing xenial and cloud.r-project.org from /etc/apt/sources.list and used wget https://mirrors.edge.kernel.org/ubuntu/pool/universe/r/r-base/r-base-core_3.4.4-1ubuntu1_amd64.deb then the sources.list file looks like..

# deb cdrom:[Ubuntu 18.04.2 LTS _Bionic Beaver_ - Release amd64 (20190210)]/ bionic main restricted
# deb cdrom:[Ubuntu 18.04.1 LTS _Bionic Beaver_ - Release amd64 (20180725)]/ bionic main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://bd.archive.ubuntu.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://bd.archive.ubuntu.com/ubuntu/ bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://bd.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://bd.archive.ubuntu.com/ubuntu/ bionic universe
deb http://bd.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://bd.archive.ubuntu.com/ubuntu/ bionic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://bd.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://bd.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://bd.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://bd.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://bd.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner

# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse
deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main
# deb-src https://dl.winehq.org/wine-builds/ubuntu/ bionic main

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
# deb-src http://bd.archive.ubuntu.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
# deb-src http://bd.archive.ubuntu.com/ubuntu/ bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
# deb-src http://bd.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://bd.archive.ubuntu.com/ubuntu/ bionic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
# deb-src http://bd.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://bd.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb-src http://bd.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner

deb http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse
# deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse
deb [arch=i386,amd64] https://deb.opera.com/opera-stable/ stable non-free
# deb-src [arch=i386,amd64] https://deb.opera.com/opera-stable/ stable non-free
deb http://cran.rstudio.com/bin/linux/ubuntu bionic/
# deb-src http://cran.rstudio.com/bin/linux/ubuntu bionic/

But when i run sudo dpkg -i r-base-core_3.4.4-1ubuntu1_amd64.deb then it showed:

mp@mp:~$ sudo dpkg -i r-base-core_3.4.4-1ubuntu1_amd64.deb
[sudo] password for mp: 
dpkg: warning: downgrading r-base-core from 3.5.3.20190412-1~ubuntu18.04.1~ppa1 to 3.4.4-1ubuntu1
dpkg: warning: files list file for package 'fonts-sil-abyssinica' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libatk-adaptor:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libvorbisfile3:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libquadmath0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxkbfile1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'linux-sound-base' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'xserver-xorg-video-amdgpu-hwe-18.04' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'python-apt-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgs9-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libnpth0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libqt5qml5:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgtk2.0-bin' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libkf5config-data' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'xserver-xorg-video-radeon-hwe-18.04' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'python-pip-whl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libkf5archive5:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'imagemagick-6-common' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gir1.2-goa-1.0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libglib-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgstreamer-plugins-base1.0-0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libslf4j-java' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libapt-pkg5.0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libaudit1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'xcursor-themes' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libglvnd0:amd64' missing; 
dpkg: warning: files list file for package 'libwacom-bin' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gir1.2-keybinder-3.0' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libcaca-dev' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gtk-update-icon-cache' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libsnapd-glib1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'sensible-utils' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpixman-1-0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'python-gi' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libjline2-java' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gnome-mahjongg' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'acpid' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gir1.2-dbusmenu-glib-0.4:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'grilo-plugins-0.3-base:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'xtrans-dev' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libmp3lame0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'fonts-mlym' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libservlet3.1-java' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'geoclue-2.0' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libblas3:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgl1-mesa-dev:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'python3-protobuf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'fonts-sil-padauk' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'language-pack-en' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxcb-dri3-dev:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libkf5sonnetcore5:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'dpkg-dev' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'python-six' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gir1.2-glib-2.0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libdbusmenu-gtk4:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'x11proto-xext-dev' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libqt5quicktemplates2-5:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'sonnet-plugins' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libjpeg-turbo8-dev:amd64' missing; assuming package has no files currently installed
 assuming package has no files currently installed
dpkg: warning: files list file for package 'libqtdbus4:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libkeybinder-3.0-0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxcb-xkb1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libsimple-http-java' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libavahi-core7:amd64' missing; assuming package has no files currently installed
(Reading database ... 11859 files and directories currently installed.)
Preparing to unpack r-base-core_3.4.4-1ubuntu1_amd64.deb ...
Unpacking r-base-core (3.4.4-1ubuntu1) over (3.5.3.20190412-1~ubuntu18.04.1~ppa1) ...
Setting up r-base-core (3.4.4-1ubuntu1) ...
Installing new version of config file /etc/R/Makeconf ...
Installing new version of config file /etc/R/Renviron.site ...
Installing new version of config file /etc/R/repositories ...
dpkg: error processing package r-base-core (--install):
 installed r-base-core package post-installation script subprocess returned error exit status 10
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for install-info (6.5.0.dfsg.1-2) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Errors were encountered while processing:
 r-base-core

Now suddenly ubuntu software Software Updater showed an error message like:

The package system is broken

Check if you are using third party repositories. If so disable them, since they are a common source of problems.
Furthermore run the following command in a Terminal: apt-get install -f
Transaction failed: The package system is broken
 The following packages have unmet dependencies:

r-cran-foreign: Depends: libc6 (>= 2.14) but 2.27-3ubuntu1 is installed
                Depends: r-base-core (>= 3.5.1-1bionic) but 3.4.4-1ubuntu1 is installed
                Depends: r-api-3.5 but it is a virtual package
r-cran-kernsmooth: Depends: r-base-core (>= 3.5.0-1bionic) but 3.4.4-1ubuntu1 is installed
                   Depends: r-api-3.5 but it is a virtual package
r-cran-nnet: Depends: r-api-3.5 but it is a virtual package
r-cran-spatial: Depends: r-api-3.5 but it is a virtual package

I think i need to remove 3.4.4-1ubuntu1, 2.27-3ubuntu1 and install sudo dpkg -i r-base-core_3.5.1-1bionic_amd64.deb Am i right?

2 Answers2

1

Let's fix the issues one by one.

  1. Remove r-base-core:

    Run

    sudo apt autoremove r-base-core
    
  2. W: Target CNF (non-free/cnf/Commands-all) is configured multiple times

    The easiest way to solve this issue is following David's Script. But if you don't want to follow that script and since you have issue in single line, you can simply run,

    sudo sed -i '4d' /etc/apt/sources.list.d/opera-stable.list
    
  3. Remove PPAs of some other release.

    Since you are using Bionic Beaver (18.04), Xenial Xerus's (16.04) PPA information won't help in anyway and might create dependency problems in future. I would suggest removing or commenting them. Run

    grep "xenial" /etc/apt/sources.list /etc/apt/sources.list.d/*
    

    It would generate output which would help you to determine those files. Edit them using sudo privileges and some editor such as nano and put a # in front of them. To open them run

    sudo nano filename
    

    Save them using Ctrl+X followed by Y. If those files contain a single line only which is of xenial, you may delete that.

  4. dpkg: warning: files list file for package 'x' missing; assuming package has no files currently installed

    Copy whole error message in some text file, say 1.txt and run

    for package in $(cat 1.txt | grep "warning: files list file" | sed "s/.*\`//; s/'.*//"); do echo "$package"; done >> 2.txt
    

    Credits: zaTricky's answer on dpkg: warning: files list file for package 'x' missing

    Copy all packages name and run

    sudo apt install --reinstall packages_name
    

    You can reinstall multiple packages by pasting multiple packages' name in one command.

  5. Configure (if some left):

    Run:

    sudo dpkg --configure -a
    sudo apt update
    sudo apt upgrade
    
  6. Install r-base:

    Run

    sudo apt install r-base
    
Kulfy
  • 17,696
0

A mix between bionic xenial artful and ppa packages.

Remove under /etc/apt/sources.list.d/ any file with xenial or artful in name.

Control in /etc/apt/sources.list That every row leads to a bionic source.

sudo add-apt-repository -r ppa:marutter/rrutter3.5 

removes that ppa.

You have another on cloud.r-project.org/bin/linux/ubuntu bionic-cran35 for that packages. I'am not sure if this works. sudo apt update && sudo apt-get clean

sudo apt -f install --reinstall r-cran-class=7.3-15-1bionic0

If is not working wget -c https://cloud.r-project.org/bin/linux/ubuntu/bionic-cran35/r-cran-class_7.3-15-1bionic0_amd64.deb for 64-bit or wget -c https://cloud.r-project.org/bin/linux/ubuntu/bionic-cran35/r-cran-class_7.3-15-1bionic0_i386.deb for 32-bit system. Install it directly with sudo dpkg -i /path/to/your deb sudo dpkg --configure -a && sudo apt -f install

nobody
  • 5,437