Remove or install command is not working in ubuntu - ubuntu-16.04

I am trying to remove unzip from ubuntu 16 but not able to delete it coomand is not showing any output after confirmation.
HP-Laptop-15q-ds0xxx:~$ sudo apt-get remove unzip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
file-roller ubuntu-desktop unzip
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
29 not fully installed or removed.
After this operation, 2,584 kB disk space will be freed.
Do you want to continue? [Y/n] y
HP-Laptop-15q-ds0xxx:~$
After running remove command it is still showing me the unzip and it still working. Same thing is happening with other apt-get install or apt-get remove command
HP-Laptop-15q-ds0xxx:~$ unzip -v
UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP.

Related

No way to update python3.10 on my linux mint mate 20.3 Una

Last night the update manager indicates there are 2 update ready. I want to apply them but at the end only one updates the 2nd one (python 3.10) does not. It was late so went to bed. This morning that update is still there but now there is some more stuff.
Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://apt.postgresql.org/pub/repos/apt focal-pgdg InRelease' doesn't support architecture 'i386'
It was not exactly the same as mine related to codelite. I looked in repositories and ppa´s and found an entry for codelite and disabled it. That message was gone. But the update still did not work. This time a problem with the mirror I was using. Changed mirror and all the rest runs fine. Still updating python 3.10 no way. Other updates do pass, even python 3.8 and 3.9. Clearly the problem lies with python 3.10 and seem dependency related but I am stumped.
The deadsnakes repository is there. I removed and reinstalled it. Still same problem.
Here is a screen shoot of my terminal (same messages appear when I use synaptic):
It all turn around two dependencies that python 3.10 needs but are no longer there. But the recommended commands do nothing but return the same result.
The following packages have unmet dependencies.
python3.10 : Depends: libpython3.10-stdlib (= 3.10.4-1+focal2) but 3.10.4-1+focal1 is installed
python3.10-minimal : Depends: libpython3.10-minimal (= 3.10.4-1+focal2) but 3.10.4-1+focal1 is installed
So what is going wrong? what apart from focal1 and focal2 is different? And are they fundamentally different? Most importantly how do I solve this problem without going in circles.
Oh and before I forget. My python console in gedit stopped working at the same time as these problems started and I can't make out what the problem there is either. Suspect though they are related. e
Thank you in advance.
Here is how I solved the same issue in Ubuntu 20.04
Locate package libpython3.10-stdlib
$ apt-cache policy libpython3.10-stdlib
libpython3.10-stdlib:
Installed: 3.10.4-1+focal1
Candidate: 3.10.4-1+focal2
Version table:
3.10.4-1+focal2 500
500 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main amd64 Packages
*** 3.10.4-1+focal1 100
100 /var/lib/dpkg/status
$ ls -l /var/lib/dpkg/info | grep -i libpython3.10-stdlib
-rw-r--r-- 1 root root 14489 Apr 10 00:26 libpython3.10- stdlib:amd64.list
-rw-r--r-- 1 root root 23536 Mär 24 17:12 libpython3.10-stdlib:amd64.md5sums
-rwxr-xr-x 1 root root 1161 Mär 24 17:12 libpython3.10-stdlib:amd64.prerm
Remove manually the package
$ sudo mv /var/lib/dpkg/info/libpython3.10-stdlib:amd64.* /tmp
Repeat the same steps for libpython3.10-minimal. Then fix the broken packages
$ 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:
libpython3.10-minimal libpython3.10-stdlib
The following packages will be upgraded:
libpython3.10-minimal libpython3.10-stdlib
2 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
5 not fully installed or removed.
Need to get 0 B/2.566 kB of archives.
After this operation, 68,6 kB disk space will be freed.
Do you want to continue? [Y/n]
dpkg: warning: files list file for package 'libpython3.10-stdlib:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpython3.10-minimal:amd64' missing; assuming package has no files currently installed
(Reading database ... 191581 files and directories currently installed.)
Preparing to unpack .../libpython3.10-stdlib_3.10.4-1+focal2_amd64.deb ...
Unpacking libpython3.10-stdlib:amd64 (3.10.4-1+focal2) over (3.10.4-1+focal1) ...
Preparing to unpack .../libpython3.10-minimal_3.10.4-1+focal2_amd64.deb ...
Unpacking libpython3.10-minimal:amd64 (3.10.4-1+focal2) over (3.10.4-1+focal1) ...
Setting up libpython3.10-minimal:amd64 (3.10.4-1+focal2) ...
Setting up python3.10-minimal (3.10.4-1+focal2) ...
Setting up libpython3.10-stdlib:amd64 (3.10.4-1+focal2) ...
Setting up libpython3.10:amd64 (3.10.4-1+focal2) ...
Setting up python3.10 (3.10.4-1+focal2) ...
Setting up libpython3.10-dev:amd64 (3.10.4-1+focal2) ...
Setting up python3.10-dev (3.10.4-1+focal2) ...
I had the same error. I followed the instructions in the first and second answer and I got this:
/var/cache/apt/archives/libpython3.10-stdlib_3.10.4-1+focal2_amd64.debE: Sub-process /usr/bin/dpkg returned an error code (1)
After move this :
sudo mv /var/cache/apt/archives/libpython3.10-stdlib_3.10.4-1+focal2_amd64.deb /tmp
It works !
Same thing happened to me. When apt fails I go for https://pkgs.org/, search the package, download and install manually. It usually works.

