Useful Linux Command
How to search and replace a word in file in Linux? sed -i 's/original/new/g' file.txt…
How to fix error “Failed to download metadata for repo AppStream… in CentOS”?
When you run yum update, you may see error said “Failed to download metadata for repo AppStream…”, following is how to fix such error:
cd /etc/yum.repos.d/
run the following commands to modify some repo files:
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* dnf update then you can run yum update or yum --security update to update only security patches.