Tag Archives: yum

[Solved] CentOS Use Yum to install dependency: error: rpmdb open failed

When installing dependencies using Yum in CentOS, the following errors are reported:

the solution is as follows:

Execute the following commands in order

 # Go to the directory where rpmdb is located
 cd /var/lib/rpm
 # Clear the original rpmdb file
 rm -f __db.*
 # Rebuild the rpm database
 rpm --rebuilddb
 # Clear all yum caches
 yum clean all

After execution, use Yum to install the dependent packages normally

yum Error: error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run data……

1. On Linux server, execute the yum command and report an error as follows:
[root@isTester-Idoxu ~]# yum install nodejs
error: rpmdb: BDB0113 Thread/process 19512/140292738050112 failed: BDB1507 Thread died in Berkeley DB library
error: db5 error(-30973) from dbenv->failchk: BDB0087 DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db5 – (-30973)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
2. Reason:
The rpm database is damaged.
3. Solution:
Just modify the database,
1)执行命令cd /var/lib/rpm
[root@isTester-Idoxu ~]# cd /var/lib/rpm
[root@isTester-Idoxu rpm]# ls
Basenames Conflictname __db.001 __db.002 __db.003 Dirnames Group Installtid Name Obsoletename Packages Providename Requirename Sha1header Sigmd5 Triggername
2) View
[root@isTester-Idoxu rpm]# ll
total 142484
-rw-r–r–. 1 root root 3051520 Nov 4 2020 Basenames
-rw-r–r–. 1 root root 16384 Oct 30 2020 Conflictname
-rw-r–r– 1 root root 286720 Nov 8 17:55 __db.001
-rw-r–r– 1 root root 90112 Nov 8 17:55 __db.002
-rw-r–r– 1 root root 1318912 Nov 8 17:55 __db.003
-rw-r–r–. 1 root root 2072576 Nov 4 2020 Dirnames
-rw-r–r–. 1 root root 20480 Nov 4 2020 Group
-rw-r–r–. 1 root root 16384 Nov 4 2020 Installtid
-rw-r–r–. 1 root root 36864 Nov 4 2020 Name
-rw-r–r–. 1 root root 16384 Nov 2 2020 Obsoletename
-rw-r–r–. 1 root root 136822784 Nov 4 2020 Packages
-rw-r–r–. 1 root root 1888256 Nov 4 2020 Providename
-rw-r–r–. 1 root root 253952 Nov 4 2020 Requirename
-rw-r–r–. 1 root root 73728 Nov 4 2020 Sha1header
-rw-r–r–. 1 root root 40960 Nov 4 2020 Sigmd5
-rw-r–r–. 1 root root 8192 Oct 30 2020 Triggername
3) Delete the damaged database file
[root@isTester-Idoxu rpm]# rm -rf __db.00*
[root@isTester-Idoxu rpm]# ll
total 140964
-rw-r–r–. 1 root root 3051520 Nov 4 2020 Basenames
-rw-r–r–. 1 root root 16384 Oct 30 2020 Conflictname
-rw-r–r–. 1 root root 2072576 Nov 4 2020 Dirnames
-rw-r–r–. 1 root root 20480 Nov 4 2020 Group
-rw-r–r–. 1 root root 16384 Nov 4 2020 Installtid
-rw-r–r–. 1 root root 36864 Nov 4 2020 Name
-rw-r–r–. 1 root root 16384 Nov 2 2020 Obsoletename
-rw-r–r–. 1 root root 136822784 Nov 4 2020 Packages
-rw-r–r–. 1 root root 1888256 Nov 4 2020 Providename
-rw-r–r–. 1 root root 253952 Nov 4 2020 Requirename
-rw-r–r–. 1 root root 73728 Nov 4 2020 Sha1header
-rw-r–r–. 1 root root 40960 Nov 4 2020 Sigmd5
-rw-r–r–. 1 root root 8192 Oct 30 2020 Triggername
4) Re-create the database file
[root@isTester-Idoxu rpm]# rpm –rebuilddb
[root@isTester-Idoxu rpm]# yum
Loaded plugins: fastestmirror, langpacks
You need to give some command
Usage: yum [options] COMMAND
List of Commands:
check Check for problems in the rpmdb
check-update Check for available package updates
clean Remove cached data
deplist List a package’s dependencies
distribution-synchronization Synchronize installed packages to the latest available versions
downgrade downgrade a package
erase Remove a package or packages from your system
fs Acts on the filesystem data of the host, mainly for removing docs/lanuages for minimal hosts.
fssnapshot Creates filesystem snapshots, or lists/deletes current snapshots.
groups Display, or use, the groups information
help Display a helpful usage message
history Display, or use, the transaction history
info Display details about a package or group of packages
install Install a package or packages on your system
langavailable Check available languages
langinfo List languages information
langinstall Install appropriate language packs for a language
langlist List installed languages
langremove Remove installed language packs for a language
list List a package or groups of packages
load-transaction load a saved transaction from filename
makecache Generate the metadata cache
provides Find what package provides the given value
reinstall reinstall a package
repo-pkgs Treat a repo. as a group of packages, so we can install/remove all of them
repolist Display the configured software repositories
search Search package details for the given string
shell Run an interactive yum shell
swap Simple way to swap packages, instead of using shell
update Update a package or packages on your system
update-minimal Works like upgrade, but goes to the ‘newest’ package match which fixes a problem that affects your system
updateinfo Acts on repository update information
upgrade Update packages taking obsoletes into account
version Display a version for the machine and/or available repos.
Options:
-h, –help show this help message and exit
-t, –tolerant be tolerant of errors
-C, –cacheonly run entirely from system cache, don’t update cache
-c [config file], –config=[config file]
config file location
-R [minutes], –randomwait=[minutes]
maximum command wait time
-d [debug level], –debuglevel=[debug level]
debugging output level
–showduplicates show duplicates, in repos, in list/search commands
-e [error level], –errorlevel=[error level]
error output level
–rpmverbosity=[debug level name]
debugging output level for rpm
-q, –quiet quiet operation
-v, –verbose verbose operation
-y, –assumeyes answer yes for all questions
–assumeno answer no for all questions
–version show Yum version and exit
–installroot=[path] set install root
–enablerepo=[repo] enable one or more repositories (wildcards allowed)
–disablerepo=[repo] disable one or more repositories (wildcards allowed)
-x [package], –exclude=[package]
exclude package(s) by name or glob
–disableexcludes=[repo]
disable exclude from main, for a repo or for
everything
–disableincludes=[repo]
disable includepkgs for a repo or for everything
–obsoletes enable obsoletes processing during updates
–noplugins disable Yum plugins
–nogpgcheck disable gpg signature checking
–disableplugin=[plugin]
disable plugins by name
–enableplugin=[plugin]
enable plugins by name
–skip-broken skip packages with depsolving problems
–color=COLOR control whether color is used
–releasever=RELEASEVER
set value of $releasever in yum config and repo files
–downloadonly don’t update, just download
–downloaddir=DLDIR specifies an alternate directory to store packages
–setopt=SETOPTS set arbitrary config and repo options
–bugfix Include bugfix relevant packages, in updates
–security Include security relevant packages, in updates
–advisory=ADVS, –advisories=ADVS
Include packages needed to fix the given advisory, in
updates
–bzs=BZS Include packages needed to fix the given BZ, in
updates
–cves=CVES Include packages needed to fix the given CVE, in
updates
–sec-severity=SEVS, –secseverity=SEVS
Include security relevant packages matching the
severity, in updates
Plugin Options:
5) Check whether the creation is successful
[root@isTester-Idoxu rpm]# ll
total 86052
-rw-r–r– 1 root root 2846720 Nov 8 17:58 Basenames
-rw-r–r– 1 root root 8192 Nov 8 17:58 Conflictname
-rw-r–r– 1 root root 286720 Nov 8 17:58 __db.001
-rw-r–r– 1 root root 90112 Nov 8 17:58 __db.002
-rw-r–r– 1 root root 57344 Nov 8 17:58 __db.003
-rw-r–r– 1 root root 1327104 Nov 8 17:58 Dirnames
-rw-r–r– 1 root root 24576 Nov 8 17:58 Group
-rw-r–r– 1 root root 16384 Nov 8 17:58 Installtid
-rw-r–r– 1 root root 40960 Nov 8 17:58 Name
-rw-r–r– 1 root root 16384 Nov 8 17:58 Obsoletename
-rw-r–r– 1 root root 81248256 Nov 8 17:58 Packages
-rw-r–r– 1 root root 1957888 Nov 8 17:58 Providename
-rw-r–r– 1 root root 217088 Nov 8 17:58 Requirename
-rw-r–r– 1 root root 69632 Nov 8 17:58 Sha1header
-rw-r–r– 1 root root 45056 Nov 8 17:58 Sigmd5
-rw-r–r– 1 root root 8192 Nov 8 17:58 Triggername
Done!