N: Ignoring file 'logstash-2.2.x' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension

When I try to install logstash, this happens:
root#ip-x:/home/ubuntu# sudo apt-get install logstash
Reading package lists... Done
Building dependency tree
Reading state information... Done
logstash is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 41 not upgraded.
N: Ignoring file 'logstash-2.2.x' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
N: Ignoring file 'logstash-2.2.x' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
What's going wrong?
Finally I got the solution.
After this issue I can't install update and remove. Problem is logstash package is malfunctioned. So the solution is removing that package.
Here are the steps I done:
#cd /etc/apt/sources.list.d
#rm -rf logstash-2.2.x(error package name)
#sudo apt-get update

Which missing library results in the message '/usr/bin/ld: cannot find -lglib-2.0'?

I am cross compiling a Lazarus program, creating a 32bit program on a 64bit Ubuntu 14.04 Trusty Tahr system, and everything apparently compiles to the very end when I get this messsage
/usr/bin/ld: cannot find -lglib-2.0
What is the full name of the library whose absence results in this error mesage?
libc6-dev:i386 appears to be the most likely library, but when I try to install it with apt indicates build-essential g++ gcc gcc-multilib will be removed so I abort it.
sudo apt-get install libc6-dev:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
linux-libc-dev linux-libc-dev:i386
Suggested packages:
glibc-doc:i386 manpages-dev:i386
Recommended packages:
gcc:i386 c-compiler:i386
The following packages will be REMOVED
build-essential g++ gcc gcc-multilib
The following NEW packages will be installed
libc6-dev:i386 linux-libc-dev:i386
The following packages will be upgraded:
linux-libc-dev
1 to upgrade, 2 to newly install, 4 to remove and 18 not to upgrade.
Need to get 3,126 kB of archives.
After this operation, 12.6 MB of additional disk space will be used.
Do you want to continue? [Y/n]
It turns out it was the libglib2.0-0:i386 package. It was already installed earlier, but it had not been fully configured.
It was present in the /lib/i386-linux directory and I had to create a symlink to it include it to the fpc.cfg configuration file used by Free Pascal.
locate libglib | grep ^/lib produced:
/lib/i386-linux-gnu/libglib-2.0.so.0
/lib/i386-linux-gnu/libglib-2.0.so.0.4002.0
/lib/x86_64-linux-gnu/libglib-2.0.so.0
/lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0
I symlinked it with the expected name:
ln -s /lib/i386-linux-gnu/libglib-2.0.so.0 /lib/i386-linux-gnu/libglib-2.0.so
then added to the Lazarus installations fpc.cfg file
#ifdef cpui386
-Fl/usr/lib32
-Fl/lib/i386-linux-gnu
#endif

Duplicate Package - update / upgrade - Centos

