\n
sudo whoami<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nIf the new user has sudo privileges, this command will output ‘root’.<\/p>\n\n\n\n
Step 2: Update system packages <\/h2>\n\n\n\n If you have older versions of Rocky Linux such as Rocky Linux 8, this distribution does not offer an upgrade path from any version of Rocky Linux 8. If you are just starting with Rocky Linux, you can install the latest 9.4 version. If you are using earlier Rocky Linux 9.x versions, you can upgrade without issues to the 9.4 version by using the standard dnf<\/strong> command.<\/p>\n\n\n\nWe can check the installed kernel version by running the following command:<\/p>\n\n\n\n
\n
uname -r<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nNow, we will make sure to update system packages to the latest versions.<\/p>\n\n\n\n
\n
sudo dnf update -y<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nIf you have some older version of Rocky Linux 9, you can update your system to the latest 9.4 version by running the following command:<\/p>\n\n\n\n
\n
sudo dnf -y upgrade<\/p>\n<\/div><\/div>\n\n\n\n
In our case, the output of this command will tell us that no action is needed.<\/p>\n\n\n\n <\/figure>\n\n\n\nStep 3: Install Tools (Optional)<\/h2>\n\n\n\n Rocky Linux includes numerous software development tools. Continue on with this tutorial if an overview would be helpful. Proceed by installing the Extra Packages for Enterprise Linux or EPEL, which holds various useful packages for development as well as system tools.\u00a0<\/p>\n\n\n\n
\n
sudo dnf install epel-release -y<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nWe can also install git to enhance our development workflow and version control.<\/p>\n\n\n\n
\n
sudo dnf install git -y<\/p>\n<\/div><\/div>\n\n\n\n
We can verify the latest 2.43.0 version by running the following command:<\/p>\n\n\n\n
\n
git –version<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nRocky Linux 9.4 comes with Python 3.9 preinstalled. We can verify the version:<\/p>\n\n\n\n
\n
python –version<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nSince Red Hat Enterprise Linux 9.4 introduces the possibility to update to Python 3.12 same as Rocky Linux 9.4, we can install it additionally.<\/p>\n\n\n\n
Next, install the Python 3.12 version as well as PIP, which is Python’s package manager.<\/p>\n\n\n\n
\n
sudo dnf install python3.12 sudo dnf install python3.12-pip<\/p>\n<\/div><\/div>\n\n\n\n
Python 3.12 and packages built for it can be installed in parallel with Python 3.9 but we can select which should be the default version.<\/p>\n\n\n\n
\n
sudo alternatives –install \/usr\/bin\/pip3 pip3 \/usr\/bin\/pip3.9.18 1 sudo alternatives –install \/usr\/bin\/pip3 pip3 \/usr\/bin\/pip3.12 2<\/p>\n<\/div><\/div>\n\n\n\n
Next, we can choose the option for Python 3.12 version<\/p>\n\n\n\n
\n
sudo alternatives –config pip3<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nType ‘2’ and then press Enter to confirm the choice. Once done, we can verify that we are using the latest version by running the command:<\/p>\n\n\n\n
\n
python –version<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nStep 4: Install and Configure Podman<\/h2>\n\n\n\n Podman is a seamless container engine for developing, managing, and running OCI containers on a Linux system. This Rocky Linux 9.4 version came with various improvements related to Podman, so let’s explore it.<\/p>\n\n\n\n
First, we will install Podman on our Rocky Linux by running the command:<\/p>\n\n\n\n
\n
sudo dnf install -y podman<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nVerify Podman installation by running the command:<\/p>\n\n\n\n
\n
podman –version<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nIn our example, we will use Alpine, the lightweight, security-oriented Linux distribution designed for efficiency and simplicity. This image is around 5MB, which is perfect for containers since small size leads to faster downloads and improved performance. In this process, let’s pull the latest ‘alpine’ image from Docker Hub:<\/p>\n\n\n\n
\n
podman pull alpine:latest<\/p>\n<\/div><\/div>\n\n\n\n
This will download this light-weight image and we can proceed to run the container from the Alpine image and execute the command:<\/p>\n\n\n\n
\n
podman run –rm alpine:latest echo “Hello, Rocky Linux!”<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nWe can also create a custom container image using the Alpine image as a base. Paste the following code in your terminal and press Enter:<\/p>\n\n\n\n
\n
cat <<EOF > Containerfile FROM alpine:latest RUN apk add –no-cache curl CMD [“curl”, “–version”] EOF<\/p>\n<\/div><\/div>\n\n\n\n
Now, build the custom image:<\/p>\n\n\n\n
\n
podman build -t custom-alpine:latest .<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nRun a container from the custom image that we have created:<\/p>\n\n\n\n
\n
podman run –rm custom-alpine:latest<\/p>\n<\/div><\/div>\n\n\n\n <\/figure>\n\n\n\nWhen we run this command, Podman creates a new container based on ‘custom-alpine:latest<\/strong>‘ image. It includes setting up the necessary file system, network, and process namespaces. Then, based on the command we defined in our Containerfile<\/strong>, the curl –version<\/strong> is executed inside the container. This command checks the version of the ‘curl’ tool and outputs it to the terminal. Finally, we have the –rm<\/strong> flag that tells Podman to automatically remove the container after it has finished executing the command. <\/p>\n\n\n\nThis process demonstrates how to install Podman as well as to create and use a simple custom container image, highlighting the benefits of efficient container lifecycle management.<\/p>\n\n\n\n
Conclusion<\/h2>\n\n\n\n This version of Rocky Linux offers a reliable, secure, and high-performance operating system that is well-suited for a wide range of enterprise and development environments. Whether you are a system administrator, developer, enterprise user, or just a Linux enthusiast, Rocky Linux 9.4 provides the tools and features to build and manage efficient and secure IT infrastructure.<\/p>\n","protected":false},"excerpt":{"rendered":"
Learn how to upgrade to Rocky Linux 9.4 in this step-by-step tutorial.<\/p>\n","protected":false},"author":150,"featured_media":111677,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_oasis_is_in_workflow":0,"_oasis_original":0,"_oasis_task_priority":"","inline_featured_image":false,"footnotes":""},"categories":[2781],"tags":[],"collection":[2778],"platform":[],"funnel_stage":[3017],"coauthors":[2535],"acf":[],"yoast_head":"\n
How to Upgrade to Rocky Linux 9.4 - 探花大神<\/title>\n \n \n \n \n \n \n \n \n \n \n \n \n\t \n\t \n\t \n \n \n \n\t \n\t \n\t \n