Install and uninstall linux packages

Install Install with rpm (Read Hat) RPM (RPM Package Manager) is a popular package manager for installing software on Unix-like systems, particularly Red Hat Linux. The following is an example to install a package with file suffix “.rpm”: sudo rpm -i /path/to/package/name.rpm If you already have the earlier version of the software, enter the following […]

Linux Dotfiles究极管理

今天终于遇到了dotfiles这个概念,并且顺利找到了管理dotfiles的方案,下面将关键步骤贴下,或可见原文 创建dotfiles repo 其基本原理是创建一个bare仓库,然后通过每次指定repo来添加在不同位置的dotfiles以及其它一些git技巧来达到版本控制的目的,当有多台主机有不同配置或者要进行配置迁移时,都十分有用。下面是创建bare repo以及添加alias的命令: git init –bare $HOME/.cfg alias config=’/usr/bin/git –git-dir=$HOME/.cfg/ –work-tree=$HOME’ config config –local status.showUntrackedFiles no echo “alias config=’/usr/bin/git –git-dir=$HOME/.cfg/ –work-tree=$HOME'” >> $HOME/.bashrc 完成上述步骤后便可以通过下面使用config add xx这种方式来进行文件版本控制 config status config add .vimrc config commit -m “Add vimrc” config add .bashrc config commit -m “Add bashrc” config push 恢复dotfiles repo 下面介绍从dotfiles repo中将dotfiels恢复到新的PC中。注意,下面方法要求删除原有dotfiles,可以先备份再进行操作,原文提供了一种批量操作的方法,但这里就不给出了。 git clone –bare […]