Can I use Ubuntu commands in openSUSE?

Hi, I’m a bit new to Linux. I was previously on Ubuntu and I’m using openSUSE Leap 15.2 now.

One thing I noticed that openSUSE uses zypper

zypper refresh

while in Ubuntu I would have to use

apt-get update

SInce, I’m a little used to Ubuntu, I find them easier. Is there any way I can use the Ubuntu commands in openSUSE?

Use a cheat sheet, such as: https://danilodellaquila.com/en/blog/linux-package-management-cheatsheet

If you’re going to use openSUSE then you really need to learn the “openSUSE way”…

Like yourself, I migrated (several years ago now) from ubuntu, it didn’t ake too long to get to grips with openSUSE.

This is a source of some good documentation https://doc.opensuse.org/ … and of course you can always ask here for specific help if need be :wink:

Welcome to the world of Linux. And the answer is Yes and No.

On the one hand, Linux gives you the great freedom to customize the system to meet your needs. So if you like, you can even try to install apt-get on openSUSE.

However, you may need to do a lot of configuration to make it work and it may never work properly on openSUSE, even break your system. This is because each Linux distribution has there own way to manage packages, and they are usually incompatible. You can read this to learn more about package management.

So do not try to install apt-get on openSUSE, and the usage of zypper is not as complicated as you may think. Most of the commonly used commands are almost the same as apt-get, you just needs to replace “apt-get” and “apt-cache” to “zypper”, you only need a minute to remember them:

  • “apt-get install” to “zypper install”
  • “apt-get remove” to “zypper remove”
  • “apt-cache search” to “zypper search”

Some commands may need to be adapted:

  • “zypper refresh” works like “apt-get update” for refreshing package repositories
  • “zypper update” works like “apt-get upgrade” for updating packages

Hope you enjoy openSUSE:)

And of course YaST > Software Management is very good in offering most of the tasks you ever want to do regarding software management in a GUI.

A forum like this will mostly show and advise zypper commands, simply because it is easier to communicate in a text based forum like this.

Thanks for all the clarification. :+1:

I agree with the others that it’s best to learn Zypper (and YaST). As a user of various Debians, Mageia, Fedora and other distros in addition to openSUSE (my primary OS for the past 11 years, migrated from OS/2, not M$), I’m of the opinion Zypper is the all-around best Linux package manager bar none.

That said, it is possible to use Aptitude in openSUSE:

# rpm -ql zypper-aptitude-1.14.37-lp151.2.14.1.noarch.rpm
/etc/zypp/apt-packagemap.d
/etc/zypp/apt-packagemap.d/10-packagemap.pm
/etc/zypp/apt-packagemap.d/50-libperl.pm
/etc/zypp/apt-packagemap.d/50-libruby.pm
/etc/zypp/apt-packagemap.d/50-python.pm
/etc/zypp/apt-packagemap.d/90-devel.pm
/usr/bin/apt
/usr/bin/apt-get
/usr/bin/aptitude

Looks from this output like Apt and Apt-get would be available as well as Aptitude. To install zypper-aptitude:

sudo zypper in zypper-aptitude

Some of the reasons why Zypper beats the others:

  • it doesn’t use plugins or different binary names for various subprocesses to vex a search for syntax for an unfamiliar usage. It’s all in a single man page.
  • shortcuts and tab completion (to minimize required keystrokes), e.g.: ‘zypper in’ for ‘zypper install’, ‘zypper ref’ for ‘zypper refresh’
  • a comprehensible locking system: e.g. ‘zypper al mypack*’ to prevent automatic installation, upgrade, downgrade or removal of any package with a name including the string “mypack”; ‘zypper rl mypack*’ to remove the lock; ‘zypper ll’ to list all locks.
  • incorporates globbing
  • repos can be named whatever pleases you
  • doesn’t quit just because one package has a dependency issue
  • easy to identify available versions, and works on substrings. e.g.: ‘zypper se -s esr’ returns any package name that includes the string esr, case insensitively, along with the version number of each resulting package (one of my favorite advantages)

I’m not familiar with anyone who actually uses apt* on openSUSE, so if you have a problem with it, I suspect you’ll find no one available to provide any help other than suggesting to use Zypper instead.

Welcome to openSUSE! :slight_smile:

Hi,

Not really a direct answer to what you’re looking/asking for but the link might help a bit to know what is the equivalent commands on which/what distro is available.

https://wiki.archlinux.org/index.php/Pacman/Rosetta

Got the answer I was looking for. Thanks! :slight_smile:

A working GUI is fine. However when troubleshooting the command line is more efficient as GUIs add a layer of complexity.