CentOS is an Enterprise-class Linux Distribution derived from Redhat Enterprise Linux sources freely provided to the public.
28
votes
11answers
20k views
How can I get distribution name and version number in a simple shell script?
I'm working on a simple bash script that should be able to run on Ubuntu and CentOS distributions (support for Debian and Fedora/RHEL would be a plus) and I need to know the name and version of the ...
24
votes
7answers
1k views
What's the equivalent to && when writing a bash script?
I apologize in advance if this is a duplicate question. I did make an effort to search/check before asking here.
I'm comfortable with writing one-liners like this:
foocommand && ...
16
votes
6answers
17k views
Is CentOS exactly the same as RHEL?
I'm sure this question has been asked again and again elsewhere (I did not find anything specific to CentOS vs RHEL in SE), but I would still like to ask and confirm a few specific points.
I am well ...
13
votes
4answers
1k views
What makes CentOS “enterprisey” compared to “generic” distributions like Ubuntu?
What makes CentOS "enterprisey" compared to "generic" distributions like Ubuntu?
When I say "enterprisey" I actually mean "better for server deployments". Just a general question, because I was ...
12
votes
2answers
26k views
CentOS 6 “Default” Installation Options
Can someone tell me the difference between a Desktop Install, a Basic Server install, and a Minimal Install? During installation, it doesn't give a description and I can't find documentation on it ...
12
votes
8answers
32k views
Cannot enable network after CentOS 6.3 fresh install
I am trying to perform a fresh CentOS 6.3 installation then run various yum commands such as yum install httpd.
The installation runs fine, however I cannot run any network based commands like yum
I ...
11
votes
6answers
2k views
Is there a difference of stability between Linux distros?
I've using Debian since 2010 for some home purposes and it has been stable. Is Debian still a good option if I need a server for heavy network, cpu, disk and memory usage?
Last month I listened to ...
10
votes
3answers
690 views
Why are files in my home dir being created as world-writable despite a more-restrictive umask?
I've realized that the permissions for new files and directories behave a bit strangely. First of all, umask seems to return the right answer:
$ umask
0002
This means full access for my user and ...
9
votes
1answer
358 views
How do you omit “./” when running scripts on current directory
On some tutorials over the internet they can run a script on the current directory without doing:
./script
How do you omit this? I am using CentOS 5.6 x64. I want to run it this way
script
9
votes
2answers
6k views
How to colorize output of ls ?
I'm running CentOS in Linux text mode. When I run the command ls /usr/, the output is too hard to read (dark blue on black). How can I change the text coloring?
8
votes
1answer
416 views
MySQL gets killed by OS every 25 days or so
About 4 months ago we migrated from MS SQL Server to MySQL 5.5. Since then we have been experiencing an issue once approximately ever 25 days since where CentOS runs out of memory and as a result it ...
8
votes
2answers
410 views
lsof - age of file
The *nix command lsof gives you a list of open files. Is anyone aware of a way that would also list how long a particular file has been open? Either by using lsof or any other command. I'm using ...
7
votes
5answers
5k views
How can I limit the bandwidth used by a process?
I have a CentOS 5.7 server that will be backing up its files nightly. I am concerned that visitors to the various sites that the server hosts will experience degraded performance while the backup is ...
7
votes
2answers
11k views
How to change the hostname of a linux machine using terminal?
I logged in for the first time, opened terminal, and typed in ‘hostname’. It returned ‘localhost.localdomain.com’. Then I logged as the root user in terminal using the command, ‘su –‘, provided the ...
7
votes
2answers
7k views
Why the default eth0 interface is down by default on CentOS?
I am already a little bit familiar with Linux distros like Debian or Ubuntu (yeah, very similar) but I wanted to try Red Hat based - CentOS 6.2 . I have installed it on my Windows 7 host in virtualBox ...
7
votes
1answer
464 views
Why isn't the ls command listing huge filesizes?
In my Redhat Linux, I am getting the following error when executing the ls command.
# ls
ls: sugar.sql: Value too large for defined data type
7
votes
2answers
507 views
How can I disable TCP/IP for an Ethernet adapter?
I have CentOS 6.3 running in a (virtual) machine with two Ethernet adapters. I have eth0 connected to a TCP/IP LAN and eth1 connected to a DSL modem. The system is intended as a dedicated ...
7
votes
2answers
4k views
Package bash-completion missing from Yum in CentOS 6
I am trying to get tab-completion working in Yum in CentOS 6 (so I can do something like yum install firefo<TAB> and get back firefox), and I have found many tutorials which say to simply do yum ...
7
votes
2answers
13k views
CentOS on HyperV - eth0 not in ifconfig?
I've launched a CentOS install in HyperV and assigned a NIC the same way I've done on an Ubuntu VM, however, the device simply isn't picked up.
Only my loopback is found by ifconfig.
How should I go ...
6
votes
2answers
752 views
Should you run automatic updates
I'm running production Centos web servers. I want to know what is best practice for running updates. Should I automate this with yum-cron or yum-updatesd? Or is there a danger of updates breaking ...
6
votes
8answers
6k views
Error installing git on CentOS 6
After I run yum install git
it shows the error
Error: Package: git-1.7.6.1-1.el5.rf.i386 (rpmforge)
Requires: libcurl.so.3
You could try using --skip-broken to work around the problem
You ...
6
votes
2answers
264 views
Mysterious write IO
I am just reviewing the disk IO of a XEN VM server. I stumbled across a DomU that has constant write traffic.
To narrow that traffic further down I logged in to the DomU (CentOS 5, 64 Bit) and ...
6
votes
4answers
742 views
Why do I need to hit enter to get my shell prompt after my init.d script completes?
I had to write my own CentOS init.d script for celery because it only ships with one for Debian. You can see the script I wrote when I answered my own stack overflow question 3989656.
But there's a ...
6
votes
2answers
152 views
du command show a slash after directories?
How to use du command show a slash after directories?
For example:
du -ab /root/test/php-5.4.8/
Result:
1781 /root/test/php-5.4.8/main/internal_functions.c.in
973596 ...
6
votes
1answer
163 views
/etc/passwd sql with bash access
I just got a CentOS VPS and was reviewing the passwd file and saw this:
mysql:x:498:499:MySQL server:/var/lib/mysql:/bin/bash
Is bash necessary for mysql?
6
votes
2answers
2k views
How to configure network profiles in Centos?
I'm trying to setup two network profiles in Centos. One for at home, one for at work.
The home profile has a fixed IP address, fixed gateway and DNS server addresses. The work profile depends on DHCP.
...
6
votes
2answers
951 views
Enabling system management privileges for non-local users - How the heck does `polkit` work, anyways?
I am managing a CentOS 6.2 server remotely using X over SSH (actually NX, but that's just a proxy).
The Everything is working correctly, except when I try to do tasks that would normally require ...
6
votes
3answers
428 views
Download ALL rpms for a product
I have two CentOS machines, one 6.3 box (A), and another CentOS 6.1. (B)
6.3 box is with internet connection, 6.1 box is without internet connection.
I want to download ALL dependencies of a product ...
6
votes
1answer
636 views
BUG: soft lockup - CPU# stuck for x seconds
I've seen a few bug reports and questions (on stackexchange and elsewhere) regarding a nagging "BUG: soft lockup - CPU#<n> stuck for <dt>s!". So far, I haven't found any clue as to what ...
6
votes
3answers
4k views
Wireless networking with CentOS
I'm running CentOS 5.7 x86 on my Vostro 1700 laptop which has an Intel Pro Wireless WiFi NIC (Intel Pro Wireless 3945 [iwl3945]).
I'm a bit confused about how my Wireless connection (wlan0) is being ...
5
votes
4answers
443 views
What's the difference between a hard links and copied files?
RHEL 6
My understanding is that hard links include a copy of the original file and that I could delete a hard-linked file in one directory, and it would still exist in the other directory.
If ...
5
votes
3answers
2k views
Moved bin and other folders! How to get them back?
I accidentally moved all folders from root to a subfolder. (/bin, /etc, /home, /lib, /usr... all moved) The only ones that were not moved, since they were in use, are /bak, /boot, /dev, /proc, /sys.
...
5
votes
2answers
918 views
/dev/sda2 has gone 49710 days without being checked, check forced
Why the shell show "/dev/sda2 has gone 49710 days without being checked, check forced." at centos start and then reboot?
......
/dev/sda2: Superblock last mount time is in the future. FIXED.
...
5
votes
2answers
944 views
Why is there a discrepancy in disk usage reported by df and du?
I have a Linux(CentOS) server, the OS+packages used around 5GB. Then, I transferred 97GB data from a Windows server to two folders on this Linux server, after calculated the disk usage, I see the ...
5
votes
3answers
309 views
Distro for a startup?
We run a small start-up in the SaaS industry. About half of our current staff are developers using their own laptops with various Linux distros (Ubuntu, Debian, Fedora) with a few exceptions of ...
5
votes
4answers
744 views
How to get better desktop performance in linux?
Normally I do not care much about desktop - performance, since my servers do not run any gui. But at home I run some older hardware (Pentium) which gets sometimes very sluggish (mouse-movements in ...
5
votes
2answers
2k views
How can I know which IRQ is responsible of high CPU usage
I've moved a server from one mainboard to another due a disk controller failure.
Since then I've noticed that constantly a 25% of one of the cores goes always to IRQ however I haven't managed myself ...
5
votes
2answers
2k views
How to run a C program as a daemon?
I have a C program which I want to run as a daemon. How do I install it so it will run as a daemon on CentOS? Someone said to use @reboot, and some said to put it in /etc/rc.d/rc.local. Which is the ...
5
votes
1answer
678 views
Can Yum express a preference for x86_64 over i386 packages?
I run a 64-bit version of CentOS5. At the moment, when I run Yum updates or installs, unless Yum is purged of i386 packages prior, it will install i386 packages when x86_64 are available.
Is it ...
5
votes
2answers
18k views
Static IPv4 & IPv6 configuration on CentOS 6.2
I try to configure static IPv4 & IPv6 configuration on CentOS 6.2.
The configuration below works perfectly :
# ifconfig eth0 x.x.x.x/29
# route add defalt gw x.x.x.y
# ip addr add dev eth0 ...
5
votes
2answers
525 views
Giving some users only SSH and shell access with limited resource usage
I'm trying to make a user that can access my server through SSH and allow it to have a shell, limited to using only, say screen and irssi. And it shouldn't it be able to see other directories except ...
5
votes
2answers
203 views
Is it possible to create a directory and file inside /proc/sys?
I am running CentOS 6.2 and I need to create a subdirectory named "crypto" inside /proc/sys. Inside /proc/sys/crypto, I need to create a file named test which contains the value "1".
I have tried ...
5
votes
3answers
16k views
How can I fix “cannot find a valid baseurl for repo” errors on CentOS?
I finished installing CentOS 6, but when I tried running yum update I got:
[root@centos6test ~]# yum update
Loaded plugins: fastestmirror, refresh-packagekit
Determining fastest mirrors
Could not ...
5
votes
3answers
2k views
How to execute a script on gdm login automatically for all users?
What file should I modify to execute some instructions when any user logs in through gdm?
I tried /etc/bashrc but that is executed ony when starting bash (and each time an xterm is open). I'd like to ...
5
votes
2answers
343 views
How to get started with CentOS?
I've been working with Debian GNU/Linux for a long time and am very proficient with it.
However for a new project I've got to got familiar with CentOS ASAP.
So my Question is: How do I get started ...
5
votes
2answers
970 views
how do I install the stock centos repositories?
I have a situation where the stock repo files that should exist in /etc/yum.repos.d/ (like centos-base.repo) are not present. I need to get them installed. I am sure this is simple, but after hours of ...
5
votes
2answers
8k views
Increasing Screen Size/Resolution on a VirtualBox Instance of Centos
I have VirtualBox instance of Centos 5. The screen size is quite small (800*600) and I'd like to increase it to 1280*1080. Under the Gnome preferences for "Screen Resolution" I only get the option for ...
5
votes
1answer
2k views
Is there any difference between e2fsck and e4fsck on CentOS / RHEL systems?
ext4.wiki.kernel.org makes it sound like e2fsck was simply renamed to e4fsck so that e4fsprogs and e2fsprogs could coexist without overlapping. However, there is no mention of any difference in the ...
5
votes
2answers
114 views
High-level command to request several branches of snmp in one tcp-session?
We are trying to monitor our servers mainly with SNMP. Due to performance reasons we are changing this from single requests to snmp-bulk-requests (as allowed in SNMP v2c).
In theory (at least to my ...
5
votes
5answers
2k views
Need to upgrade svn on centos
I have an error when I run svn up
svn this client is too old to work with working copy...please get a newer subversion client
This is on centos. I need to update svn. How do I do this?
...