Category: RHEL

  • How to remove a package without removing dependencies in RHEL

    How to remove a package without removing dependencies in RHEL

    When you remove a package with the command

    yum remove PKG_NAME
    

    yum will remove all other packages that are dependent on the package you are removing.

    To remove a package without removing its dependency on Red Hat Linux or RHEL based distributions like CentOS, AlmaLinux, Rocky Linux or Oracle Linux, you can run the command

    rpm -e --nodeps PKG_NAME
    

    If you want to keep files, just remove the entry, use

    rpm -e --nodeps --justdb PKG_NAME
    

    Back to rpm

  • How to Install Gnome and xRDP on RHEL 8 (CentOS 8/Alma Linux/Rocky Linux)

    How to Install Gnome and xRDP on RHEL 8 (CentOS 8/Alma Linux/Rocky Linux)

    You can install Gnome Desktop + xdrp on a remote server (VPS/cloud or dedicated) and use it as a remote desktop for browsing or running applications. This instruction works for any RHEL 8 based distributions like CentOS 8, Alma Linux 8, Rocky Linux 8, and Oracle Linux 8.

    Install Gnome Desktop with

    dnf groupinstall -y --nobest Workstation
    

    After installing, reboot the server

    reboot
    

    xrdp package is provided by epel repository, so let’s enable it with

    dnf install -y epel-release
    

    install xrdp

    dnf install -y xrdp xrdp-selinux xorgxrdp
    

    Enable and start xrdp

    systemctl enable xrdp
    systemctl start xrdp
    

    Open port 3389 in the firewall

    firewall-cmd --add-port=3389/tcp --permanent
    firewall-cmd --reload
    

    Create a user and set a password for the user. This user will be used to login to remote desktop

    useradd -m --shell /bin/bash serverok
    usermod -aG wheel serverok
    passwd serverok
    

    Now you should be able to login to remote desktop using RDP.

    Once logged in, you may need to disable desktop animations to avoid lag by running the following command in the terminal.

    gsettings set org.gnome.desktop.interface enable-animations false
    
  • Set Static IP in RHEL 8 OVH VPS

    Set Static IP in RHEL 8 OVH VPS

    On OVH VPS running AlmaLinux 8, IPv4 IP address gets dropped. I have to connect to the server using KVM feature available in OVH control panel.

    OVH Cloud VPS KVM

    I checked IP of the server with the command

    ip a
    

    It did hot show any IPv4 IP address. I checked the network configuration file

    vi /etc/sysconfig/network-scripts/ifcfg-eth0
    

    That had the following content

    BOOTPROTO=dhcp
    DEFROUTE=yes
    DEVICE=eth0
    DHCLIENT_SET_DEFAULT_ROUTE=yes
    HWADDR=fa:16:3e:6b:a6:1a
    IPV6ADDR=2607:5300:201:3100::952/56
    IPV6INIT=yes
    IPV6_AUTOCONF=no
    IPV6_DEFAULTGW=2607:5300:201:3100::1
    IPV6_FORCE_ACCEPT_RA=no
    MTU=1500
    ONBOOT=yes
    TYPE=Ethernet
    USERCTL=no
    

    To make the IP static, I made the following changes.

    Find

    BOOTPROTO=dhcp
    

    Replace with

    BOOTPROTO=static
    

    Also added following 2 entry

    IPADDR=144.217.13.76
    GATEWAY=144.217.12.1
    

    144.217.13.76 is the IP address of the VPS.

    144.217.12.1 is the gateway used on the VPS, found using “ip route” or “route -n” command.

    [root@vps-eb960963 network-scripts]# route -n
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    0.0.0.0         144.217.12.1    0.0.0.0         UG    0      0        0 eth0
    144.217.12.1    0.0.0.0         255.255.255.255 UH    0      0        0 eth0
    [root@vps-eb960963 network-scripts]#
    

    Create a static route file

    vi /etc/sysconfig/network-scripts/route-eth0
    

    Add

    144.217.12.1 dev eth0
    default via 144.217.12.1 dev eth0
    

    Here 144.217.12.1 is the gateway IP address found in the above step.

    See IP