dpkg: unable to make backup symlink for - linux

I'm setting up my new PC by chromebook.
When I do sudo apt-get update && sudo apt-get upgrade, this error is occured.
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
openssh-server : Depends: openssh-client (= 1:7.4p1-10+deb9u4) but 1:7.4p1-10+deb9u7 is installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
1.I do'sudo apt --fix-broken install'.
Then another error occured in dpkg.
The following packages will be upgraded: openssh-server
1 upgraded, 0 newly installed, 0 to remove and 32 not upgraded.
15 not fully installed or removed.
Need to get 0 B/289 kB of archives.
After this operation, 4,096 B of additional disk space will be used.
Do you want to continue? [Y/n] y
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 40252 files and directories currently installed.)
Preparing to unpack .../openssh-server_1%3a7.4p1-10+deb9u7_arm64.deb ...
Unpacking openssh-server (1:7.4p1-10+deb9u7) over (1:7.4p1-10+deb9u4) ...
dpkg: error processing archive /var/cache/apt/archives/openssh- server_1%3a7.4p1-10+deb9u7_arm64.deb (--unpack):
unable to make backup symlink for './usr/share/man/man5/authorized_keys.5.gz': No such file or directory
Errors were encountered while processing:
/var/cache/apt/archives/openssh-server_1%3a7.4p1-10+deb9u7_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
2.I do mkdir -r ./usr/share/man/man5.
But I cant.
3.I do ln -s /usr/share/man/man5/authorized_keys.5.gz ./usr/share/man/man5/authorized_keys.5.gz
But I cant.
How should I do?? :(

Sorry! self solved.
I re-installed dependency packages.
sudo apt remove --purge cros-sftp
sudo apt remove --purge cros-guest-tools
apt --fix-broken install

Related

Sub-process /usr/bin/dpkg returned an error code (1) When using sudo apt install --fix-broken

when trying to remove nodjs from my Ubuntu sudo apt-get remove nodejs
Getting error E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
When performing sudo apt install --fix-broken iam getting below error.
Any reason why iam getting this issue.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
linux-image-5.11.0-46-generic
Suggested packages:
fdutils linux-doc | linux-hwe-5.11-source-5.11.0 linux-hwe-5.11-tools
The following NEW packages will be installed:
linux-image-5.11.0-46-generic
0 upgraded, 1 newly installed, 0 to remove and 132 not upgraded.
4 not fully installed or removed.
Need to get 0 B/11.5 MB of archives.
After this operation, 11.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 208109 files and directories currently installed.)
Preparing to unpack .../linux-image-5.11.0-46-generic_5.11.0-46.51~20.04.1_amd64.deb ...
Unpacking linux-image-5.11.0-46-generic (5.11.0-46.51~20.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-5.11.0-46-
generic_5.11.0-46.51~20.04.1_amd64.deb (--unpack):
unable to open '/boot/vmlinuz-5.11.0-46-generic.dpkg-new': Operation not permitted
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-5.11.0-46-generic_5.11.0-46.51~20.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Try it:
apt clean
apt autoclean
cd /var/lib/dpkg/
mv info/ info_bak
mkdir info
apt-get update
apt-get -f install
mv info/* info_bak/
rm -rf info
mv info_bak info
I think this will solve your problem, execute all commands in order.

"mongodb-org : Depends: mongodb-org-server but it is not going to be installed" when installing mongodb in Ubuntu 20.04

I've committed the error of installing mongodb first by sudo apt install mongodb, removing it and then trying to install as the official documentation says so for Ubuntu 20.04 (Linux Mint), but now I can't install any other package because it gives me:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
mongodb-org : Depends: mongodb-org-server but it is not going to be installed
Depends: mongodb-org-mongos but it is not going to be installed
mongodb-org-tools : Depends: mongodb-database-tools but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Tried sudo apt reinstall sudo apt --fix-broken install sudo apt purge <package_name> sudo apt remove <package_name> sudo apt-get install -f
When running sudo apt install --fix-broken:
sudo apt install --fix-broken
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
mongodb-database-tools mongodb-org-mongos mongodb-org-server
The following NEW packages will be installed:
mongodb-database-tools mongodb-org-mongos mongodb-org-server
0 upgraded, 3 newly installed, 0 to remove and 1 not upgraded.
2 not fully installed or removed.
Need to get 0 B/89,2 MB of archives.
After this operation, 148 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 414079 files and directories currently installed.)
Preparing to unpack .../mongodb-org-server_4.4.6_amd64.deb ...
Unpacking mongodb-org-server (4.4.6) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-server_4.4.6_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongod', which is also in package mongodb-server-core 1:3.6.9+really3.6.8+90~g8e540c0b6
d-0ubuntu5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-org-mongos_4.4.6_amd64.deb ...
Unpacking mongodb-org-mongos (4.4.6) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-org-mongos_4.4.6_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mongos', which is also in package mongodb-server-core 1:3.6.9+really3.6.8+90~g8e540c0b6
d-0ubuntu5
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../mongodb-database-tools_100.3.1_amd64.deb ...
Unpacking mongodb-database-tools (100.3.1) ...
dpkg: error processing archive /var/cache/apt/archives/mongodb-database-tools_100.3.1_amd64.deb (--unpack):
trying to overwrite '/usr/bin/bsondump', which is also in package mongo-tools 3.6.3-0ubuntu1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/mongodb-org-server_4.4.6_amd64.deb
/var/cache/apt/archives/mongodb-org-mongos_4.4.6_amd64.deb
/var/cache/apt/archives/mongodb-database-tools_100.3.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
If I try to reinstall mongodb following the official doc it gives me again the same error I've mentioned before.
Thanks in advance.
This solved my problem;
dpkg -l | grep mongo will show the list of packages, then dpkg -r <nameofpkg> could be used for each packages for the output of dpkg -l | grep mongo.
Solved it.
sudo apt-get clean
sudo pkexec synaptic >> filter by "broken" >> remove completely the package
sudo apt-get install -f
Tanks for the help.

Error while installing python3 and pip3 in kali linux

I have use the following commands at the time of installation:
tar -xvf python-3.3.0.tgz
cd python-3.3.0
./configure
make
sudo make altinstall
sudo apt-get install python3-pip
Error:
root#kali:~/Desktop/Python-3.3.0# sudo apt-get install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libc-bin : Depends: libc6 (< 2.20) but 2.21-0ubuntu4 is to be installed
libc6-dbg : Depends: libc6 (= 2.19-18) but 2.21-0ubuntu4 is to be installed
python3-pip : Depends: python3-colorama but it is not going to be installed
Depends: python3-distlib but it is not going to be installed
Depends: python3-html5lib but it is not going to be installed
Depends: python3-requests but it is not going to be installed
Depends: python3-setuptools but it is not going to be installed
Recommends: python3-dev (>= 3.2) but it is not going to be installed
Recommends: python3-wheel but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
I have tried 'apt-get -f install' this command.
It gives following error:
root#kali:~/Desktop/Python-3.3.0# 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:
libc-bin libc6-dbg
The following packages will be upgraded:
libc-bin libc6-dbg
2 upgraded, 0 newly installed, 0 to remove and 1464 not upgraded.
3 not fully installed or removed.
Need to get 0 B/4,322 kB of archives.
After this operation, 2,792 kB disk space will be freed.
Do you want to continue? [Y/n] Y
WARNING: The following packages cannot be authenticated!
libc-bin libc6-dbg
Install these packages without verification? [y/N] y
Reading changelogs... Done
(Reading database ... 323301 files and directories currently installed.)
Preparing to unpack .../libc-bin_2.21-0ubuntu4_amd64.deb ...
Unpacking libc-bin (2.21-0ubuntu4) over (2.19-18) ...
dpkg: error processing archive /var/cache/apt/archives/libc-bin_2.21-0ubuntu4_amd64.deb (--unpack):
trying to overwrite '/usr/sbin/update-locale', which is also in package locales 2.19-18
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Processing triggers for man-db (2.7.0.2-5) ...
Errors were encountered while processing:
/var/cache/apt/archives/libc-bin_2.21-0ubuntu4_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
How to resolve this error?
And how to install requests package for python3
tar -xvf python-3.3.0.tgz
cd python-3.3.0
./configure
make
sudo make altinstall
Next:
Download get-pip.py form below URL.
https://bootstrap.pypa.io/get-pip.py
install this as a 'py' file. Go to Linux terminal type in
root# python get-pip.py
Assuming downloaded file is located in 'root'
Now it would work fine

apt-get error: Sub-process /usr/bin/dpkg returned an error code (1)

I have error in apt-get install
it is a error:
The following packages have unmet dependencies:
gcc-4.8-multilib : Depends: libc6-dev-i386 (>= 2.11) but it is not going to be installed
libc6-dev-x32 : Depends: libc6-dev-i386 (= 2.19-0ubuntu6.6) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
I try several command
like: apt-get -f install
apt-get clean
I try change my source list, and remake apt-get update
$ sudo apt-get install g++
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
gcc-4.8-multilib : Depends: libc6-dev-i386 (>= 2.11) but it is not going to be installed
libc6-dev-x32 : Depends: libc6-dev-i386 (= 2.19-0ubuntu6.6) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
in apt-get -f install
$ sudo 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:
libc6-dev-i386
The following NEW packages will be installed:
libc6-dev-i386
0 upgraded, 1 newly installed, 0 to remove and 434 not upgraded.
3 not fully installed or removed.
Need to get 0 B/1.148 kB of archives.
After this operation, 6.333 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 194963 files and directories currently installed.)
Preparing to unpack .../libc6-dev-i386_2.19-0ubuntu6.6_amd64.deb ...
Unpacking libc6-dev-i386 (2.19-0ubuntu6.6) ...
dpkg: error processing archive /var/cache/apt/archives/libc6-dev-i386_2.19-0ubuntu6.6_amd64.deb (--unpack):
trying to overwrite '/usr/include/bits', which is also in package libc6-dev-amd64 2.19-0ubuntu6.6
Errors were encountered while processing:
/var/cache/apt/archives/libc6-dev-i386_2.19-0ubuntu6.6_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
The same dpkg error is also possible when uninstalling:
apt-get uninstall
and
apt-get purge
First, uninstall the package:
rm -f /var/lib/dpkg/info/<package-name>*
apt-get purge <package-name>
Afterwards you can re-install it:
apt-get install <package-name>
Try this. Open a new terminal and paste it
sudo dpkg -i --force-overwrite /var/cache/apt/archives/libc6-dev-i386_2.19-0ubuntu6.6_amd64.deb
After that type:
sudo apt-get autoremove
Lastly type
sudo apt-get update
hope your problem will be solved.
none of the solutions i could find solved the problem for me...still broken packes, no matter the autoremove, -f install ... and so forth.
After playing around a little, the following solved it for me:
sudo apt-get --purge remove libc6-dev-i386 libc6-dev-x32 gcc-5-multilib gcc-multilib
sudo apt autoremove -f
sudo apt-get -f install
Try the following steps from the terminal :
sudo apt-get --purge remove libc6-dev-amd64
sudo apt-get -f install
sudo apt-get update
Hope this will fix your issues.
Try is to reconfigure the package database. Probably the database got corrupted while installing a package.
sudo dpkg --configure -a
I found my solution, because the others quoted below did not work. Generally, it is a conflict with a dependency already installed.
I solved this problem with these command for recreate blank configuration (debian) :
sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_silent
sudo mkdir /var/lib/dpkg/info
sudo apt-get update
sudo apt-get -f install <xxxx>
It looks like you have installed libc6-dev-amd64 and you are trying to install packages that depend on libc6-dev-i386, and these two are in conflict (they both contain /usr/include/bits).
My guess is you don't want both of these installed at the same time. I would use apt-get remove libc6-dev-amd64 to get yourself back to a good state, and then try again to install the packages that you want.
If those two packages are meant to work when they're both installed at the same time, then file a bug with the package maintainer because they need to fix the packages to allow that.
When the upgrade command (sudo apt-get upgrade -y) is run in Ubuntu 18.04.3 (With Linux kernel version 5.7.14) the following errors get reported (in red):
... bind /var/run/spice-vdagentd/spice-vdagent-sock: No such file or directory
... Fatal could not create server socket /var/run/spice-vdagentd/spice-vdagent-sock
...
... Failed to start Agent daemon for Spice guests.
The following steps fixed the issue:
Make spice-vdagentd directory if it does not exist:
> sudo mkdir /var/run/spice-vdagentd (if it does not exist)
Open a new file spice-vdagent-sock
> sudo vi /var/run/spice-vdagentd/spice-vdagent-sock
Save the file by running: :wq
Re-run the upgrade command to verify that the issue is fixed.
Using below steps my problem resolve in "Oracle VM VirtualBox Manager"
apt autoremove
apt purge libreoffice-base libreoffice-core
dpkg -l "libreoffice" | grep "^ii"
sudo dpkg --configure -a
sudo apt-get install -f
now you can try to install - pip3 install jupyter etc.
You can fix this problem with this command:
sudo apt-get remove --purge libreoffice-core libreoffice-common
python3-uno libreoffice-*

dpkg:- error processing package javascript-common (--configure):- while using apt-get command

I was trying to reinstall my apache 2 after un-installing it. But on installing it using command-
sudo apt-get install apache2
i am getting error-
Error while installing apache2
rahul#rahulpc:~$ sudo apt-get clean && sudo apt-get autoclean
[sudo] password for rahul:
Reading package lists... Done
Building dependency tree
Reading state information... Done
rahul#rahulpc:~$ sudo apt-get --reinstall install apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libblas3 liblinear-tools liblinear1
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 474 not upgraded.
1 not fully installed or removed.
Need to get 87.4 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main apache2 amd64 2.4.7-1ubuntu4.4 [87.4 kB]
Fetched 87.4 kB in 3s (28.0 kB/s)
(Reading database ... 172062 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.7-1ubuntu4.4_amd64.deb ...
Unpacking apache2 (2.4.7-1ubuntu4.4) over (2.4.7-1ubuntu4.4) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Processing triggers for ufw (0.34~rc-0ubuntu2) ...
Processing triggers for man-db (2.6.7.1-1) ...
Setting up javascript-common (11) ...
dpkg: error processing package javascript-common (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up apache2 (2.4.7-1ubuntu4.4) ...
/etc/init.d/apache2: 64: .: Can't open /etc/apache2/envvars
/etc/init.d/apache2: 76: .: Can't open /etc/apache2/envvars
ERROR: APACHE_PID_FILE needs to be defined in /etc/apache2/envvars
invoke-rc.d: initscript apache2, action "restart" failed.
Errors were encountered while processing:
javascript-common
E: Sub-process /usr/bin/dpkg returned an error code (1)
Also when i run command-
sudo apt-get upgrade
i am getting same error,I think i have removed some essential directories while un-installing apache 2 . Anybody please help me to recover the files and to install apache 2.
Finally i solved the error by running commands-
sudo apt-get clean && sudo apt-get autoclean
sudo apt-get purge apache2
sudo apt-get install apache2
No need to reinstall apache2 (and with purge deleting all configs). Just do:
sudo apt-get purge javascript-common
sudo apt-get install javascript-common

Resources