unable to run apt-get -f install on debian - apt

I have a system that is due to be upgraded but I'm having conflicts with apt-get -f install:
apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
login sysvinit-utils util-linux
Suggested packages:
kbd util-linux-locales
The following packages will be upgraded:
login sysvinit-utils util-linux
3 upgraded, 0 newly installed, 0 to remove and 106 not upgraded.
13 not fully installed or removed.
Need to get 0 B/1775 kB of archives.
After this operation, 1886 kB of additional disk space will be used.
Do you want to continue? [Y/n]
E: Sub-process false returned an error code (1)
E: Prior errors apply to /var/cache/apt/archives/sysvinit-utils_2.96-7_arm64.deb
E: Prior errors apply to /var/cache/apt/archives/util-linux_2.36.1-8_arm64.deb
E: Prior errors apply to /var/cache/apt/archives/login_1%3a4.8.1-1_arm64.deb
debconf: apt-extracttemplates failed: No such file or directory
(Reading database ... 9765 files and directories currently installed.)
Preparing to unpack .../sysvinit-utils_2.96-7_arm64.deb ...
Unpacking sysvinit-utils (2.96-7) over (2.88dsf-59) ...
dpkg: error processing archive /var/cache/apt/archives/sysvinit-utils_2.96-7_arm64.deb (--unpack):
trying to overwrite '/lib/init/vars.sh', which is also in package initscripts 2.88dsf-59
Errors were encountered while processing:
/var/cache/apt/archives/sysvinit-utils_2.96-7_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I don't understand why it says E: Sub-process false returned an error code (1) after I confirm installation of the packages. Can anyone help me with this?

initscripts is a purely virtual package, so it is safe to give dpkg permission to overwrite it. Open the terminal and type:
sudo dpkg -i --force-overwrite /var/cache/apt/archives/sysvinit-utils_2.96-7_arm64.deb
If you're not using dpkg directly and using an apt front-end like apt or apt-get, the following command defines the same custom dpkg option to use as the previous command.
sudo apt-get -o Dpkg::Options::="--force-overwrite" install sysvinit-utils

Try to flush the cache and reinstall then :
apt autoremove
apt clean
apt autoclean
apt update
apt install -f
if it doesn't help, try to remove the problematic packages and reinstall them normally.

Related

Cannot install update-notifier-common in Ubuntu pyxis container

