YUM fails in clean CentOS 7 install, Exiting on user cancel

If you are installing CentOS 7, you might get an issue with yum update exiting, when it starts downloading packages with the message  Exiting on user cancel even though you haven’t pressed any key, or did anything else that might have cancelled the process.

This seems to be a known bug on Red Hat Enterprise Linux / CentOS 7.1, but it happened on version 7.0.1406 for me.

https://bugzilla.redhat.com/show_bug.cgi?id=1091740

[[email protected] ~]# cat /etc/redhat-release
CentOS Linux release 7.0.1406 (Core)

After running yum update it would connect to repository any resolve all the dependencies, and list all the packages that need to be updated, but once you would confirm the download, it would initiate download of packages, and then failed with the message indicating that the process was interrupted from keyboard.

Transaction Summary
=================================================================================================================================
Install    8 Packages (+6 Dependent packages)
Upgrade  202 Packages

Total size: 203 M
Total download size: 194 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
Traceback (most recent call last):
  File "/usr/libexec/urlgrabber-ext-down", line 75, in 
    main()
  File "/usr/libexec/urlgrabber-ext-down", line 61, in main
    fo = PyCurlFileObject(opts.url, opts.filename, opts)
  File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 1258, in __init__
    self._do_open()
  File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 1589, in _do_open
    self._do_grab()
  File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 1723, in _do_grab
    self._do_perform()
  File "/usr/lib/python2.7/site-packages/urlgrabber/grabber.py", line 1517, in _do_perform
    raise KeyboardInterrupt
KeyboardInterrupt


Exiting on user cancel

After running bash -c 'yum clean metadata && yum upgrade' as suggested on CentOS forums, yum has downloaded all the packages, and upgraded to latest CentOS version

https://www.centos.org/forums/viewtopic.php?t=47372

[[email protected] ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)

Alternate solution

Another possible solution, to this might be to edit /usr/lib/python2.7/site-packages/urlgrabber/grabber.py file, and change the line number 1510 as below:

Change “elif errcode in (42, 55, 56):” to “elif errcode == 42:”

https://infologs.wordpress.com/2015/01/25/url-grabber-error-on-yum-updateinstall-on-centos7/

How to install MySQL through YaST

This is a repost of a post from an old blog, made on January 9, 2012, that used to be on:

http://adminramble.com/install-mysql-yast/

Original post:

I was looking into Novell Service Desk as solution for our Help-desk department today, so i decided to test it by installing it on a single machine together with a MySQL server to act as its database. It’s been a few years since the last time I installed MySQL, last few years I’m mostly working with Informix and MS SQL.

I just wanted it installed as soon as possible so I decided to install the it through YaST thinking it would be faster, but neglected the fact that YaST scatters the installation through several directories so I spend some time locating the files. So this are the short instructions for those who decided to do it with YaST. I was installing on SUSE Linux Enterprise Server 11 SP1

HOW TO INSTALL MYSQL THROUGH YAST ON SLES 11
  1. Open YaST(just type yast in terminal)>Software>Software management(use Tab button to move between sections), or go straight to Install Software on main menu if you’re working through GUI
  2. In the search filed type mysql and press Enter or Search
  3. Select mysql package, mysql-client will be selected also automatically also, and press Accept to install them.
    (mysql user and mysql group will be created automatically, so you don’t need to do that)If you want to find out where did YaST installed all the files, you can do that either through the terminal with rpm -qal mysql command, or if you’re working through the GUI by opening YaST, typing mysql i search box and selecting mysql package. On the File List tab you can see where all the files are installed.

  4. Edit the /etc/my.cnf file, by adding user=mysql after the [mysqld]
    your file should look something like this:

    [mysqld]
     user = mysql
  5. Crate a mysql database with the following command:
    /usr/bin/mysql_install_db –user=mysql
  6. Start your server with:
    /usr/bin/mysqld_safe –user=mysql &
  7. Check if the server is running with:
    /usr/bin/mysqladmin version
    You should get information about the software version.
  8. Connect to your MySQL server with:
    /usr/bin/mysql -u root
    You should get the mysql> prompt if everything is okay.

 

There are other ways to install MySQL besides YaST, if you would like to install MySQL from source you can check this blog

cPanel a lot of accounts quota or bandwidth exceeded.

WHM/cPanel all packages get reapplied, and Upgrade/Downgrade notification is sent for all accounts.

lvemanager-1.0-9.9 has been released in production by CloudLinux yesterday, and it has caused issues on WHM/cPanel servers, by reapplying packages to all accounts.

https://cloudlinux.com/blog/clnews/lve-manager-1099-and-lveutils-1523-released-to-production.php

All accounts that had their quotas and limits modified, without modifying the related packages, have been reassigned to values that are specified in the package, they are assigned to. This will cause  quota or bandwidth being exceeded on a lot of accounts on the server, if you haven’t been modifying them properly.

If you have received a following type of mail for all accounts on your server,  that account Upgrade/Downgrade was made, then it is due to lvemanager update to lvemanager-1.0-9.9.

