Skip to content

Instantly share code, notes, and snippets.

@oleksis
Last active February 17, 2023 08:36
Show Gist options
  • Save oleksis/63f835f8df61f2e99eaf31c20672dfdb to your computer and use it in GitHub Desktop.
Save oleksis/63f835f8df61f2e99eaf31c20672dfdb to your computer and use it in GitHub Desktop.
Update openSUSE 15.4 to 15.5

Update openSUSE 15.4 to 15.5

Check current version

$ cat /etc/os-release
NAME="openSUSE Leap"
VERSION="15.4"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.4"
PRETTY_NAME="openSUSE Leap 15.4"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.4"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
DOCUMENTATION_URL="https://en.opensuse.org/Portal:Leap"
LOGO="distributor-logo-Leap"

Refresh repository

$ sudo zypper ref -b

Update repository

$ sudo zypper up -y

List repos

$ sudo zypper repos --uri

Verify that we can get 15.5 version

Show enabled only

$ sudo zypper --releasever=15.5 lr -uE

Note Check the repo file contain the $releasever variable.

$ sudo cat /etc/zypp/repos.d/repo-oss.repo
[repo-oss]
name=Main Repository
enabled=1
autorefresh=1
baseurl=http://download.opensuse.org/distribution/leap/$releasever/repo/oss/
type=rpm-md
[sudo] password for root:
Warning: Enforced setting: $releasever=15.5
Repository priorities are without effect. All enabled repositories share the same priority.

#  | Alias                 | Name | Enabled | GPG Check | Refresh | URI
---+-----------------------+------+---------+-----------+---------+------------------------------------------------------------------
 3 | repo-backports-update | Up-> | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/update/leap/15.5/backports/
 8 | repo-non-oss          | No-> | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/distribution/leap/15.5/repo/non-oss/
 9 | repo-oss              | Ma-> | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/distribution/leap/15.5/repo/oss/
11 | repo-sle-update       | Up-> | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/update/leap/15.5/sle/
13 | repo-update           | Ma-> | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/update/leap/15.5/oss/
14 | repo-update-non-oss   | Up-> | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/update/leap/15.5/non-oss/

Refresh all repositories to 15.5

$ sudo zypper --releasever=15.5 ref

Update the distro to 15.5

$ sudo zypper --releasever=15.5 dup -y
....
The following product is going to be upgraded:
  openSUSE Leap 15.4  15.4-1 -> 15.5-1
...

Check

$ cat /etc/os-release
NAME="openSUSE Leap"
VERSION="15.5 Alpha"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.5"
PRETTY_NAME="openSUSE Leap 15.5 Alpha"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.5"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
DOCUMENTATION_URL="https://en.opensuse.org/Portal:Leap"
LOGO="distributor-logo-Leap"

Note

If you get errors from the above command, the upstream repo has a different name than what you defined in our .repo file. Visit the OBS repository to find the correct name and add it to the .repo file.

Replace old release string with release variable

$ sudo sed -i 's/15.5/\$releasever/g' /etc/zypp/repos.d/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment