How to get names only list of all packages on Centos
Names only:
rpm -qa --queryformat='%{name}\n'
With versions includes:
rpm -qa
Names only:
rpm -qa --queryformat='%{name}\n'
With versions includes:
rpm -qa
cd /vz/template/cache ; wget https://download.openvz.org/template/precreated/centos-6-x86_64.tar.gz
vzctl create 100 --ostemplate centos-6-x86_64 --layout simfs
You can omit
--layout simfs
if you’d like to use ploop.
vzctl set 100 --hostname example.com --save
vzctl set 100 --ipadd 192.168.1.1 --save
vzctl set 100 --nameserver 8.8.4.4 --save
vzctl set 100 --nameserver 8.8.8.8 --save
And we are ready to go.
vzctl start 100
vzctl enter 100
Just add the following line to your ~/.bashrc and restart bash:
HISTFILE=~/.bash_history
ln -sf /usr/share/zoneinfo/UTC /etc/localtime
It’s that simple:
kill -HUP $(ps -A -ostat,ppid | grep -e '[zZ]'| awk '{ print $2 }')
On destination host :
cd /dir_to_receive
nc -l 4747 | tar -xvf -
On source host:
cd /dir_to_send
tar c /dir_to_send | nc destination_host 4747
There’s a bug in rpm package: https://bugzilla.redhat.com/show_bug.cgi?id=304121
It causes the following error while building rpm packages:
/usr/lib/rpm/debugedit: canonicalization unexpectedly shrank by one character
As a workaround you can use this command:
rpmbuild -bb rpmbuild/SPECS/package.spec -D 'debug_package %{nil}'
It will disable building of debug package and that’s it.
To enable bash completion on Ubuntu 14 make sure you have bash-completion installed:
apt-get install bash-completion
If so open /etc/bash.bashrc:
vim /etc/bash.bashrc
Then comment out the following lines:
# enable bash completion in interactive shells if ! shopt -oq posix; then if [ -f /usr/share/bash-completion/bash_completion ]; then . /usr/share/bash-completion/bash_completion elif [ -f /etc/bash_completion ]; then . /etc/bash_completion fi fi
And restart you bash:
exec $SHELL
virsh destroy <VM> virsh udefine <VM> --managed-save
After you are done you can safely remove all images manually.
vzctl set <CTID> --hostname <newhostname> --save