Unable to install python3-tk on Ubuntu 18.04.2 LTS - python-3.x

I am running Ubuntu 18.04.2 LTS:
user#vmubu01:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
And I am unable to install python3-tk using 'apt-get install' command as you can see below:
user#vmubu01:~$ sudo apt-get install python3-tk
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
tix python3-tk-dbg
The following NEW packages will be installed:
python3-tk
0 upgraded, 1 newly installed, 0 to remove and 91 not upgraded.
3 not fully installed or removed.
Need to get 0 B/101 kB of archives.
After this operation, 891 kB of additional disk space will be used.
(Reading database ... 206924 files and directories currently installed.)
Preparing to unpack .../python3-tk_3.6.8-1~18.04_amd64.deb ...
Unpacking python3-tk:amd64 (3.6.8-1~18.04) ...
dpkg: error processing archive /var/cache/apt/archives/python3-tk_3.6.8-1~18.04_amd64.deb (--unpack):
trying to overwrite '/usr/lib/python3.6/tkinter/__init__.py', which is also in package libpython3.6-stdlib:amd64 3.6.8-1+xenial1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/python3-tk_3.6.8-1~18.04_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I am also unable to install it using pip, see the error below:
user#vmubu01:~$ pip3.6 install python3-tk
Collecting python3-tk
ERROR: Could not find a version that satisfies the requirement python3-tk (from versions: none)
ERROR: No matching distribution found for python3-tk
If I try to run the 'apt --fix-broken install' command I get:
user#vmubu01:~$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
python3-tk
Suggested packages:
tix python3-tk-dbg
The following NEW packages will be installed:
python3-tk
0 upgraded, 1 newly installed, 0 to remove and 91 not upgraded.
3 not fully installed or removed.
Need to get 0 B/101 kB of archives.
After this operation, 891 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 206924 files and directories currently installed.)
Preparing to unpack .../python3-tk_3.6.8-1~18.04_amd64.deb ...
Unpacking python3-tk:amd64 (3.6.8-1~18.04) ...
dpkg: error processing archive /var/cache/apt/archives/python3-tk_3.6.8-1~18.04_amd64.deb (--unpack):
trying to overwrite '/usr/lib/python3.6/tkinter/__init__.py', which is also in package libpython3.6-stdlib:amd64 3.6.8-1+xenial1
Errors were encountered while processing:
/var/cache/apt/archives/python3-tk_3.6.8-1~18.04_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I please advise

Not sure this solution fits for every situation, but here is one that worked for me.
I had the same issue (except it was with Ubuntu 16.04), also tried what #Column01 wrote in comments:
sudo apt-get install python3.6-tk
Same problem.
But that gave me an idea. Checked:
$ python --version
Python 3.5.2
So the solution was as simple as:
sudo apt-get install python3.5-tk

Related

How to handle the errors during libwebkitgtk installation on Ubuntu 18.04 LTS?

