All notes
Sus

Commands

zypper



##### Manage packages

zypper if pkgName
zypper info pkgName

zypper in pkgname

zypper rm -y pkgname

## update
zypper list-updates/lu
zypper update/up PKGNAME

# Search for package with a file
# https://unix.stackexchange.com/questions/158041/how-do-i-find-a-package-that-provides-a-given-file-in-opensuse
zypper se --provides --match-exact hg
# S | Name      | Summary                  | Type   
# --+-----------+--------------------------+--------
#   | mercurial | Scalable Distributed SCM | package
# From that point you can install the package through a standard zypper install

##### Manage repo

# -u, --uri: Add base URI column to the output.
# -p, --priority
zypper lr -pu
# -d, --detail
zypper lr -d

# ar: addrepo.
# -f, --refresh. Enable autorefresh of the repository.
# "libreoffice2" is the alias name.
zypper ar -f http://download.opensuse.org/repositories/LibreOffice:/5.3/SLE_12_SP2/ "libreoffice2"

# Remove repo.
zypper rr libreoffice2

# https://software.opensuse.org/download.html?project=utilities&package=the_silver_searcher
zypper addrepo http://download.opensuse.org/repositories/utilities/SLE-12-SP1/utilities.repo
zypper refresh
zypper install the_silver_searcher

# Modify repo
# -n, rename the repo.
# -r / -R, enable / disable auto-refresh.
# -e, enable the repo.
# -d, disable the 10th repo.
sudo zypper modifyrepo/mr -d 10
# Enable 10th-19th repos.
sudo zypper mr -e {10..19}

# Or you can operate directly on the configuration files under:
# /etc/zypp/repos.d/

OCICLI

1-click install.


OCICLI http://opensuse-community.org/nvidia.ymp

FAQ

Auto login

howtogeek.com: auto login in SUSE.

Goto "start".
Search for "user management".
Open "Expert Options" drop-down, and select "Login Settings".
Check or uncheck the Auto Login checkbox, and choose the user that you want to automatically login.

VMware copy and paste not supported

vmware communities.

SUES 12 is using open-vmware-tools 9.4 and from what I can tell this version doesn't have clipboard sharing yet. Looks like that came out with version 9.10.

Resize root partition

askUbuntu: resize an ext root partition gives a detailed description on how to enlarge root part. This stackExchange provides a consise step description. Simply put:

fdisk /dev/sda

# Them remove the partition, and create a new one, without re-formatting, and carefully make sure that the new partition starts at the same block as the old.
# Also restore the boot flag by using command 'a'.
# Example:
#  d - remove partition
#  2 - number partition
#  n - create new
#  p - type primary
#  2 - number
#  a

df -h shows that the / still has old space capacity. We need to tell the system to resize. The previous posts said to use resize2fs (they are Ubuntu-oriented), but it will not work for btrfs which is the format used in SUSE. resize2fs will complain: "Bad magic number in super-block while trying to open".

To resize the fs, we need to use btrfs tool:

# Boot from a SUSE live CD, in rescue mode:
mkdir /mnt/hehe
mount /dev/sda2 /mnt/hehe
btrfs filesystem resize max /mnt/hehe

# See if the / has more space now:
df -h
# Done!

Set timezone



date
# Sat Feb 27 01:34:17 GMT 2010

hwclock
# Fri Feb 26 19:34:29 2010 -0.642278 seconds

# https://www.server-world.info/en/note?os=SUSE_Linux_Enterprise_12&p=timezone
timedatectl list-timezones
timedatectl set-timezone Asia/Shanghai
timedatectl