Showing posts with label CentOS. Show all posts
Showing posts with label CentOS. Show all posts

Wednesday, March 8, 2017

[php][centos][Resolved] No package php7.1-gd available.

Background

I tried to use this command to install gd module for php version 7.1 but fail, here is the command and message:

Command
sudo yum install php7.1-gd
Result

Solution
Use command to search the available repository in mirror first:
yum search php-gd
and you would found a list of available repository

According the image, i think the module php71-php-gd.x86_64 maybe fit me cos i am using php7.1, so i try a new command to install it:

sudo yum install php71-php-gd.x86_64

and it works !
type "y" and enter to install that :


 Done :

don't forget restart your server:
sudo systemctl restart httpd.service
service httpd restart
 

Wednesday, February 15, 2017

[Resolved] yum cannot find a valid baseurl for repo

[root@localhost ~]# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 6 - ""
Error: Cannot find a valid baseurl for repo: base
Run the "yum update" command and get this error Error: Cannot find a valid baseurl for repo: base.
Thing to do is to try run the dhclient to obtain fresh IP and then run yum update again.
#dhclient

Reference

http://stackoverflow.com/questions/30424860/yum-error-centos-7-1-x86-64
https://www.cyberciti.biz/faq/howto-linux-renew-dhcp-client-ip-address/
https://www.centos.org/forums/viewtopic.php?t=947

Friday, July 24, 2015

[CentOS] Grant user permission with command line [edit sudoers file]

The command works on CentOS and Fedora only, and sample OS is CentOS version 7.0: 

Step 1

To grand permission to users, you need to edit your sudoers file, the command "visudo" is to open sudoers file to edit.

visudo


Step 2 

Press the key "i" to enter insert mode.

Step 3 

Scroll down on the line "## Allow root to run any commands anywhere", and add the user's name you want grand them permission:

## Allow root to run any commands anywhere
root                      ALL=(ALL)       ALL
exampleuser        ALL=(ALL)       ALL


Step 4

Press key "esc" and then type the command:

:wq


Reference:

Wednesday, July 22, 2015

[CentOS] Command for setting the timezone

This sample is using CentOS7 .

Step1

Firstly, use this command to get the timezones list and press "enter" key
timedatectl list-timezones


Step2

Then you will get a list of timezone, remember the timezone string you need. For example, if i want to set the timezone to Hong Kong, I mark down the line 9 "Asia/HongKong" :
 
p.s. use the up and down arrows to view all time zones. Press CTRL-C if you wanted to exit the list of time zones.

 Step 3

Use the command "timedatectl set-timezone " and add the string you just mark down. There is sample command:

timedatectl set-timezone Asia/Hong_Kong



Step 4

After used the command at step3, you can use command "date" to check is the server's time same as what you expected :

date


Saturday, July 26, 2014

[CentOS7][Solved] redirecting to /bin/systemctl start sshd.service

Type this command in CentOS7 and it return message : "Redirecting to /bin/systemctl start  sshd.service"
service sshd start


let try this command:
systemctl start sshd.service
There is no response message output if it works








Reference
http://www.centoscn.com/CentOS/Intermediate/2014/0905/3685.html