an3l / my_playground

My playground with python, nginx, docker and server!
0 stars 0 forks source link

Packaging - RPM #21

Open an3l opened 4 years ago

an3l commented 4 years ago

rpm install package with query

rpm -qi file.rpm # sudo yum install package.name

To check which binary is installed from package

which mysql # /usr/bin/mysql rpm -qf /usr/bin/mysql # mariadb-5.5.65-1.el7.x86_64

List file from package

rpm -ql mariadb-5.5.65-1.el7.x86_64

Adding a new file (mariadb.repo) to /etc/yum.repos.d/ didn't work to install new package because I was using ppc64 sudo yum install mariadb-server mariadb-client # still old package mariadb-5.5.65-1.el7.x86_64

sudo systemctl status mariadb # no mariadb.service

$ rpm -qf /etc/yum.repos.d/Mariadb.repo file /etc/yum.repos.d/Mariadb.repo is not owned by any package $ rpm -qf /etc/yum.repos.d/CentOS-Base.repo centos-release-7-8.2003.0.el7.centos.x86_64 man alternatives https://www.humblec.com/file-is-not-owned-by-any-package-ahh-whats-wrong/

After proper configuration

$ rpm -qf /usr/bin/mysql MariaDB-client-10.5.3-1.el7.centos.x86_64 $ rpm -ql MariaDB-server |grep mysqld

/usr/bin/mysqld_multi
/usr/bin/mysqld_safe
/usr/bin/mysqld_safe_helper
/usr/bin/mysqldumpslow
/usr/bin/wsrep_sst_mysqldump
/usr/lib/systemd/system/mysqld.service
/usr/lib64/libmysqld.so
/usr/sbin/mysqld  # EVO GA 

So rpm -ivh file.rpm is adding YUM REPOSITORIES and need to install them via sudo yum install

Uninstall MariaDB-client and MariaDB-server

https://phoenixnap.com/kb/centos-uninstall-remove-package

$ rpm -qa|grep MariaDB
MariaDB-common-10.5.3-1.el7.centos.x86_64
MariaDB-compat-10.5.3-1.el7.centos.x86_64
MariaDB-server-10.5.3-1.el7.centos.x86_64
MariaDB-client-10.5.3-1.el7.centos.x86_64
$ yum list|grep MariaDB
MariaDB-client.x86_64                    10.5.3-1.el7.centos           @mariadb 
MariaDB-common.x86_64                    10.5.3-1.el7.centos           @mariadb 
MariaDB-compat.x86_64                    10.5.3-1.el7.centos           @mariadb 
MariaDB-server.x86_64                    10.5.3-1.el7.centos           @mariadb 
MariaDB-backup.x86_64                    10.5.3-1.el7.centos           mariadb  
MariaDB-backup-debuginfo.x86_64          10.5.3-1.el7.centos           mariadb  
MariaDB-cassandra-engine.x86_64          10.5.3-1.el7.centos           mariadb  
MariaDB-cassandra-engine-debuginfo.x86_64
MariaDB-client-debuginfo.x86_64          10.5.3-1.el7.centos           mariadb  
MariaDB-common-debuginfo.x86_64          10.5.3-1.el7.centos           mariadb  
MariaDB-connect-engine.x86_64            10.5.3-1.el7.centos           mariadb  
MariaDB-connect-engine-debuginfo.x86_64  10.5.3-1.el7.centos           mariadb  
MariaDB-cracklib-password-check.x86_64   10.5.3-1.el7.centos           mariadb  
MariaDB-cracklib-password-check-debuginfo.x86_64
MariaDB-devel.x86_64                     10.5.3-1.el7.centos           mariadb  
MariaDB-devel-debuginfo.x86_64           10.5.3-1.el7.centos           mariadb  
MariaDB-gssapi-server.x86_64             10.5.3-1.el7.centos           mariadb  
MariaDB-gssapi-server-debuginfo.x86_64   10.5.3-1.el7.centos           mariadb  
MariaDB-oqgraph-engine.x86_64            10.5.3-1.el7.centos           mariadb  
MariaDB-oqgraph-engine-debuginfo.x86_64  10.5.3-1.el7.centos           mariadb  
MariaDB-rocksdb-engine.x86_64            10.5.3-1.el7.centos           mariadb  
MariaDB-rocksdb-engine-debuginfo.x86_64  10.5.3-1.el7.centos           mariadb  
MariaDB-server-debuginfo.x86_64          10.5.3-1.el7.centos           mariadb  
MariaDB-shared.x86_64                    10.5.3-1.el7.centos           mariadb  
MariaDB-shared-debuginfo.x86_64          10.5.3-1.el7.centos           mariadb  
MariaDB-test.x86_64                      10.5.3-1.el7.centos           mariadb  
MariaDB-test-debuginfo.x86_64            10.5.3-1.el7.centos           mariadb 

