Questions tagged [centos]

CentOS (Community Enterprise Operating System) is based on the Red Hat Enterprise Linux operating system. QUESTIONS MUST BE ABOUT RUNNING PROGRAMS UNDER CENTOS. Questions about server administration may be asked on https://serverfault.com

CentOS is a community-supported, mainly free software operating system based on Enterprise Linux (RHEL). It exists to provide a free enterprise class computing platform and strives to maintain 100% binary compatibility with its upstream distribution. CentOS stands for Community Enterprise Operating System.

Currently supported versions:

  • CentOS 5 (April 2007 - March 2017)
  • CentOS 6 (July 2011 - November 2020)
  • CentOS 7 (July 2014 - June 2024)
12486 questions
94
votes
3 answers

How do I download a file from the internet to my linux server with Bash

I recently had to upgrade to a VPS server (HostGator Linux) because I wanted to run a script that was a bit more complicated than the regular PHP db manipulation. I'm trying to install a JDK and Apache Ant (if it matters, for compiling Android Apps…
user1893185
  • 1,053
  • 2
  • 8
  • 6
93
votes
33 answers

ssh : Permission denied (publickey,gssapi-with-mic)

i'm use centos 5.9. after installing gitlab by this link ssh not working. before install gitlab ssh correctly working. i'm using this server localy and other services such as elastix and apache,mysql installed on server. appeare this error…
ali moradi
  • 1,103
  • 1
  • 8
  • 9
93
votes
14 answers

How to check all versions of Python installed on OS X and CentOS

I just started setting up a CentOS server today and noticed that the default version of Python on CentOS is set to 2.6.6. I want to use Python 2.7 instead. I googled around and found that 2.6.6 is used by system tools such as YUM so I should not…
hch
  • 6,030
  • 8
  • 20
  • 24
92
votes
4 answers

how to use python2.7 pip instead of default pip

I just installed python 2.7 and also pip to the 2.7 site package. When I get the version with: pip -V It shows: pip 1.3.1 from /usr/lib/python2.6/site-packages (python 2.6) How do I use the 2.7 version of pip located at:…
Atma
  • 29,141
  • 56
  • 198
  • 299
90
votes
4 answers

Use sudo with .vimrc

I'm using CentOS and created a .vimrc file in my /home directory. I tested it out by creating a txt file and yes, that worked fine. Now, I have my project files in my /srv directory with SELinux turned on. I tried opening a file: vim README.txt…
noblerare
  • 10,277
  • 23
  • 78
  • 140
90
votes
3 answers

Centos/Linux setting logrotate to maximum file size for all logs

we use logrotate and it runs daily ... now we have had some situations where logs have grown significantly (read: gigbaytes) and killing our server. So now we would like to set a maximum filesize to the logs .... can I just add this to the…
snh_nl
  • 2,877
  • 6
  • 32
  • 62
90
votes
5 answers

Difference between $HOME and '~' (tilde)?

I had always thought that $HOME and ~ were exactly the same and thus could be used interchangeably. Today, when I tried to install pylibmc, a python binding to memcached, on my shared server the use of ~ gave me error but not $HOME. I would like to…
tamakisquare
  • 16,659
  • 26
  • 88
  • 129
88
votes
15 answers

Install python 2.6 in CentOS

I have a shell that runs CentOS. For a project I'm doing, I need python 2.5+, but centOS is pretty dependent on 2.4. From what I've read, a number of things will break if you upgrade to 2.5. I want to install 2.5 separately from 2.4, but I'm not…
tehryan
  • 24,405
  • 11
  • 28
  • 17
85
votes
11 answers

Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

I am trying to download java using yum on centOs which I specified in Dockerfile. After pulling centOs image the run crushed and throw this error!? also to mention that my server instance is AWS EC2! Step 2/9 : RUN yum install java -y ---> Running…
Yusuf
  • 2,295
  • 7
  • 15
  • 34
79
votes
4 answers

No space left on device

I am getting the error "No space left on device" when i tried to scp some files to a centos machine, tried to check: [root@...]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol01 18G 18G 0 100% / And…
Futuregeek
  • 1,900
  • 3
  • 26
  • 51
78
votes
5 answers

Run bash script as daemon

I have a script, which runs my PHP script each X times: #!/bin/bash while true; do /usr/bin/php -f ./my-script.php echo "Waiting..." sleep 3 done How can I start it as daemon?
Sergey B.
  • 969
  • 1
  • 7
  • 12
75
votes
1 answer

How to install crontab on Centos

I am familiar to setup the cron scheduler using crontab -e command on my centos. But today I found one of my centos servers doesn't have this command I have tried to install this using yum install crontab but no luck. Then I tried yum install…
Sabuj Hassan
  • 38,281
  • 14
  • 75
  • 85
72
votes
5 answers

How to install packages in Linux (CentOS) without root user with automatic dependency handling?

Is it possible to use RPM or YUM or any other package manager in Linux, specifically CentOS, to install a package either already downloaded or from repo to a custom location without admin/root access? I tried building from sources, using cmake,…
user3330840
  • 6,143
  • 7
  • 26
  • 39
72
votes
13 answers

Installing PHP Zip Extension in CentOS

I'm attempting to install the PHP Zip extension in CentOS. My server does not have external internet access, so I downloaded it myself from PECL: http://pecl.php.net/package/zip. I chose 1.10.2, the latest "stable" release, and transferred it to my…
Ubunfu
  • 1,083
  • 2
  • 10
  • 21
71
votes
7 answers

How to change the MySQL root account password on CentOS7?

I have installed mySQL on a Centos7 vm but I have problems logging in with root. I tried logging in without password or tried any default ones (like mysql, admin etc) I looked in the my.cnf file and there's no password. I tried changing the password…
KeykoYume
  • 2,497
  • 6
  • 24
  • 48