How to Check for Installed Packages on CentOS

Reading Time: 3 minutes

While managing your server, you’ll sometimes need to check on which software (or packages) you have installed on your system. You’ll need to know package names, version numbers, dates of installation, etc. In this Liquid Web tutorial, we’re going to be discussing how to inspect packages installed on your CentOS system. There are several ways to accomplish this, and we’ll discuss a few of them. Let’s dig in! To use these commands, you’ll need to log in to your server via SSH. For more information, see Logging into Your Server via Secure Shell (SSH).

Using RPM Package Manager

This first command uses the rpm package manager to poll for installed packages. This command allows you to see every installed package on your system, along with the version that is currently installed:

rpm -qa
Note the -q means “query” and -a means “all”. We’re asking rpm to query all installed packages.

Let’s examine a small portion of the results in detail. Note that you might not have these specific packages installed on your CentOS server. The important thing here is to understand how to read the output. Take a look at a small excerpt of entries from the list.kpartx-0.4.9-123.el7.x86_64
dracut-033-554.el7.x86_64
elfutils-libs-0.172-2.el7.x86_64

Each entry can be broken up into three parts. From left to right, these are:
Package name: (kpartx)
Version: (0.4.9-123.el7)
Architecture: (x86_64)

Instead of displaying all installed packages, rpm can also be used to search for a single package. Let’s use rpm to query kpartx:
rpm -q kpartx
You’ll see the output displays the same package name and version we saw from rpm -qa.
kpartx-0.4.9-123.el7.x86_64

Using Yum to Check Installed Packages

Using rpm is not the only way to check for installed packages on your system. Now we will discuss how to use “yum” to accomplish the same task. Try the following command:
yum list installed
You will see that the list yum provides is formatted slightly differently. Let’s look at an entry in depth.
whois.x86_64 5.1.1-2.el7 @base
The first column shows the package name and architecture: (whois.x86_64).
The second column shows the version installed: (5.1.1-2.el7).
Finally the third column shows the repository the software was installed from: (@base).

Using Yum to View Historical Installation Data

We can also use yum to view historical installation data on your system. Run the following command to see a list of anytime yum was used to install, remove, or upgrade a package:
yum history
Here is an example of the output you might see. Your system will show different results here, and that is OK. We’re just interested in learning how to read the output.
ID | Command line | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
10 | upgrade | 2019-06-01 04:13 | I, U | 12 EE
9 | install whois | 2019-05-04 17:40 | Install | 1
8 | install python36 | 2019-05-03 21:23 | Install | 2
7 | install epel-release | 2019-05-03 21:02 | Install | 1
6 | install bind-utils | 2019-05-03 19:33 | Install | 2
5 | install docker-ce docker | 2019-05-03 17:37 | Install | 4
4 | install yum-utils yum-co | 2019-05-03 17:26 | Install | 6
3 | install git | 2019-05-03 17:19 | Install | 4
2 | install vim | 2019-05-03 17:18 | Install | 31
1 | update | 2019-05-03 17:09 | I, U | 57
history list

Notice the column headings: “ID number, Data and time, Action(s), and Altered.” This is a good summary of when yum was used, but it is lacking detailed information. Let’s examine one of these history entries in detail. Try the following command, replacing “ID_NUMBER” with the actual ID you want to inspect.
yum history info ID_NUMBER

Here is some example output:
Loaded plugins: fastestmirror
Transaction ID : 9
Begin time : Sat May 4 17:40:24 2019
Begin rpmdb : 356:8ab21eca9f4a219812e33c41a73fbd4eb7de1ed8
End time : (0 seconds)
End rpmdb : 357:cf2bf4588ba4d3263d1c9af051c3bcc525596a68
User : Cloud User <centos>
Return-Code : Success
Command Line : install whois
Transaction performed with:
Installed rpm-4.11.3-35.el7.x86_64 installed
Installed yum-3.4.3-161.el7.centos.noarch installed
Installed yum-plugin-fastestmirror-1.1.31-50.el7.noarch installed
Packages Altered:
Install whois-5.1.1-2.el7.x86_64 @base
history info