Every time I tries to install something on Ubuntu using sudo apt-get install ..., it shows like that:
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:
libwebkit2gtk-4.0-37 : Depends: libjavascriptcoregtk-4.0-18 (= 2.32.3-0ubuntu0.18.04.1) but 2.32.4-0ubuntu0.18.04.1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
First I tried to sudo apt-get install libwebkit2gtk-4.0-37, it shows like that:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libexiv2-14 libgee-0.8-2 libgexiv2-2 libraw16 linux-hwe-5.4-headers-5.4.0-66
linux-hwe-5.4-headers-5.4.0-67 linux-hwe-5.4-headers-5.4.0-73
linux-hwe-5.4-headers-5.4.0-74 shotwell-common
Use 'sudo apt autoremove' to remove them.
Suggested packages:
libwebkit2gtk-4.0-37-gtk2
The following packages will be upgraded:
libwebkit2gtk-4.0-37
1 upgraded, 0 newly installed, 0 to remove and 206 not upgraded.
43 not fully installed or removed.
Need to get 0 B/13.4 MB of archives.
After this operation, 81.9 kB of additional disk space will be used.
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
<ignoring for a long long list>
Preparing to unpack .../libwebkit2gtk-4.0-37_2.32.4-0ubuntu0.18.04.1_amd64.deb ...
Unpacking libwebkit2gtk-4.0-37:amd64 (2.32.4-0ubuntu0.18.04.1) over (2.32.3-0ubuntu0.18.04.1) ...
dpkg-deb (subprocess): decompressing archive member: lzma error: compressed data is corrupt
dpkg-deb: error: <decompress> subprocess returned error exit status 2
dpkg: error processing archive /var/cache/apt/archives/libwebkit2gtk-4.0-37_2.32.4-0ubuntu0.18.04.1_amd64.deb (--unpack):
cannot copy extracted data for './usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37.53.5' to '/usr/lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37.53.5.dpkg-new': unexpected end of file or stream
Errors were encountered while processing:
/var/cache/apt/archives/libwebkit2gtk-4.0-37_2.32.4-0ubuntu0.18.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Then I thought that since it says but 2.32.4-0ubuntu0.18.04.1 is to be installed, so I tries uninstalling it using sudo apt-get purge 2.32.4-0ubuntu0.18.04.1, and things goes like that: (I don't know what the 2.32.4-0ubuntu0.18.04.1 means)
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package 2.32.4-0ubuntu0.18.04.1
E: Couldn't find any package by glob '2.32.4-0ubuntu0.18.04.1'
E: Couldn't find any package by regex '2.32.4-0ubuntu0.18.04.1'
And I tried sudo apt --fix-broken install, but it still doesn't works. The error messages are the same as that when I run sudo apt-get install libwebkit2gtk-4.0-37.
Could someone help me out? Any reply is in fervent anticipation.
Platform: x64, Ubuntu 18.04 LTS

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.

Can't remove, purge, unistall mongodb from debian

I'm trying to reinstall it, because it has problems. For example, I can't install Chromium because mongodb-org-server is not configured. But I can't even remove it for the same reason.
apt-get autoremove --purge mongodb
Or:
apt-get purge mongodb
Or:
apt-get remove --purge mongodb
All end in the same way:
dpkg: error processing package mongodb-org-server (--configure):
subprocess installed post-installation script returned error exit status 102
Errors were encountered while processing:
mongodb-org-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
Some data about my machine from hostnamectl:
Operating System: Debian GNU/Linux 8 (jessie)
Kernel: Linux 3.14-2-amd64
Architecture: x86_64
How can I fix this?
Updates: things I tried/I'm trying
apt-get install -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 973 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mongodb-org-server (3.0.2) ...
dpkg: error processing package mongodb-org-server (--configure):
subprocess installed post-installation script returned error exit status 102
Errors were encountered while processing:
mongodb-org-server
To avoid that sort of problems you should install software only from native Debian repositories. Unfortunately it is not unusual when sloppy/incompetent 3rd party packages are responsible for such troubles.
To recover try removing file /var/lib/dpkg/info/mongodb-org-server.postinst before attempting to apt-get purge mongodb.
Remove all mongodb file inside
/var/lib/dpkg/info/mongodb
And then do
sudo apt purge mongodb-org*
Answer credits to: Lazyexpert

sudo apt-get install libao-common

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
libao-common
0 upgraded, 1 newly installed, 0 to remove and 52 not upgraded.
4 not fully installed or removed.
Need to get 0 B/11.3 kB of archives.
After this operation, 49.2 kB of additional disk space will be used.
dpkg: regarding .../libao-common_1.1.0-2_armhf.deb containing libao-common:
libao-common conflicts with libao2
libao2 (version 0.8.4-1) is present and unpacked but not configured.
dpkg: error processing /var/cache/apt/archives/libao-common_1.1.0-2_armhf.deb (--unpack):
conflicting packages - not installing libao-common
Errors were encountered while processing:
/var/cache/apt/archives/libao-common_1.1.0-2_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Why is conflicting packages not installing libao-common?
It’s on a Raspberry PI with Raspbian.
apt-get -f install doesn't work
root#raspberrypi:~# 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:
libao-common
The following NEW packages will be installed:
libao-common
0 upgraded, 1 newly installed, 0 to remove and 52 not upgraded.
4 not fully installed or removed.
Need to get 11.3 kB of archives.
After this operation, 49.2 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirrordirector.raspbian.org/raspbian/ wheezy/main libao-common armhf 1.1.0-2 [11.3 kB]
Fetched 11.3 kB in 2s (4,117 B/s)
dpkg: regarding .../libao-common_1.1.0-2_armhf.deb containing libao-common:
libao-common conflicts with libao2
libao2 (version 0.8.4-1) is present and unpacked but not configured.
dpkg: error processing /var/cache/apt/archives/libao-common_1.1.0-2_armhf.deb (--unpack):
conflicting packages - not installing libao-common
Errors were encountered while processing:
/var/cache/apt/archives/libao-common_1.1.0-2_armhf.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
notice that message:
4 not fully installed or removed.
maybe you install other package failed. then the apt tool try to install them again.
so, uninstall these error package first.
sudo apt-get --force-yes remove #your-package-name#
you need to remove the 4 not fully installed or removed package first.
then
sudo apt autoremove
now, try to install the new package again.

Resources