Go to file
Peter Ajamian 844896ad6b Fix rpm and dnf package spec issues
When attempting to check if a package exists for a particular provide string
what happened is if an older version of the package was on the system but a
newer version in the repositories then the older (system) version would be
returned by dnf provides, but this could not be translated into a package name
with dnf repoquery because that specific version could not be found in the
repos.  The solution was to check rpm first to translate the package name on the
system and then dnf repoquery if rpm doesn't find it.

This brought to light issues when passing arrays of package names to rpm and dnf
which might happen to contain an empty element.  In this case rpm and dnf would
consider the empty arg an indicator that it should match all packages on the
system, or all available packages.  While we should try to avoid passing arrays
with empty elements, this highlighed a need to make rpm and dnf safer in this
regard, and so there are now saferpm and sfednf functions which simply strip any
empty args before calling the appropriate command with the rest of the args
untouched.

This commit also fixes an issue with output column formatting.
2021-06-04 22:11:15 +12:00
migrate2rocky.sh Fix rpm and dnf package spec issues 2021-06-04 22:11:15 +12:00
README.md Merge branch 'main' into main 2021-05-31 20:30:27 -04:00

Rocky Tools

Various scripts and tools that we find useful, whether we use them or they are made for public consumption. For example, conversion scripts or otherwise.

[migrate2rocky] -- Conversion Script

Running this script will convert an existing CentOS 8 system to Rocky Linux 8.

Usage

./migrate2rocky.sh -h
├── -h   # --> Display this help
├── -r   # --> Convert to Rocky
└── -V   # --> Verify switch

[!! USE WITH CAUTION !!]

Known Issues

RHEL migrations show error messages during conversion

  Installing       : rocky-release-8.3-13.el8.noarch                        2/5Error unpacking rpm package rocky-release-8.3-13.el8.noarch
...
error: unpacking of archive failed on file /usr/share/redhat-release: cpio: File from package already exists as a directory in system
error: rocky-release-8.3-13.el8.noarch: install failed
...
Error: Transaction failed

This results from conflicts in the directory structure of RHEL with that of RockyLinux. migrate2rocky will detect the issue and go on to remove the conflicting directory and install rocky-release with the rpm command.

Grub still shows kernel entries from previous installation

This is normal. The running kernel cannot be safely removed when migrate2rocky is run. The RockyLinux kernel should come up as the default highlighed kernel on reboot but the other ones will remain until they are removed or replaced by newer kernels. If you want you can manually remove the old kernels after reboot with dnf or rpm.

Latest Version

The latest version of this script can be found here.

Debugging

The migrate2rocky script pipes everything shown on stdout and stderr to /var/log/migrate2rocky.log.

If you run in to issues executing this script, please submit an issue here.

Make sure to include the output log, and remove any sensitive information. (if any)

Feel free to create a pull request if you think you've got the fix.