After uninstalling 10.5, changed to 10.4 in MariaDB repo

sudo yum update didn't work Run yum clean all didn't work Run yum clean expire-cache && yum update didn't work Added metadata_expire=1m to MariaDB.repo and run yum clean all --verboseand sudo yum update

mariadb                                                                                                                | 2.9 kB  00:00:00     
Not using downloaded mariadb/repomd.xml because it is older than what we have:
  Current   : Tue May 12 01:06:13 2020
  Downloaded: Tue May 12 00:23:17 2020
No packages marked for update

The same happens with:

$ yum --disablerepo=* --enablerepo=mariadb clean metadata -q; yum check-update --disablerepo=* --enablerepo=mariadb -q
Not using downloaded mariadb/repomd.xml because it is older than what we have:
  Current   : Tue May 12 01:06:13 2020
  Downloaded: Tue May 12 00:23:17 2020

Run yum repolist

repo id                                              repo name                                                                          status
base/7/x86_64                                        CentOS-7 - Base                                                                    10,070
epel/x86_64                                          Extra Packages for Enterprise Linux 7 - x86_64                                     13,281
extras/7/x86_64                                      CentOS-7 - Extras                                                                     397
!mariadb                                             MariaDB                                                                                89

yum clean metadata not working yum clean all not working Delete /var/cache/yum/x86_64/mariadb/repomd.xml manually and run sudo yum update (probably also yum repolist)

To install ack:

yum install epel-release
yum install ack

To install gcc or clang

https://developers.redhat.com/blog/2018/07/07/yum-install-gcc7-clang/

sudo yum group install "Development Tools" # or yum install gcc gcc-c++ # will install 4.8.5-39 gcc

https://linuxize.com/post/how-to-install-gcc-compiler-on-centos-7/ https://www.softwarecollections.org/en/ https://gist.github.com/nchaigne/ad06bc867f911a3c0d32939f1e930a11

Will need also : $ sudo yum install ncurses-devel for MariaDB installation

Problem with gnutls: $ yum install -y gnutls-devel

https://jira.mariadb.org/browse/MDEV-22552

Full rpm for mariadb https://mariadb.com/kb/en/source-building-mariadb-on-centos/+simple/dash/ https://mariadb.com/kb/en/building-mariadb-from-a-source-rpm/

mytop in MariaDB-client 10.5

$ rpm -qil MariaDB-client | egrep '^Version|^Release|mytop'
Version     : 10.5.3
Release     : 1.el7.centos
/usr/share/man/man1/mytop.1.gz

To inspect rpm files (installed): rpm -qlp rpmfile.rpm # -p option needed for inspecting besides listing

Literature:

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sec-setting_repository_options

using COMPONENT https://stackoverflow.com/questions/9190098/for-cmakes-install-command-what-can-the-component-argument-do

%config https://cmake.org/Bug/view.php?id=12096

Other issues

warning: FIle listed twice: /etc/my.cnf.d/mysql-clients.cnf

-DPLUGIN_ARCHIVE=No
CMake Error at cmake/plugin.cmake:105 (MESSAGE)::
  Invalid value for PLUGIN_ARCHIVE
Call Stack (most recent call first):
  storage/archive/CMakeLists.txt:17 (MYSQL_ADD_PLUGIN)