Thursday, May 16, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 5674  / 2 Years ago, fri, june 3, 2022, 6:52:13

I'm unable to remove the package python3-pip in Ubuntu 16.04:



$ apt list |& grep 'python3-pip/'
python3-pip/xenial-updates,xenial-updates 8.1.1-2ubuntu0.4 all
$ sudo apt-get remove python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'python3-pip' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
openstack@prclnx04:~/python/pybind11$ apt list |& grep 'python3-pip/'
python3-pip/xenial-updates,xenial-updates 8.1.1-2ubuntu0.4 all
$ sudo dpkg --remove --force-remove-reinstreq python3-pip
dpkg: warning: ignoring request to remove python3-pip which isn't installed
$ sudo dpkg --remove --force-remove-reinstreq python3-pip
dpkg: warning: ignoring request to remove python3-pip which isn't installed
$ sudo apt-get update
Ign:1 http://archive.ubuntu.com/ubuntu trusty InRelease
Hit:2 http://ppa.launchpad.net/diesch/testing/ubuntu xenial InRelease
Hit:3 http://archive.ubuntu.com/ubuntu trusty Release
Hit:4 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial InRelease
Hit:6 http://archive.linux.duke.edu/ubuntu xenial InRelease
Hit:7 http://archive.linux.duke.edu/ubuntu xenial-updates InRelease
Hit:8 http://archive.linux.duke.edu/ubuntu xenial-backports InRelease
Hit:9 http://archive.linux.duke.edu/ubuntu xenial-security InRelease
Reading package lists... Done
$ apt list |& grep 'python3-pip/'
python3-pip/xenial-updates,xenial-updates 8.1.1-2ubuntu0.4 all
$ sudo apt-get clean && sudo apt-get autoclean && sudo apt-get autoremove --purge python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'python3-pip' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
$ apt list |& grep 'python3-pip/'
python3-pip/xenial-updates,xenial-updates 8.1.1-2ubuntu0.4 all


Is there a way to force apt to completely remove the package?



Edit 1:



$ apt policy python3-pip
python3-pip:
Installed: (none)
Candidate: 8.1.1-2ubuntu0.4
Version table:
8.1.1-2ubuntu0.4 500
500 http://archive.linux.duke.edu/ubuntu xenial-updates/universe amd64 Packages
500 http://archive.linux.duke.edu/ubuntu xenial-updates/universe i386 Packages
8.1.1-2 500
500 http://archive.linux.duke.edu/ubuntu xenial/universe amd64 Packages
500 http://archive.linux.duke.edu/ubuntu xenial/universe i386 Packages
1.5.4-1 500
500 http://archive.ubuntu.com/ubuntu trusty/universe amd64 Packages
500 http://archive.ubuntu.com/ubuntu trusty/universe i386 Packages
$ apt list |& grep 'python3-pip/'
python3-pip/xenial-updates,xenial-updates 8.1.1-2ubuntu0.4 all
$

$ apt list --installed | grep python3-pip

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

$ dpkg --get-selections | grep python3-pip
$ apt list |& grep 'python3-pip/'
python3-pip/xenial-updates,xenial-updates 8.1.1-2ubuntu0.4 all
$

More From » apt

 Answers
5

First check whether the package is installed :



$ apt policy python3-pip
python3-pip:
Installed: (none)
Candidate: 8.1.2-2ubuntu0.1
Version table:
8.1.2-2ubuntu0.1 500
500 http://archive.ubuntu.com/ubuntu yakkety-updates/universe amd64 Packages
500 http://archive.ubuntu.com/ubuntu yakkety-updates/universe i386 Packages
8.1.2-2 500
500 http://archive.ubuntu.com/ubuntu yakkety/universe amd64 Packages
500 http://archive.ubuntu.com/ubuntu yakkety/universe i386 Packages


In case it is (in this example it's not) execute :



sudo apt purge python3-pip  


In case you mistakenly chose the wrong one :



dpkg --get-selections | grep python3  


You get a list of installed python3 packages.



Clarification and general information : Your Edit 1 output shows that the package is not installed and hence it cannot be removed. The apt list command shows available packages, it does NOT show installed packages, unless you add --installed to the apt list command as mentioned in the comment from @Terrance. And, be very careful which packages you remove as pointed out by @ByteCommander ... sudo apt purge completely removes packages and configuration files !


[#12011] Sunday, June 5, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
velelf

Total Points: 395
Total Questions: 115
Total Answers: 107

Location: Sudan
Member since Mon, Jun 1, 2020
4 Years ago
;