Results 1 to 8 of 8

Thread: zypper command: How to run as root?

  1. #1
    Join Date
    Dec 2014
    Location
    Miami, FL
    Posts
    53

    Default zypper command: How to run as root?

    What am I doing wrong here?

    What is the proper way to install a package from the terminal using zypper?

    Code:
    daka@linux-0xkw:~> zypper in backintime
    Root privileges are required for installing or uninstalling packages.
    daka@linux-0xkw:~> su zypper in backintime
    su: user zypper does not exist
    daka@linux-0xkw:~> kdesu zypper in backintime
    daka@linux-0xkw:~> backintime
    If 'backintime' is not a typo you can use command-not-found to lookup the package that contains it, like this:
        cnf backintime
    daka@linux-0xkw:~> su
    Password: 
    linux-0xkw:/home/daka # zypper in backintime
    Loading repository data...
    Reading installed packages...
    Resolving package dependencies...
    
    
    The following 6 NEW packages are going to be installed:
      backintime encfs libboost_serialization1_54_0 librlog5 python-notify sshfs 
    
    
    The following 2 recommended packages were automatically selected:
      encfs sshfs 
    
    
    6 new packages to install.
    Overall download size: 681.5 KiB. Already cached: 0 B  After the operation, 
    additional 3.1 MiB will be used.
    Continue? [y/n/? shows all options] (y): y

  2. #2
    Join Date
    Sep 2008
    Posts
    2,997

    Default Re: zypper command: How to run as root?

    What is the proper way to install a package from the terminal using zypper?
    sudo is the way to run console apps with root privileges without becoming root
    basicly you should do

    Code:
    sudo zypper in backintime

  3. #3
    Join Date
    Dec 2014
    Location
    Miami, FL
    Posts
    53

    Default Re: zypper command: How to run as root?

    Thank you. How do you know when to use kdesudo or just sudo?

  4. #4

    Default Re: zypper command: How to run as root?

    sudo - runs the program in terminal mode - example: zypper, smartctl, nano, pico, vi, etc.

    sudo smartctl -A /dev/sda

    sudo zypper refresh

    sudo nano /etc/resolv.conf


    kdesu - runs programs that require graphics mode. Example: Dolphin, KDE-SystemSettings in root mode.

    Install fonts (Windows Fonts - TTF) for all users - KDE - Configure Desktop - Font Management:

    kdesu systemsettings

    kdesu dolphin (very carefully - you can delete important system files by accident.)

  5. #5
    Join Date
    Sep 2008
    Posts
    2,997

    Default Re: zypper command: How to run as root?

    Thank you. How do you know when to use kdesudo or just sudo?
    in my opinion you should only use sudo, kdesu is called by kde when root privileges are needed (for running yast or accessing an external partition in dolphin etc) I do believe that root should use as little GUI as possible.

  6. #6
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,760

    Default Re: zypper command: How to run as root?

    kdesu not kdesudo is to start a gui app as root in a GUI

    sudo, and or su are used for text/command line programs to run as root

    sudo is temperate and only effects the following command(s) Also in openSUSE sudo is not a full root environment by default though that can be changed if desired.

    su - (note the dash) gives you the full root environment. this starts a root shell and you are root until you exit the shell (ie close window or type exit)
    si without dash is like sudo it is part root and part user environment. It so is a root shell but does not have all the paths set that root normally does. What not having full root environment means is that you must use full path names for commands that are in /sbin directory. Also some other environment variables may not be set as full root's would.

    There are other ways to become root. sometimes in a menu item that is to start as root you will see dbus-launch to start the program There are a couple of more even more obscure ways

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,240

    Default Re: zypper command: How to run as root?

    Quote Originally Posted by fc321 View Post
    Thank you. How do you know when to use kdesudo or just sudo?
    Read this: https://en.opensuse.org/SDB%3ALogin_as_root
    Henk van Velden

  8. #8
    Join Date
    Dec 2014
    Location
    Miami, FL
    Posts
    53

    Default Re: zypper command: How to run as root?

    Thanks guys,

    That was a very clear explanation.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •