แสดงบทความที่มีป้ายกำกับ yum แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ yum แสดงบทความทั้งหมด

20/07/2560

ติดตั้ง Elastix แล้วไม่สามารถใช้คำสั่ง yum ได้

เมื่อติดตั้ง Elastix แล้วไม่สามารถใช้คำสั่ง yum ได้ 

กรณีพบปัญหา
[root@sip ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. Invalid release/
removing mirrorlist with no valid mirrors: /var/cache/yum/addons/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: addons


ให้ทำการแก้ไขไฟล์

/etc/yum.repos.d/CentOS-Base.repo

ให้มีค่าตามนี้

10/01/2560

วิธีลบ epel-release.noarch ที่ลงเกิน Version (ปัญหาใช้งาน yum ไม่ได้)

ปัญหาที่พบคือ เมื่อนำ epel-release.noarch ของรุ่นที่ใหม่กว่ามาลงในรุ่นที่เก่ากว่า จะเกิดปัญหาไม่สามารถภ yum ได้ โดยจะมี Error ประมาณนี้
[root@chi ~]# yum update Loaded plugins: fastestmirror Setting up Update Process Loading mirror speeds from cached hostfile epel/metalink | 4.9 kB 00:00 * base: mirror1.ku.ac.th * epel: mirror01.idc.hinet.net * extras: mirror1.ku.ac.th * updates: mirror1.ku.ac.th * webtatic: uk.repo.webtatic.com epel | 4.3 kB 00:00 http://mirror01.idc.hinet.net/EPEL/6/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel Trying other mirror. epel | 4.3 kB 00:00 http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/6/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel Trying other mirror. epel | 4.3 kB 00:00 http://mirror.rise.ph/fedora-epel/6/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel Trying other mirror. epel | 4.3 kB 00:00 http://repo.fedoralinux.ir/repos/centos/epel/6/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel Trying other mirror. epel | 4.3 kB 00:00 http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel Trying other mirror. epel | 4.3 kB 00:00 https://free.nchc.org.tw/fedora-epel/6/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel Trying other mirror. epel | 4.3 kB 00:00 https://mirrors.tuna.tsinghua.edu.cn/epel/6/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel Trying other mirror. epel | 4.3 kB 00:00 https://epel.mirror.angkasa.id/pub/epel/6/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel Trying other mirror. epel | 4.3 kB 00:00 http://ftp.cuhk.edu.hk/pub/linux/fedora-epel/6/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel Trying other mirror. epel | 4.3 kB 00:00 https://mirrors.thzhost.com/epel/6/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel Trying other mirror. epel | 4.3 kB 00:00 http://mirrors.bestthaihost.com/epel/6/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel Trying other mirror. epel | 4.3 kB 00:00 http://mirror2.totbb.net/epel/6/x86_64/repodata/repomd.xml: [Errno -1] repomd.xml does not match metalink for epel Trying other mirror. Error: Cannot retrieve repository metadata (repomd.xml) for repository: epel. Please verify its path and try again
เจอครั้งแรก ยังไม่เข้าใจ ยอมแพ้ ต้องลง OS ใหม่เลยทีเดียว พอหลาย ๆ ครั้งเริ่มจะเข้าใจ (ติดปัญหานี้ ตั้งแต่ 6 โมงเย็น ตอนนี้ ตีหนึ่งกว่าแล้ว) สามารถแก้ไขได้ตามนี้ครับ http://www.cyberciti.biz/faq/centos-redhat-fedora-linux-remote-yum-repo-configuration/ ตรวจสอบไฟล์ repo
# cd /etc/yum.repos.d/ # ls -l
จะพบ
-rw-r--r-- 1 root root 954 Aug 11 2010 epel.repo -rw-r--r-- 1 root root 1054 Aug 11 2010 epel-testing.repo -rw-r--r-- 1 root root 561 Dec 14 2010 rhel-debuginfo.repo -rw-r--r-- 1 root root 222 Dec 14 2010 rhel-source.repo -rw-r--r-- 1 root root 235 Jan 16 15:27 srpm.repo
สั่งลบ
# rm epel.repo epel-testing.repo ### ***************************** ### ### make sure you delete GPG keys also ### ### ***************************** ### # rm /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL # yum clean all
ตรวจสอบว่าเป็นรุ่นไหน แล้วก็การลบ
# [root@chi ~]# rpm -qa | grep epel epel-release-6-8.noarch [root@chi ~]# yum remove epel-release-6-8.noarch Loaded plugins: fastestmirror Setting up Remove Process Resolving Dependencies --> Running transaction check ---> Package epel-release.noarch 0:6-8 will be erased --> Finished Dependency Resolution
แล้วทดสอบ ทำการ yum ใหม่อีกครั้ง คราวนี้จะสามารถใช้งานได้ตามปกติแล้วครับบ

วิธีลบ php และเลือกติดตั้ง version ที่มี พร้อมให้เลือกใน yum repo บน CentOS

เริ่มต้นให้ตรวจสอบว่า php และโปรแกรมที่่เกี่ยวข้อง ที่มีเป็น version อะไรอยู่
# yum list installed | grep php
ถ้าพบว่ามีอยู่ก็ทำการลบ ออกก่อน
# yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x86_64
เพิ่ม PHP 5.4 packages ไปที่ yum ด้วยคำสั่งสำหรับ CentOS 5.x
# rpm -Uvh http://mirror.webtatic.com/yum/el5/latest.rpm
หรือสำหรับ CentOS 6.x
# rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
ตรวจสอบ Version ที่พร้อมให้ติดตั้ง ได้ทั้งแบบเฉพาะรุ่น หรือให้แสดงทั้งหมด
# yum list available | grep php # yum list available | grep php54
ทำการติดตั้ง Version ที่ต้องการ
# yum install php54w.x86_64 php54w-cli.x86_64 php54w-common.x86_64 php54w-gd.x86_64 php54w-ldap.x86_64 php54w-mbstring.x86_64 php54w-mcrypt.x86_64 php54w-mysql.x86_64 php54w-pdo.x86_64
เมื่อติดตั้งเสร็จแล้ว สามารถตรวจผลการติดตั้งได้
# php -v PHP 5.4.17 (cli) (built: Jul 23 2013 00:02:04) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
สุดท้ายอย่าลืม Restart Service
# service httpd restart
ที่มา http://www.shayanderson.com/linux/centos-5-or-centos-6-upgrade-php-to-php-54-or-php-55.htm

แก้ปัญหา yum install htop จาก host ภายในประเทศไม่ได้

กรณีที่ ใช้ CentOS แล้วไม่สามารถ สั่ง yum install htop
ลองตรวจสอบแล้ว พบว่า เป็นการตวจสอบ host จากภายในระบบเท่านั้น
# yum install htop
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.thzhost.com
* extras: mirrors.thzhost.com
* updates: mirrors.thzhost.com
Setting up Install Process
No package htop available.
Error: Nothing to do

ให้ทำตามขึ้นตอนนี้จะสามารถ yum ได้ครับ
#wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
#rpm -Uhv rpmforge-release*.rf.x86_64.rpm
#yum install htop

ซึ่งได้ผลที่แตกต่างออกไป
# yum install htop
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.thzhost.com
* extras: mirrors.thzhost.com
* rpmforge: mirror.oscc.org.my
* updates: mirrors.thzhost.com
rpmforge | 1.9 kB 00:00
rpmforge/primary_db | 2.7 MB 00:08
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package htop.x86_64 0:1.0.3-1.el6.rf will be installed
--> Finished Dependency Resolution