Upgrade/Downgrade: %account" from <[email protected]%hostname> for [email protected]

If you check your yum update logs, you will see lvemanager-1.0-9.9 has been installed on the server overnight, which is the cause of the issues with the packages being reapplied.

# grep lve /var/log/yum.log | tail -2
Dec 17 05:09:12 Updated: lve-utils-1.5-2.3.el6.cloudlinux.i686
Dec 17 05:09:27 Updated: lvemanager-1.0-9.9.el6.cloudlinux.noarch
#

According to the comments on CloudLinux blog

“You can find their last allocated settings from your last backup –
less /cpb/incremental/accounts/domainname/cp/domainname”

https://cloudlinux.com/blog/clnews/lve-manager-1099-and-lveutils-1523-released-to-production.php#comments

Update by CloudLinux:

CloudLinux has in the meantime issued a statement regarding LVE Manager 1.0-9.9 issues, with some details on how to revert the values to one prior the upgrade.

http://cloudlinux.com/blog/clnews/lve-manager-1099-issues.php

Excerpt from their blog:

If you have cPanel backups enabled, you can get previous limits from backups. Here is an example how to do it:

cd /backup/cpbackup/daily
tar -zxvf username.tar.gz username/cp
tar -zxvf username.tar.gz username/quota

cat username/quota
cat username/cp/username | egrep "MAX|BWLIMIT"

Then set limits manually with WHM –> Modify account.

UPDATED: Dec 18, 07:16 AM UTC

Here are some commands that should help you returning quotas back, if you have cpanel backups enabled.

Get list of users over quota:

cd /backup/cpbackup/daily/
repquota -a | grep "+" | awk '{ print $1 }' > users_overquota

Extract only quota files for them:

for i in `cat users_overquota` ; do echo "tar -zxvf "$i".tar.gz "$i"/quota" ; done | sh

Echo username and quota limit, the output value means Mb:

for i in `cat users_overquota` ; do echo "echo -e '\n'; echo "$i"; cat "$i"/quota " ; done | sh

Now use cpanel’s script to set quotas, based on above output add ‘M’ key for it. Copy-paste username and %value% and run command for each:

/scripts/editquota username %value%M

Another update:

CloudLinux has made another updated about the issue, and have provided a script that could be used to restore those limits if cPanel backups were enabled.

http://cloudlinux.com/blog/clnews/autorestore-package-limits-script-after-lvemanager1099-update.php

Excerpt from their blog:

Due to number of servers affected with custom package limits reset to package defaults we prepared a script that could be used to restore those limits if cPanel backups were enabled. It restores all limits if:

  • package was not changed since backup time;
  • limits are the same as package limits;
  • all package limits in backup are the same as current package limits.

Required files: %backup_location%/files/_etc_quota.conf.gz and %backup_location%/dirs/_var_cpanel.tar.gz . Please, restore them from a day/week before LVE Manager update (before December 16). Better to place them in the same /root/ directory.

Download the following script and make it executable:

wget http://kb.cloudlinux.com/scripts/autorestore.py
chmod 755 autorestore.py

Run it the following way:

./autorestore.py /root/_var_cpanel.tar.gz /root/_etc_quota.conf.gz
The script will back up current user limits to /var/cpanel/users.%timestamp% before changing limits.

How to remove author name on all your WordPress posts

Author name and links can be hidden in all WordPress posts on your site, by editing the default CSS Stylesheet, and adding the following to it:

.author {
     display: none;
}

Go to Appearance > Edit CSS, and you will be taken to CSS Stylesheet Editor.

Default CSS Stylesheet for Twenty Sixteen theme should look like this.

/*
Welcome to Custom CSS!

To learn how this works, see http://wp.me/PEmnE-Bt
*/

It should look something like this, after you add the snippet to hide name and link of the site account used to make the post.

/*
/*
Welcome to Custom CSS!

To learn how this works, see http://wp.me/PEmnE-Bt
*/
/* Remove posting account links from all posts*/
.author {
	display: none;
}

Source:

https://en.forums.wordpress.com/topic/can-i-remove-author-in-all-my-posts

How to reset NTFS permissions on drives or folders

This is a repost of a post from an old blog, made on November 22, 2012, that used to be on:

http://beginner.adminramble.com/reset-ntfs-permissions-drives-folders/

Original post:

Friend of mine had problems with the permissions on the external hard drive, he was constantly getting the Consent UI asking him for Administrator access because of the file permissions on the drive.

Here is how you can reset the NTFS permissions on hard drive or a folder to a default Windows permissions.

  • Click the Start button and in the Search bar type cmd
  • Right click the cmd.exe you get as the result and click on Run as administrator
  • In command prompt go to a drive or a folder you want to reset NTFS permissions using something like:
    cd /d e:\foldername
  • Reset NTFS with:
    icacls * /T /Q /C 
    /RESET
  • You should be able to work with files now without the Consent UI popping out all the time.