1

What is the equivalent of the Redhat command rpm -e in Ubuntu? I know it's probably dpkg something because the equivalent of rpm -qa is dpkg -l, but I can't tell what the equivalent command of rpm -e is in Ubuntu. However, I think it's dpkg -r aka --remove <package-name> or --remove-architecture, but I'm not sure.

This is different from the question about how to remove an application in Ubuntu because I want know the most exact equivalent in terms of actions performed of the rpm -e command and not just generally how to remove an application, even if apt or apt-get remove packagename is the recommended or preferred way and not dpkg -r packagename or dpkg --remove packagename.

Zanna
  • 70,465
  • 6
    What does RedHat's rpm -e command do? What are you trying to do? Have you read man dpkg? – waltinator Dec 05 '17 at 22:47
  • This is what I'm trying to do: 3. Use the command rpm -e to remove the following packages: dogtail-0.6.1-2.el5.noarch, xorg-x11-server-Xvfb-1.1.1-48.41.el5, sabayon-apply-2.12.4-5.el5.i386, and xorg-x11-server-Xnest-1.1.1-48.41.el5. Note, el5 refers to Enterprise Linux version 5.

    I probably need to know the equivalent Ubuntu 16.4 files too.

    – MyVBbooksucks Dec 07 '17 at 00:49
  • Yes I read the man page for the dpkg command, but I forgot to say it. That's why I said I think it's dpkg -r package name aka dpkg --remove package name or dpkg --remove-architecture. – MyVBbooksucks Dec 07 '17 at 01:22

1 Answers1

2
sudo apt remove PACKAGENAME     # for everyday use: fancy output
sudo apt-get remove PACKAGENAME # for scripts: stable output

is Ubuntu's equivalent of rpm -e, see the Table of Equivalent Commands for package management on Ubuntu and Red Hat systems.

While you're right that there's a also an equivalent dkpg command to remove a single package – namely dpgk -r PACKAGENAME – it's nevertheless advisable to use apt, citing Wikipedia:

While dpkg performs actions on individual packages, apt tools manage relations (especially dependencies) between them, as well as sourcing and management of higher-level versioning decisions (release tracking and version pinning).

A major feature in APT is the way it calls dpkg — it does topological sorting of the list of packages to be installed or removed and calls dpkg in the best possible sequence. In some cases, it utilizes the --force options in dpkg. However, it only does this when it is unable to calculate how to avoid the reason dpkg requires the action to be forced.

apt is like a front-end to dpkg, but it keeps track of dependencies and won't silently let you remove a package another package still depends on.

dessert
  • 39,982
  • Somehow I don't think the correct equivalent is the apt or apt-get command with the remove option and PACKAGENAME argument because usually dpkg is correct equivalent and it would make more sense that either dpkg -r packagename or dpkg --remove package name would be the equivalent I'm looking for. – MyVBbooksucks Dec 07 '17 at 01:34
  • @MyVBbooksucks I edited the answer and hope this clarifies things. – dessert Dec 07 '17 at 09:26
  • Thanks for explaining that because I didn't think of it that way and didn't know apt-get is a front-end to the dpkg command. However, according to your response dpkg is the exact equivalent of the rpm -e command, even though the link you gave me to Ubuntu Wiki of Equivalent Commands says it is apt or apt-get remove packagename because rpm and dpkg are usually used to do the same thing especially install programs downloaded from the internet instead of installing repositories. Not that apt or apt-get can't install programs downloaded from the interenet, but it just usually isn't used for that. – MyVBbooksucks Dec 07 '17 at 16:41
  • @MyVBbooksucks Well a Debian (based) OS certainly works different – what's your actual question? If you have a different question please ask it! – dessert Dec 07 '17 at 16:49
  • One more thing is that it would seem as though that when I took my Linux classes at the community college I attended that my instructor felt that rpm -e was intended for package removal and not yum, which is the equivalent of debians apt or apt-get, even if yum may also be a front end to the rpm command and if this doesn't matter let me know and I'll include both in my instructions that I borrowed from them that was for Redhat distros specifically CentOS that I'm changing to guide me on Ubuntu if not all Debian distros. Also, I'll be sure to specify in my both instructions for each situation. – MyVBbooksucks Dec 07 '17 at 16:54
  • No I don't have a different question other than the one I asked here in the first place, but I do need more explanation. I don't agree that a Debian (based) OS is that much different than Redhat in regards to this if your referring to Ubuntu and not a Debian (based) OS compared to Ubuntu because it's just mostly using different names for its commands. – MyVBbooksucks Dec 08 '17 at 01:09
  • I'm not just trying to remove a single package though. I'm trying to remove multiple packages using the Ubuntu or Debian equivalent files used in the following example:

    Use the command rpm -e to remove the following packages: dogtail-0.6.1-2.el5.noarch, xorg-x11-server-Xvfb-1.1.1-48.41.el5, sabayon-apply-2.12.4-5.el5.i386, and xorg-x11-server-Xnest-1.1.1-48.41.el5. Note, el5 refers to Enterprise Linux version 5.

    – MyVBbooksucks Dec 08 '17 at 17:36
  • If I were doing this in Ubuntu or Debian the command with the option and arguments would look pretty much like this except in regards to the fact that these files might not exist in Ubuntu or Debian: dpkg -r or dpkg --remove to remove the following packages: dogtail-0.6.1-2.deb.noarch, xorg-x11-server-Xvfb-1.1.1-48.41.deb, sabayon-apply-2.12.4-5.deb.i386, and xorg-x11-server-Xnest-1.1.1-48.41.deb. – MyVBbooksucks Dec 08 '17 at 17:38
  • I can only repeat myself: If my answer didn't solve your issue please either edit your question and clarify what's unclear or – if you have another question – open a new question for it. Comments are not for extended discussion and this is not a forum: [tour]. – dessert Dec 08 '17 at 17:40
  • The command would technically look something like this:

    dpkg -r or dpkg --remove dogtail-0.6.1-2.deb.noarch xorg-x11-server-Xvfb-1.1.1-48.41.deb sabayon-apply-2.12.4-5.deb.i386 xorg-x11-server-Xnest-1.1.1-48.41.deb

    – MyVBbooksucks Dec 08 '17 at 17:41
  • I can't ask the question on a Ubuntu forum because I don't have enough reputation points yet. – MyVBbooksucks Dec 09 '17 at 02:16