When I try running yum update on a CentOS 6.3 box, I am getting errors, and says to run yum check. The output of yum check is:
➜ ~ yum check
Loaded plugins: fastestmirror
glibc-2.12-1.107.el6_4.5.x86_64 is a duplicate with glibc-2.12-1.107.el6_4.4.x86_64
glibc-common-2.12-1.107.el6_4.5.x86_64 is a duplicate with glibc-common-2.12-1.107.el6_4.4.x86_64
glibc-devel-2.12-1.107.el6_4.5.x86_64 is a duplicate with glibc-devel-2.12-1.107.el6_4.4.x86_64
glibc-devel-2.12-1.107.el6_4.5.x86_64 has missing requires of glibc-headers = ('0', '2.12', '1.107.el6_4.5')
iputils-20071127-17.el6_4.2.x86_64 is a duplicate with iputils-20071127-17.el6_4.x86_64
nspr-4.9.5-2.el6_4.x86_64 is a duplicate with nspr-4.9.2-1.el6.x86_64
nss-3.14.3-4.el6_4.x86_64 is a duplicate with nss-3.14.0.0-12.el6.x86_64
nss-softokn-3.14.3-3.el6_4.x86_64 is a duplicate with nss-softokn-3.12.9-11.el6.x86_64
nss-util-3.14.3-3.el6_4.x86_64 is a duplicate with nss-util-3.14.0.0-2.el6.x86_64
tzdata-2013g-1.el6.noarch is a duplicate with tzdata-2013c-2.el6.noarch
2:xinetd-2.3.14-39.el6_4.x86_64 is a duplicate with 2:xinetd-2.3.14-38.el6.x86_64
Error: check all
Any idea how to fix these packages? I tried yum reinstall xinetd tzdata nss-util nss-softokn nss nspr iputils glibc glibc-common glibc-devel but got:
Error: Multilib version problems found. This often means that the
root
cause is something else and multilib version checking is just
pointing out that there is a problem.
For me it looks like you rebooted your computer (or it crashed) while you where in the process of upgrading packages. So new packages where installed, but old packages where not removed.
First look if you have any uncomplete transactions with: yum-complete-transaction
If this doesn't help then take a look at the package-cleanup tool which is part of the yum-utils package.
package-cleanup --dupes lists duplicate packages
package-cleanup --cleandupes removes duplicate packages
But be carefull with the command and create a backup before removing duplicates.
This is the way I did fix one CentOS 7 server with 471 dupes.
First I had to install yum utils:
yum install yum-utils
Have tried yum-complete-transaction and other stuff without luck, I gave up the transaction with:
yum-complete-transaction --cleanup-only
Then I got a sorted list of duplicated packages so I could identify older versions to remove filtering even and odd lines later:
package-cleanup --dupes | sort -u > dupes.out
Then I got a uninstall list from this sorted file this way:
cat dupes.out | grep -v 'Loaded plugins:' | sort -u | awk 'NR % 2 == 1' > uninstall.in
Then I removed from rpm database the old versions:
for f in `cat uninstall.in`; do rpm -e --nodeps -f --justdb $f; done
Finally I could continue on regular system upgrade:
yum upgrade
Some things to pay attention:
On this case, I have carefully reviewed the "package-cleanup --dupes" output to make sure how to generate the uninstall list.
I have tried a "reinstall the newer" approach inverting the list (awk 'NR % 2 == 0') but there where lots of packages not available anymore at that version (server was left this way for an year).
I thought about removing from rpmdb the newer packages, so upgrade later should reinstall everything, but after checking on filesystem installed files, it was clear for me that new versions were in place, with only older rpm entries still in rpmdb. Maybe your case is different.
I was able to remove all duplicates by using yum shell:
I first ordered it to remove all packages using remove foo-package-*
Then order it to install previous version by specifying the exact version install foo-package-3.14.1-5.i386 foo-package-3.14.1-5.x86_64
Committing the transaction by run
After that, the duplicates were gone and I could update the system to current packages without problem and without introducing any new duplicates.
This works even for system packages like nss or yum.
Try running:
yum reinstall [package-new.version]
It is mean, if you get the output of yum check is:
# yum check
Loaded plugins: fastestmirror
nss-3.14.3-4.el6_4.x86_64 is a duplicate with nss-3.14.0.0-12.el6.x86_64
Do reinstall:
yum reinstall nss-3.14.3-4.el6_4.x86_64
A minor upgrade was interrupted by SSH disconnection. After handholding a few packages while trying to get other fixes to work, I ended up fixing the rest like so:
sudo yum reinstall --skip-broken $(/usr/bin/package-cleanup --dupes -q |sort)
First install yum utils and run cleanup afterwards to remove old duplicated packages
yum install yum-utils &&
package-cleanup –-cleandupes -y
hint:
sometimes you need to run package-cleanup –-cleandupes few times
A couple of months ago I also ran into this problem after upgrading my fedora.
I also tried the package-cleanup utility and it started removing required libs rendering my workstation unworkable. Luckily I could reinstall Fedora not deleting my home partition.
Yesterday the same problem occured and I fixed it removing the older version of the duplicate.
For example:
I got these duplicates:
oxygen-icon-theme-4.8.3-1.fc16.noarch is a duplicate with oxygen-icon-theme-4.8.2-1.fc16.noarch
sane-backends-libs-1.0.22-10.fc16.i686 is a duplicate with sane-backends-libs-1.0.22-8.fc16.i686
What I did is I used the yum remove sane-backends-libs-1.0.22-8.fc16.i686 and afterwards a yum update.
Everything is now working fine.
from http://forums.fedoraforum.org/showthread.php?t=268328
In my case nothing above has worked.
So after having the Duplicates list, I copied it to a Text Editor ...
And i did
yum upgrade {package name}
As I edited the whole list, I did it continuously ...
Example: yum upgrade sudo nano came mariadb, etc ...
what worked for me is :
1) getting the list of duplicated packages : package-cleanup --dupes
2) deleting manually old duplicates : rpm -e --justdb --nodeps {old-version-duplicated-package}
3) yum update

Debian aptitude install: 'find' not found in PATH or not executable

When I try to install any package such as php5, it gives me this error.
I did update and upgrade all libraries.
root#host:~# apt-get install apache2-mpm-prefork libapache2-mod-php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
apache2-mpm-prefork is already the newest version.
The following extra packages will be installed:
libonig2 libqdbm14 php5-cli php5-common
Suggested packages:
php-pear
The following NEW packages will be installed:
libapache2-mod-php5 libonig2 libqdbm14 php5-cli php5-common
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/6,106 kB of archives.
After this operation, 18.7 MB 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
dpkg: warning: 'find' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)
Can someone help me?
There is probably something messed up with the permissions of find, find on your installation is probably located in /usr/bin/find, to check the permissions of this application run
ls -l /usr/bin/find
This should return something like this:
-rwxr-xr-x 1 root root 136152 Oct 26 2010 /usr/bin/find
If this returns an error, try to ls find on other locations in you path (eg. /bin/find, /usr/local/sbin/find)
The first part should be identical for the command to work. If not, reset the permissions to with the following command:
chmod 755 /usr/bin/find
This should fix it.