Installing Software (yum and Package Managers) - Images: Japanese
Hey there, everyone!
This time we're looking at software installation. Just as installing new applications is an important part of working with Windows or macOS, installing software on a CUI-based OS is equally essential. Let's walk through how it works.
Modern UNIX-like systems have a mechanism called a package manager — an automated system for installing software, comparable to an installer wizard on Windows or macOS. We'll use it now to install Vim, the enhanced version of vi.
One thing to be aware of: the package manager tool name varies by OS. On CentOS and other Red Hat-based systems, it's called 'yum'. On Ubuntu and other Debian-based systems, it's apt-cache or apt. On macOS, neither is included by default, but Homebrew and MacPorts are widely used. Trying to run yum on macOS won't work, so keep that in mind.
While each OS has its own default package manager, the boundaries have gotten blurry over time. Packages that were originally available only through apt can now be installed on CentOS through various means, and vice versa. The author personally writes a lot of custom programs and doesn't tend to layer on too many third-party packages — but if you find yourself needing software from a different ecosystem, a quick search will usually turn up a way to get it running. It's quite flexible these days.
Log in to your CentOS as root as usual. The yum command requires administrative privileges, so it must be run as root or a user with equivalent permissions.
Since this is the first time using yum, it's good practice to update it before installing anything. This isn't strictly required, but running outdated software with potential security vulnerabilities isn't ideal. Updating is straightforward:
[root@localhost ~]# yum update
A long list of software packages will scroll by. At the end, you'll be asked whether to proceed. There may be two confirmation prompts — answer yes to both.
When prompted with something like Is this OK? [y/N], type y for yes or N for no. This is a very common pattern in CUI environments, so if English isn't your first language, it's worth remembering.
After confirming, CentOS will do its thing. It may take a while — sit back and wait. Cutting power during this process can cause problems, so just let it run.
Once a completion message appears and you're back at the prompt, the update is done.
Now let's install Vim. Again, very straightforward:
[root@localhost ~]# yum install vim
yum will automatically locate all the packages required to run Vim and download them. When prompted with [y/N], type y.
Once the prompt returns, the installation is complete. Let's verify:
[root@localhost ~]# vim test.txt
If Vim launches, the installation worked. You now have Vim available alongside the original vi. Package managers make this kind of thing very straightforward.
To uninstall software, the command is:
[root@localhost ~]# yum remove vim
yum remove <package-name> will uninstall it. One thing to note: yum remove only works for packages that were installed through yum. Built-in commands like ls and cd are not managed by yum and cannot be removed this way.
Here are a few more commonly used yum commands worth knowing:
To see a list of all installable packages:
[root@localhost ~]# yum list
This produces a very long list, but it's useful when you want to know what's available before installing.
To see only the packages already installed on the system:
[root@localhost ~]# yum list installed
Also a long list — heads-up.
For day-to-day use, the five commands that cover most situations are: yum update, yum install <package>, yum remove <package>, yum list, and yum list installed. There are others, but when you need them, a quick search will fill in the gaps.
That covers the basics of yum and package management. In the next article, we'll look at user management. See you there!
This article was written by Sakurama.
Author's beloved small mammal |
桜舞 春人 Sakurama HarutoA Tokyo-based programmer who has been creating various content since the ISDN era, with a bit of concern about his hair. A true long sleeper who generally feels unwell without at least 10 hours of sleep. His dream is to live a life where he can sleep as much as he wants. Loves games, sports, and music. Please share some hair with him. |
If you find any errors or copyright issues, please contact us.