YumRepo Error: All mirror URLs are not using ftp, http[s] or file. Eg. Inval

Cause: build lamp environment, linux environment is centos6 64 bit, run the instruction “Yum remove httpd” to remove the original Apache

Complete error prompt:

Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package httpd.i686 0:2.2.15-29.el6.centos will be erased
--> Processing Dependency: httpd >= 2.2.0 for package: gnome-user-share-2.28.2-3.el6.i686
--> Running transaction check
---> Package gnome-user-share.i686 0:2.28.2-3.el6 will be erased
--> Finished Dependency Resolution
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/i386/6/base/mirrorlist.txt
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

terms of settlement:

Just run the following three instructions

ed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo 

There is another solution in the original, but I solved it with the first one. If you can’t solve it with this method, you can try the second one in the original https://blog.csdn.net/weixin_ 45621658/article/details/110734514

Resolving yum source-related issues: Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again

Loaded plug-ins: fastestmirror
Loading mirror speeds from cached hostfile
One of the configured repositories failed (none),
and yum doesn’t have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work “fix” this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Run the command with the repository temporarily disabled
        yum --disablerepo=<repoid> ...

 4. Disable the repository permanently, so yum won't use it by default. Yum
    will then just ignore the repository until you permanently enable it
    again or use --enablerepo for temporary usage:

        yum-config-manager --disable <repoid>
    or
        subscription-manager repos --disable=<repoid>

 5. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again