In this tutorial, we discussed how to use rpm and yum to search your CentOS server for installed packages. These utilities are both critical tools for Linux sysadmins on CentOS systems. Of course if you have any questions about how to use these utilities on your own Liquid Web server, let us know! The Most Helpful Humans in Hosting are standing by 24×7 and we’ll be happy to answer your questions.

How Do I Connect My Mac to Windows?

Reading Time: 1 minute

Mac users work in their native Unix environment are familiar with using the terminal to SSH into their Linux based servers. When using a Mac to log into a Windows environment, or vice versa,  the task is performed differently. Window machines use a different protocol, one aptly named RDP (Remote Desktop Protocol). For our tutorial, we’ll explore how to use your Mac to connect to a Windows server.  Let’s get started!

 

Pre-flight

 

Step 1:  Open Finder >> Applications >> App Store.  We’ll be going to the App Store to download Microsoft Remote Desktop.

 

Step 2. Use the search bar to locate Microsoft’s Remote Desktop. Select Get >> Install App. After installed, click on the Microsoft Remote Desktop icon in your Applications folder.

Note
iCloud is absolutely free, but they require a valid credit card on file, even for free apps.

 

Step 3: Launch the app by finding it in your Applications folder.

 

Step 4: For our connection select + New and fill out the information in the highlighted boxes for the Windows server.Connection Name: A nickname to identify this connection

PC Name: Window’s server IP address

User Name: Administrator

It seems counter-intuitive but close the edit window to save the settings. Immediately, you’ll see the server show up in your My Desktops list.

 

Step 5: Click on the server name to connect to your Windows environment. If all the information was correctly entered you’ll see the Window’s environment with the familiar Windows desktop background.

 

How to Install MySQL on Windows

Reading Time: 2 minutes

If you’re using a Windows-based server to host your content, you may using Microsoft’s database server product, MSSQL. However, licensing restrictions can make using MSSQL difficult, especially for small businesses. Microsoft offers a free version of MSSQL called MSSQL Express that will be suitable for many users, but this version does have limitations on database size and memory usage. If you need a more robust database solution but want to try something with a lower cost (like a free, open-source database server), you could try MySQL database server.

MySQL is a standard part of the typical Linux server build (or LAMP stack) but is also available for use on Windows operating systems. Depending on your needs, you could fully develop your database in MySQL. Many popular Content Management Systems (CMS) also use MySQL by default, so using MySQL to manage those applications may be beneficial. MySQL and MSSQL can be run on the same server at the same time, so you’re free to use both or to experiment as needed.

Installing MySQL on your Windows server is as simple as downloading an MSI Installer package and clicking through a few options.

  1. Download the MySQL Installer from dev.mysql.com. The two download options are a web-community version and a full version. The web-community version will only download the server, by default, but you can select other applications (like Workbench) as desired. The full installer will download the server and all the recommended additional applications. (You’ll also be asked to create a user account, but you skip this part by scrolling down to the bottom and clicking “No thanks, just start my download”.)

  2. Run the installer that you downloaded from its location on your server, generally by double-clicking.
    Note
    You can use this same MSI Installer to upgrade currently installed versions of MySQL as well! As is typical, the first step is accepting the license agreement, then click Next.

  3. Determine which setup type you would like to use for the installation:
    1. Developer Default: this is the full installation of MySQL Server and the other tools needed for development. If you are building your database from the ground up or will be managing the data directly in the database, you’ll want to use this setup type.
    2. Server Only: if you only need MySQL Server installed for use with a CMS or other application and will not be managing the database directly, you can install just the server (you can always install additional tools later).
    3. Custom: this setup type will allow you to customize every part of the installation from the server version to whichever additional tools you select.

  4. Install the server instance and whichever additional products you selected. Then begin the configuration process by selecting the availability level (most users will use the default, standalone version).
  5. Complete the configuration process by following the onscreen instructions. You’ll want to make sure to install MySQL as a Service so that Windows can automatically start the service after a reboot or can restart the service if it fails. For additional, step-by-step instructions, see MySQL Server Configuration with MySQL Installer.