I'm trying to set up a script that initialises my Ubuntu pyxis container:
#!/usr/bin/env bash
# Python and nano
apt-get update
apt-get install -y software-properties-common python3-pip python3-tk nano
# Fonts
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections # Automatically accept EULA
echo ttf-mscorefonts-installer msttcorefonts/present-mscorefonts-eula note | debconf-set-selections # Automatically accept EULA
apt-get install -y msttcorefonts
rm -r ~/.cache/matplotlib 2>/dev/null
# Required python packages
pip3 install joblib matplotlib numpy pillow scikit-learn scipy tqdm
I run this script with
srun --container-image ubuntu:latest /root/setup_container.sh >~/setup_container.log 2>&1
However, the installation of the MS fonts package fails due to update-notifier-common not being configured correctly. The key part of the log file is below (I also uploaded the entire log file here).
...
Setting up update-notifier-common (3.192.30.9) ...
chown: invalid user: ‘_apt:root’
dpkg: error processing package update-notifier-common (--configure):
installed update-notifier-common package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of ttf-mscorefonts-installer:
ttf-mscorefonts-installer depends on update-notifier-common (>= 0.119ubuntu2); however:
Package update-notifier-common is not configured yet.
dpkg: error processing package ttf-mscorefonts-installer (--configure):
dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.31-0ubuntu9.2) ...
Errors were encountered while processing:
update-notifier-common
ttf-mscorefonts-installer
W: No sandbox user '_apt' on the system, can not drop privileges
E: Sub-process /usr/bin/dpkg returned an error code (1)
...
Since the log contains an error message about an invalid _apt:root user, and I was also getting No sandbox user 'apt' warnings elsewhere in the log file, I tried to create an _apt user myself, but that brought on new errors:
#!/usr/bin/env bash
# _apt user
adduser _apt --home /nonexistent --system --no-create-home --force-badname
usermod -aG sudo _apt
usermod -aG root _apt
# Python and nano
apt-get update
apt-get install -y software-properties-common python3-pip python3-tk nano
# Fonts
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections # Automatically accept EULA
echo ttf-mscorefonts-installer msttcorefonts/present-mscorefonts-eula note | debconf-set-selections # Automatically accept EULA
apt-get install -y msttcorefonts
rm -r ~/.cache/matplotlib 2>/dev/null
⠀
Warning: The home dir /nonexistent you specified can't be accessed: No such file or directory
Allowing use of questionable username.
Adding system user `_apt' (UID 100) ...
Adding new user `_apt' (UID 100) with group `nogroup' ...
Not creating home directory `/nonexistent'.
Reading package lists...
E: Method gave invalid 400 URI Failure message: Could not switch group
E: Method gave invalid 400 URI Failure message: Could not switch group
E: Method http has died unexpectedly!
E: Sub-process http returned an error code (112)
E: Method http has died unexpectedly!
E: Sub-process http returned an error code (112)
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package software-properties-common
E: Unable to locate package python3-pip
E: Unable to locate package python3-tk
E: Unable to locate package nano
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package msttcorefonts
/root/GE/setup_container.sh: line 19: pip3: command not found
/root/GE/setup_container.sh: line 21: pip3: command not found
srun: error: gpu01: task 0: Exited with exit code 127
How do I get update-notifier-common (and subsequently msttcorefonts) to install properly?
I managed to resolve the issue by manually downloading and installing the msttcorefonts package, as apparently the version on the Ubuntu repo is currently broken.
apt-get install -y wget
wget http://ftp.de.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.8_all.deb -O ~/msfonts.deb
apt-get install -y ~/msfonts.deb
rm ~/msfonts.deb

Why i can't install RStudio in ubuntu 19.04?

I can't install RStudio in Ubuntu 19.04, it gives me the following error in the terminal, I really appreciate the guidance you can give me, thanks
$ sudo dpkg -i rstudio-1.2.5042-amd64.deb
(Reading database ... 302725 files and directories currently installed.)
Preparing to unpack rstudio-1.2.5042-amd64.deb ...
Unpacking rstudio (1.2.5042) over (1.2.5042) ...
dpkg: dependency problems prevent configuration of rstudio:
rstudio depends on libclang-dev; however:
Package libclang-dev is not installed.
dpkg: error processing package rstudio (--install):
dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.32.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-4ubuntu1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for shared-mime-info (1.10-1) ...
Errors were encountered while processing:
rstudio
libclang-dev depends of libclang-8-dev -> libobjc-8-dev -> libobjc4-dev
Try sudo apt-get install gdebi-core and then sudo gdebi rstudio-1.2.5042-amd64.deb. gdebi will install the dependencies automatically for you.
There is another way with apt if you don't want to install gdebi; I believe the syntax is sudo apt install ./rstudio-1.2.5042-amd64.deb.
Alternatively, if you already forced dpkg to install the package, you can run sudo apt-get --fix-broken install to install the dependencies.
Try install version
rstudio-xenial-1.1.456-amd64.deb in
https://www.rstudio.org/download/daily/desktop/ubuntu64/
Bro!

Aptitude has unmet dependencies and encounters a segmentation fault when performing the recommended fix. How do I fix it?

I am on Ubuntu 17.10, freshly installed and tried to installed Ruby using apt-get install ruby-full. It failed to install and now aptitude says
The following packages have unmet dependencies:
ri: Depends: ruby2.3-doc but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specifiy a solution).
I tried the suggested command as well as sudo apt-get install -f -y to no avail: It begins the install process then tells me there was an error processing the ruby2.3-doc archive
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
ruby2.3-doc
The following NEW packages will be installed:
ruby2.3-doc
0 upgraded, 1 newly installed, 0 to remove and 17 not upgraded.
21 not fully installed or removed.
Need to get 0 B/3,382 kB of archives.
After this operation, 27.7 MB of additional disk space will be used.
(Reading database ... 182724 files and directories currently installed.)
Preparing to unpack .../ruby2.3-doc_2.3.3-1ubuntu1_all.deb ...
Unpacking ruby2.3-doc (2.3.3-1ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/ruby2.3-doc_2.3.3-1ubuntu1_all.deb (--unpack):
unable to open '/usr/share/ri/2.3.0/system/page-ChangeLog-2_1_0.ri.dpkg->new': Operation not permitted
Errors were encountered while processing:
/var/cache/apt/archives/ruby2.3-doc_2.3.3-1ubuntu1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I tried clearing aptitude's cache in case a package failed to download correctly but that did not fix it.
Because this means there are unmet dependencies, I'm unable to run other aptitude operations to try and install new packages or remove ruby-full.
How can I remove this ruby-full package so I can try again using rvm?
I ended up removing ri, ruby-full, and the other packages mentioned then ran apt-get update.

sudo apt-get install zip - error

I am trying to install a library zip.
How to fix it? Thank you for your help.
How to fix it? Thank you for your help.
However receives this error:
root#vps300197:~# sudo apt-get install zip
Reading package lists... Done
Building dependency tree
Reading state information... Done
zip is already the newest version (3.0-11).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up nginx-core (1.10.0-0ubuntu0.16.04.2) ...
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.
invoke-rc.d: initscript nginx, action "start" failed.
dpkg: error processing package nginx-core (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of nginx:
nginx depends on nginx-core (>= 1.10.0-0ubuntu0.16.04.2) | nginx-full (>= 1.10. 0-0ubuntu0.16.04.2) | nginx-light (>= 1.10.0-0ubuntu0.16.04.2) | nginx-extras (> = 1.10.0-0ubuntu0.16.04.2); however:
Package nginx-core is not configured yet.
Package nginx-full is not installed.
Package nginx-light is not installed.
Package nginx-extras is not installed.
nginx depends on nginx-core (<< 1.10.0-0ubuntu0.16.04.2.1~) | nginx-full (<< 1. 10.0-0ubuntu0.16.04.2.1~) | nginx-light (<< 1.10.0-0ubuntu0.16.04.2.1~) | nginx- extras (<< 1.10.0-0ubuntu0.16.04.2.1~); however:
Package nginx-core is not configured yet.
Package nginx-full is not installed.
Package nginx-light is not installed.
Package nginx-extras is not installed.
dpkg: error processing packagNo apport report written because the error message indicates its a followup error from a previous failure.
e nginx (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
nginx-core
nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)
As a root user, you don't need sudo before any command you want to run.
Normally, you should not use the root account to work on your server, it is very dangerous.
If you want install library zip, you should use apt-get install libzip, not
apt-get install zip. Zip is already the newest version (3.0-11) on you system.
According to the system output information, it seems to be there's some problems with you nginx installation.
Try sudo apt-get -f install or sudo apt-get remove nginx* && sudo apt-get install nginx-full

Trouble installing libaio-dev

This is error code I get. I'm using mint Debian edition
apt-get install libaio-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
libaio-dev
0 upgraded, 1 newly installed, 0 to remove and 983 not upgraded.
18 not fully installed or removed.
N eed to get 0 B/25.5 kB of archives.
After this operation, 143 kB of additional disk space will be used.
(Reading database ... 170878 files and directories currently installed.)
Unpacking libaio-dev (from .../libaio-dev_0.3.109-2_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/libaio-dev_0.3.109-2_amd64.deb (--unpack):
trying to overwrite '/usr/share/man/man2/io_getevents.2.gz', which is also in package manpages-dev 3.28-1
configured to not write apport reports
Processing triggers for man-db ...
Errors were encountered while processing:
/var/cache/apt/archives/libaio-dev_0.3.109-2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo apt-get remove manpages-dev
sudo apt-get install libaio-dev manpages-dev

Resources