Follow the prompts to correct the source.

cd /etc/yum.repos.d
vi epel.repo 

The revised contents are as follows:

[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://mirrors.aliyun.com/epel/7/$basearch
#metalink=https://mirrors.aliyun.com/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=http://mirrors.aliyun.com/epel/7/$basearch/debug
#metalink=https://mirrors.aliyun.com/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=http://mirrors.aliyun.com/epel/7/SRPMS
#metalink=https://mirrors.aliyun.com/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1

Execute the following command:

yum clean all
yum makecache
yum update
yum install -y git

Yum installation and use returned to normal.

Linux yum Error: All mirror URLs are not using ftp

All mirror URLs are not using ftp, http[s] or file

Because the support of centos6 has been officially stopped

To solve this problem, execute the following command:

sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo

yum clean all

yum makecache

It’s OK

The solution of transaction check error when installing Gnome with Yum command

Question:

Installing and downloading graphical interface Gnome

Yum groupinstall “desktop”
Yum groupinstall “X window system”
Yum groupinstall “Chinese support” (optional)

The screenshot of the later error is as follows:

resolvent:

Use the command: Yum remove networkmanager-1: 0.8.1-43.el6.x86_ 64 first delete the conflicting package shown in the red box in the above screenshot.

Fedora 14 yum Error: Cannot retrieve repository metadata (repomd.xml) for repository

Due to work reasons, Fedora 14 is needed. After installing the system, yum is used to install the software and report an error:
[root@bogon liu]# yum install samba samba-client samba-swat
Loaded plugins: langpacks, presto, refresh-packagekit
Adding en_US to language list
Error: Cannot retrieve repository metadata (repomd.xml) for repository: fedora. Please verify its path and try again
The solution is as follows:
1. Delete all files except Fedora.repo in /etc/yum.repos. D.
2. Modify the content of fedora.repo file, add the comment symbol ‘#’ in front of mirrorList, remove the comment symbol before baseurl, and replace the url.
The modified Fedora.repo file reads as follows:

[fedora]
name=Fedora $releasever - $basearch
failovermethod=priority
baseurl=http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/$releasever/Everything/$basearch/os/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
enabled=1
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[fedora-debuginfo]
name=Fedora $releasever - $basearch - Debug
failovermethod=priority
baseurl=http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/$releasever/Everything/$basearch/debug/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

[fedora-source]
name=Fedora $releasever - Source
failovermethod=priority
baseurl=http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/$releasever/Everything/source/SRPMS/
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-source-$releasever&arch=$basearch
enabled=0
metadata_expire=7d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch

Then you can install the software normally
.

Error: Failed dependencies: error encountered when installing rpm package

Under Linux install RPM packages often encounter the following problem:
error: Failed dependencies:
… The
ellipsis indicates the missing package for installing this RPM.
when you encounter this problem, you can add two parameters after the installation of RPM package command, such as:
rpm-ivh libstdc++5.0-3.3.3-62745cl.i386. RPM
is changed to:
RPMS -ivh libstdc++5.0-3.3.3-62745cl.i386. RPM –nodeps –force

plus those two parameters mean that
is installed without having to dependencies among packets, and
does not count error: Failed dependencies: such errors
In RedHat Linux and Other RedHat compliant distributions such as Mandrake, the entire distribution is installed using RPM. So the best way to install new software is to

downloading RPM packages from the network.
1) to install a package using an RPM, the simplest command is as follows:

# rb-ivh foo-1.0l-l.is386.rpm (the package in question is foo-1.0l-l.is386.rpm, all of the following)

foo#################### ############. Installation is simple.

2) remove installed packages
to uninstall package foo, simply enter the following command:

# rpm-e foo

note: the package name is foo, not the RPM file name “foo-1.01-l.b.i. 386.rpm”.

3) upgrading packages to upgrade the software is similar to install the software:

# RPM – Uvh foo – 2.0 – l.i 386 RPM

foo# # # # # # # # # # # # # # # # # # # #

user note: RPM will automatically install the old version of the corresponding software package. Rpmsave

saving /etc/foo.conf as /etc/foo.conf.rpmsave

so that the user can manually change the configuration file. In addition, if the user wants to install the older version of the software, the user will see the following error message:

# rpm-uvh foo-1.0-l.i386. RPM

foo packag foo-2.0-l(which is newer) is already installed

error: foo-1.0l-l.i 386. RPM cannot be installed

.
user can use rpm-q to query the corresponding software in the RPM database, RPM will give the name of the software package, version, release version number, for example:

# rpm-q foo

foo-2.0-l

the following is the query can use the specific parameters:
-a query the current system installed all software packages.
-f filename query includes ga file packages.
– F with the -f parameter, just input is standard input (for example the find/usr/bin | RPM – qF)
– q package name:
– q query the package with the -p parameter, just input is standard input (for example the find/MNT/cdrom/RedHat/RPMS | RPM – qQ)
here is the format of the output options:
– I displays the name of the package, description, distribution, size, date of compilation, the date of installation, developers and other information.
-l display the files contained in the software package
-s display the current status of the files contained in the software package, only two states: normal and missing
-d display the documents in the software package (such as man,info,README, etc.)
-c display the configuration files in the software package, these files generally need to be manually modified by the user after installation, for example: Sendmail. Cf, passwd, inittab etc.
if using the -v parameter can be similar to the output of the ls -l

5) in the RPM packages
users can use the RPM used to check the package has been installed, the RPM can check file size, MD5 check code, file permissions, type, and the information such as owner.
here is the parameter description:
– a simple calibration software package if the file exists
– b check package in a single file

– c check installation of all packages – d compare a source package and already installed packages

if the test through, there is no any error messages, if there is an error message, its format is as follows: the error information is one of the eight string, if it is a “. “, means there is no problem, here is the meaning of the corresponding characters: MD5 check error
5 MD5 check error
S file size error
L symbolic connection
T file modification time error
D device file error
U user name error
G group name error
M attributes (including overwrite weight and file type) error
if the user sees this information, it is best to reinstall or manually repair.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

the RPM practical skills!
1) users can install packages via FTP. If users will be able to connect on the network, want to install a new software package, you can directly use it to install to the URL:
for example: under ftp.linuxsir.com/pub/linux/redhat/RPMS/ now have this file package: foo – 1.0-1. I386 RPM, then you can use this command:

# RPM -i ftp.linuxsir.com/pub/linux/redhat/RPMS/foo-1.0-1.i386.rpm

to install, also can query!

2) if the user accidentally wushan several files, but not sure whether those documents, want to check to the whole system, in order to understand which parts may be damaged, you can use:

# RPM – Va

3) if the user meets a person not to come out of the file, want to know it belongs to the words of a software package, you can do it:

# rpb-qf /usr/X11R6/bin/xjewel

results are obtained with the following information:
xjewel-1.6-1

4) if the user gets a new RPM file, but does not know its contents; Or to find out which files a particular file package will install on your system, do this:

How to Fix yum Install Error Loaded plugins: fastestmirror, refresh-packagekit, security

[root@db yum.repos.d]# yum makecache

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

Error: Cannot find a valid baseurl for repo: elasticsearch-6.x

[root@db yum.repos.d]# vim /etc/yum/pluginconf.d/fastestmirror.conf

Change 1 to 0

Then go to the yum source and configure

If there are plugins=1 then change it to 0, not adding them.