Technology Insights

Ubuntu apt-get upgrade – The following packages have been kept back

When upgrading packages on Ubuntu using the apt-get upgrade command you may notice that some packages are not upgraded. Ubuntu will not upgrade packages that could have a major impact to service on the server such as the kernel, kernel headers, MySQL packages, and various others. The packages are held back by aptitude as a safeguard to keep people from upgrading packages that might keep the server from rebooting or that might corrupt something like a database. Below we show the error in more detail and explain the command that can be run to upgrade the packages that are being held back.

Technology Insights

Update WordPress Amazon Product in a Post Plugin 2.X to Amazon Product in a Post Plugin 3.X

If you use the Amazon Product In A Post Plugin on WordPress you might have either not upgraded yet or decided to not upgrade because the shortcode syntax has changed. You can get around not upgrading by updating the WordPress post content immediately after you upgrade the Amazon Product In A Post Plugin. Below I describe the version that I upgraded and the MySQL syntax used to update the shortcode syntax to display Amazon products in WP posts.

Technology Insights

Create MySQL User With mysqladmin

When setting up a server or group of servers for the first time you may find yourself wanting to create MySQL users without having to login to MySQL. It would make sense for the mysqladmin command to offer this functionality but it does not. Instead you can create the MySQL user with the mysql command as shown in the below example performed on a server running Ubuntu Linux 12.04  also known as Precise Pangolin.

Technology Errors

GPG key retrieval failed: [Errno 5] OSError: [Errno 2] No such file or directory: /etc/pki/rpm-gpg/RPM-GPG-KEY-remi

Earlier while upgrading PHP to version 5.3.5 on a CentOS server I copied over the details of the remi repository from another server I had upgraded PHP on. Once I started the transaction all looked well until Yum needed to verify the remi repo RPM GPG key which I had not installed so an error was provided and Yum stopped the PHP upgrade process. You can get around the RPM GPG key error by simply using the –nogpgcheck switch however that is not the correct way to resolve the problem. You should instead install the RPM GPG key and the below example shows how to install the RPM GPG key for the remi repo.

Technology Errors

WordPress database error Duplicate entry X for key yarpp_content for query UPDATE wp_posts SET, MySQL Error

Today I was adding a note to a WordPress article I had written a couple of days ago and it appeared to POST without issue after I clicked the Update button in the WordPress admin. I went to the front-end of the site to verify the new content formatted correctly and to my surprise it wasn’t displaying so I figured I must have left a HTML tag or something open since I didn’t get any errors within the WordPress admin when I clicked the Update button for the Post. After further review the content didn’t exist and it appeared that the article had not posted the update at all since there were zero revisions from today. Fixing the problem is easy by using the below information that describes where I located the error, the error itself, and how to resolve it by issuing a single MySQL command.