How to Setup and Use Microsoft SQL Server Management Studio

Reading Time: 4 minutes

What is SSMS?

SQL Server Management Studio (SSMS) is a free Windows application to configure, manage, and administer Microsoft SQL Server (MSSQL). SSMS includes an Object Explorer to view and interact with databases and other elements, a Query window to write and execute Transact-SQL queries, and script editors for developers and administrators. Continue reading “How to Setup and Use Microsoft SQL Server Management Studio”

Installing Redis on Ubuntu 16.04/18.04

Reading Time: 4 minutes

What is Redis? 

Redis or “REmote DIctionary Server” is defined as an open source, “key-value” database storage medium, which is additionally known as a data structure server. At its heart, Redis works with key-value pairs and stores data in a location that’s easily referenceable by two specific values. These key-value associations are usually a set of two linked data entries which are made up by a key, which is a unique identifier for a type of data and, the value, which can be either the particular data that is identified or, an indicator to the location of that data.

Redis has five main data types it can utilize:

  • Strings – Strings are a basic value in Redis. They can contain any kind of data size up to 512Mb including jpegs or other objects like blobs.
  • Lists – Lists are exactly as the name implies; simply lists of strings, sorted by the order in which they are applied
  • Sets – Sets are simply a group of unordered strings
  • Sorted Sets – Sorted Sets are akin to regular sets. The main difference is that sorted set items are associated with, and sorted by a weighted score field. This allows for priority items to be set when entered data into the sorted set
  • Hashes – Hashes map the string fields and values themselves. They are capable of defining multiple elements and can store more than 4 billion field-value pairs

Redis holds the database entries entirely in memory, and will only use the hard disk for persistent storage. These key-value pair values are often used in hash tables, lookup tables and configuration files. Redis can accept key-values for a wide variety of formats so operations can be run on the server with a reduced server workload. Redis can also replicate data to any number of slave servers which makes it a prime candidate for large database replication setups.

 

What Are the Advantages of Redis?

  1. Redis is extremely fast − Redis can perform hundreds of thousands of (set, get) commands per second.
  2. It supports well know data types − As noted above, Redis supports most of the data types normally used by developers such as strings, lists, sets, sorted sets, and hashes.
  3. Operations are protected (or atomic) which means:
    1. All operations in a transaction are chronological and executed in sequence
    2. All operations in a transaction are performed as a single unit of work which limits interference from other operations
  4. .Multifunction database − Redis is a multifunction, noSQL database that can be used in a wide variety of use cases including caching, large dataset, full-text searches, spark data processing or any other short-lived data manipulation.

All of these options place Redis firmly in the middle of the NoSQL ecosystem.

 

What is NoSQL?

NoSQL is a type of database design that takes into consideration a wide group of data models, including key-value, document, columnar and graph formats.

NoSQL stands for “not only SQL” and is an alternative to the more traditional relational databases like MySQL in which data is laid out in tables, and the data scheme is carefully constructed before the actual database is created. NoSQL databases are especially useful for working with very large distributed datasets

A quick breakdown of how NoSQL stacks up against other database schemes:

 

Install Redis on Ubuntu

To install Redis on Ubuntu, SSH into your server, once at the command prompt type the following commands. This will install Redis on your server.

apt-get update

apt-get install redis-server

 

Start Redis

redis-server

Next, let’s ensure Redis starts at boot:

systemctl enable redis-server.service

Also, let’s set one of the main memory variables in the Redis config (this value will depend on your servers available memory)

vim /etc/redis/redis.conf

maxmemory 256mb

maxmemory-policy allkeys-lru

Finally, let’s restart Redis to ensure the values are retained:

systemctl restart redis-server.service

 

