• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

error

Yum Cache Corruption

February 4, 2022

If you’re getting a “HTTP Error 404 – Not Found” error when trying to run yum update, it could be a corrupted cache. Clear the cache on the system by running the following.

yum clean all
rm -rf /var/cache/yum/*

yum clean all rm -rf /var/cache/yum/*

Run yum update again. The errors should be gone.

Filed Under: Linux Tagged With: 404, cache, clear, corrupted, error, http, update, yum

Apt Locked Files

October 2, 2021

If you tried to run apt update and you get this error, try the following.

$ apt update
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) [duplicate]

$ apt update E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) [duplicate]

Kill the process.

$ sudo killall apt apt-get

$ sudo killall apt apt-get

If that doesn’t work, remove the locked files.

$ sudo rm /var/lib/apt/lists/lock
$ sudo rm /var/cache/apt/archives/lock
$ sudo rm /var/lib/dpkg/lock*

$ sudo rm /var/lib/apt/lists/lock $ sudo rm /var/cache/apt/archives/lock $ sudo rm /var/lib/dpkg/lock*

Run apt update again.

Filed Under: Linux Tagged With: apt, error, locked, update

WordPress Critical Error

April 11, 2021

If you get a WordPress “There has been a critical error on your website” error, you probably have an issue with a theme or plugin. The quickest way to troubleshoot is to rename the plugins directory since there’s no way to login. This technically disables all plugins. Rename it back to plugins and enable each plugin one by one.

Disable all plugins.

mv plugins plugins-backup

mv plugins plugins-backup

Login and restore the plugins directory.

mv plugins-backup plugins

mv plugins-backup plugins

Enable each plugin one by one and check if the site is broken.

Filed Under: WP Tagged With: critical, error, plugins, themes

Yum RPMDB failed

October 4, 2019

If you are getting an error similar to the yum error below, yum may be broken in your system.

error: rpmdb: BDB0113 Thread/process 2196/139984719730496 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

error: rpmdb: BDB0113 Thread/process 2196/139984719730496 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

Here’s the fix.

mv /var/lib/rpm/__db* /tmp
yum clean all

mv /var/lib/rpm/__db* /tmp yum clean all

Run your yum commands. The errors should be gone.

Filed Under: Linux Tagged With: database, error, failed, rpm, yum

Recover MySQL Root Password

September 2, 2019

How to recover a MySQL root password without a password.

  1. Stop MySQL.
  2. Start MySQL Safe Mode.
  3. Login to MySQL as root without password.
  4. Change root password.

# Stop MySQL.
service mysql stop
# MySQL Safe Mode.
mysqld_safe --skip-grant-tables &

# Stop MySQL. service mysql stop # MySQL Safe Mode. mysqld_safe --skip-grant-tables &

# Login to MySQL without password. Set new password.
mysql -u root -p
use mysql;
# For MySQL 5.6 or lower
UPDATE mysql.user SET Password=PASSWORD('newpassword') WHERE User='root';
# For MySQL 5.7 or higher
SET PASSWORD FOR 'root'@'localhost' = PASSWORD("newpassword");
FLUSH PRIVILEGES;
exit;

# Login to MySQL without password. Set new password. mysql -u root -p use mysql; # For MySQL 5.6 or lower UPDATE mysql.user SET Password=PASSWORD('newpassword') WHERE User='root'; # For MySQL 5.7 or higher SET PASSWORD FOR 'root'@'localhost' = PASSWORD("newpassword"); FLUSH PRIVILEGES; exit;

# Kill mysqld
killall mysqld
# Restart MySQL
service mysql start

# Kill mysqld killall mysqld # Restart MySQL service mysql start

I ran into issues running MySQL Safe mode. I got a “UNIX socket file don’t exists” error. Here’s the fix.

mkdir -p /var/run/mysqld
chown mysql:mysql /var/run/mysqld

mkdir -p /var/run/mysqld chown mysql:mysql /var/run/mysqld

Filed Under: Cloud, Linux Tagged With: error, mysql, password, recover, reset, root, safe mode, unix file socket

Install AWS CLI on Ubuntu 16.04

August 11, 2019

I ran into an issue with AWS CLI on Ubuntu 16.04. I was getting this error, “AWSHTTPSConnection’ object has no attribute ‘ssl_context” every time I try to do a simple “aws s3 ls” command. So, here’s the fix.

Assuming you installed “awscli” using apt. Go ahead and uninstall it.

apt remove awscli

apt remove awscli

Install awscli using pip instead.

apt install python-pip
pip install awscli
aws --version

apt install python-pip pip install awscli aws --version

If this is a fresh install, you may have to run “aws configure.”

Filed Under: Cloud Tagged With: aws, awshttpsconnection, cli, error, fix, install, pip

CloudFront XML Error

June 30, 2019

If you’re seeing an XML error, check the default root object in your CloudFront distribution.

CloudFront distribution setting

It should be set to your index page.

Filed Under: Cloud Tagged With: aws, cloudfront, default root object, error, index.html, xml

  • Home
  • About
  • Archives

Copyright © 2023