Check If Redis is Active

Run the following command at the servers command prompt:

redis-cli

This will open a Redis prompt.

redis 10.0.0.1:6379

After running the above command, your servers IP address (10.0.0.1) and the port Redis is running on will be shown (6379).

Now type in the following command at the Redis prompt:

redis 10.0.0.1:6379> ping
PONG
PONG” shows that Redis is successfully installed on your machine.

 

Install Redis via Source

To install Redis manually via source, simply SSH into your server and run the following command:

wget http://download.redis.io/redis-stable.tar.gz && tar xvzf redis-stable.tar.gz && cd redis-stable && make && make install

The Redis configuration file will be in the current install directory. Let’s copy it to a better location:

mkdir /etc/redis
cp redis.conf /etc/redis/

Now, let start Redis:

redis-server /etc/redis/redis.conf &
redis-cli ping
PONG

Lastly, here is a fun way to test Redis out. Try it!  Overall, if you need a fast, robust, and highly scalable NoSQL solution for use with your application or as a project adjunct Redis can meet your needs! Try it out on one of our Private Cloud product offerings or one of our stable, reliable Dedicated servers!

 

Meetups and Contacts for Redis

We’d like to send a shout out to the people over at https://redislabs.com/ who have provided some of the best and most excellent support over the years, awesome job!

For enterprise support, contact:
Blake Lipps-midwest Redis account rep/consultant
Drake Albee -west coast Redis consultant

For individual support, see the Redis community pages. The areas in which you can find active support or interact with the Redis community are noted here:

  • The HQ of the Redis community is on Reddit in the subreddit. You can use that community to ask for help, post new ideas for new features, link to articles of interest for the Redis community, and/or have other questions answered
  • Join the mailing list by subscribing via email
  • Meet up in the #redis channel on Freenode (web access link)
  • Check the Redis tag on Stack Overflow
  • Follow Redis news feed on Twitter

If you happen to live in one of the larger cities listed below, there are Local Redis meetup groups as well! Local Redis meetup info:

 

Install and Configure Git on Ubuntu 18.04

Reading Time: 1 minute

What is the purpose of Git?

Git gives you a way to not only track changes in source code, but it can also be used to track changes in files.  It then stores the data in what is called a repository, also known as a repo. Continue reading “Install and Configure Git on Ubuntu 18.04”

What are Common Commands to Update WordPress Using WP-CLI?

Reading Time: 2 minutes

WP-CLI is a very handy set of commands. You can run anything that you would run in wp-admin on a WordPress site but from the command line. Useful commands which WP-CLI employs to keep WordPress core updated plugins including the default themes which come with WordPress.

Continue reading “What are Common Commands to Update WordPress Using WP-CLI?”

Install the LAMP Stack Using Tasksel on Ubuntu 16.04

Reading Time: 4 minutes

There are multiple ways of installing software on Debian based systems like Ubuntu and Mint. Tools like apt, apt-get, aptitude and/or synaptic are usually used to install single applications into the desktop editions of those OS. Alternatively, Tasksel is a command line app for installing a “group” of related packages onto a server. Tasksel is not installed by default on the desktop editions of the ‘nix’ versions that contain the above-mentioned package managers but, it is installed on later versions of Debian and Ubuntu server editions.

How Does Tasksel Work?

Continue reading “Install the LAMP Stack Using Tasksel on Ubuntu 16.04”

Install TeamViewer on Ubuntu 16.04 LTS

Reading Time: 4 minutes

VNC (Virtual Network Computing) is a method for sharing a remote desktop environment. Allowing you to remote control another computer or server over the Internet or local network as if you were sitting in front of it. Keyboard and mouse strokes from your computer are relayed to the remote computer/server. There are many different kinds of VNC softwares available today. Several are cross-platform and add additional features, such as chat or file transfers. VNC is often used for remote technical support and remotely accessing files.

What is TeamViewer?

Continue reading “Install TeamViewer on Ubuntu 16.04 LTS”