bearicc bearicc
关注数: 0 粉丝数: 4 发帖数: 71 关注贴吧数: 1
[ 分享 ] 安装包时避免将Auto设置成Manual 一直想写这个script,今天终于抽空弄了下。还有待发现bug. debian系统,如果apt-get安装的包已经安装且为auto, 会将auto设置成Manual. 对于一个 严重强迫症来说,把依赖包不小心弄成了手动无法容忍。。。不想手动改回来,故有此script. 这个script可以和另一个我写的script pkg_check.sh结合,通过检查base system的包和现有的状态为Manual 的包,确保没有包被不小心设成了Manual。。。 #!/bin/bash DIR="$(cd "$(dirname "$0")" && pwd )" PKG="${*:2}" INSTALLED="" INSTALL="" if [ "$1" == "install" ]; then for i in ${PKG}; do FLAG=$(dpkg -l $i|sed -n */ii/s/^.*$/ii/p*) if [ "${FLAG}" == "ii" ]; then INSTALLED="${INSTALLED} $i" else INSTALL="${INSTALL} $i" fi done else sudo apt-get $1 ${PKG} fi INSTALLED=$(echo ${INSTALLED}|tr * * *\n*|sort|tr *\n* * *|xargs) INSTALL=$(echo ${INSTALL}|tr * * *\n*|sort|tr *\n* * *|xargs) echo -e "[Installed]\t${INSTALLED}" echo -e "[Installing]\t${INSTALL}" sudo apt-get install ${INSTALL} INSTALL_OK="" INSTALL_FAILED="" for i in ${INSTALL}; do FLAG=$(dpkg -l $i|sed -n */ii/s/^.*$/ii/p*) if [ "${FLAG}" == "ii" ]; then INSTALL_OK="${INSTALL_OK} $i" else INSTALL_FAILED="${INSTALL_FAILED} $i" fi done INSTALL_OK=$(echo ${INSTALL_OK}|tr * * *\n*|sort|tr *\n* * *|xargs) INSTALL_FAILED=$(echo ${INSTALL_FAILED}|tr * * *\n*|sort|tr *\n* * *|xargs) echo -e "[OK]\t${INSTALL_OK}" echo -e "[Failed]\t${INSTALL_FAILED}" if [ "${INSTALL_OK}" != "" ]; then echo ${INSTALL_OK} >> "${DIR}/pkg_i_installed" fi #./pkg_check.sh
[经验分享] 最简安装: ubuntu+gnome3+常用工具 准备:将下面所有需要的配置文件保存到U盘。 1. 下载安装官方的 ubuntu minimal cd, 重启,终端登录。 2. vi /etc/apt/apt.conf, 内容为: APT::Install-Recommends "0"; APT::Install-Suggests "0"; 作用:确保推荐包不会被自动安装。 3. 在/etc/apt/source.list.d下加入以下源: [ google-chrome.list ] deb http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fdl.google.com%2Flinux%2Fchrome%2Fdeb%2F&urlrefer=9db9e2c4e15872c76c4db9694641bb30 stable main [ virtualbox.list ] deb http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fdownload.virtualbox.org%2Fvirtualbox%2Fdebian&urlrefer=9b2a26201401c1db712096daf6ff4cd9 trusty contrib non-free [ hal ] deb http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fppa.launchpad.net%2Fmjblenner%2Fppa-hal%2Fubuntu&urlrefer=972f86da57b6526f819c8cc9bf3080f6 trusty main deb-src http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fppa.launchpad.net%2Fmjblenner%2Fppa-hal%2Fubuntu&urlrefer=972f86da57b6526f819c8cc9bf3080f6 trusty main [ 添加apt key ] wget -q -O - http://tieba.baidu.com/mo/q/checkurl?url=https%3A%2F%2Fdl-ssl.google.com%2Flinux%2Flinux_signing_key.pub&urlrefer=134a1c7e3d42768bbea5eed114655474 | sudo apt-key add - wget -q http://tieba.baidu.com/mo/q/checkurl?url=http%3A%2F%2Fdownload.virtualbox.org%2Fvirtualbox%2Fdebian%2Foracle_vbox.asc&urlrefer=fda3214691f0914910618ae4c621cef4 -O- | sudo apt-key add - 4. 安装以下包: ------------------------------ sudo apt-get install \ xserver-xorg-video-intel xserver-xorg xinit gnome-session gdm \ gnome-terminal gnome-control-center gnome-tweak-tool network-manager-gnome network-manager-pptp-gnome gnome-keyring gnome-screensaver gnome-screenshot gnome-shell-extensions gnome-shell-extension-weather gnome-themes-ubuntu \ gksu xdg-user-dirs-gtk smartmontools gvfs-bin ntfs-3g dosfstools alsa-base alsa-utils pulseaudio dkms rfkill fonts-cantarell fonts-nanum-coding \ nautilus eog evince pdftk p7zip-full p7zip-rar file-roller vim vim-gtk libreoffice vlc virtualbox-4.3 \ ibus ibus-sunpinyin ibus-table-wubi ibus-gtk ibus-gtk3 \ python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose python-tk python-pywt \ google-chrome-stable firefox flashplugin-installer hal \ texmaker texlive-full pdf2svg # ttf-mscorefonts-installer ------------------------------ 第一行安装 x 系统,这里显卡类型是intel,请按自己电脑配置更改。 第二行安装 gnome 后面的可按需要选择。 其他有用的设置: 5. 中文字体: mkdir -p /usr/XXX/.fonts 将windows下的simusun.ttc放到上面的目录 6. vim 安装 plugin manager: pathogen.vim .vimrc内容: ------------------------------ syntax on filetype indent plugin on call pathogen#infect() set tabstop=8 expandtab shiftwidth=4 softtabstop=4 set nobackup nowritebackup noswapfile ------------------------------ 7. Java 下载官方的jdk压缩包,运行以下命令: ------------------------------ sudo tar zxvf jdk-8u20-linux-x64.tar.gz -C /usr/local/ >& /dev/null cd /usr/local sudo chown root:root -R jdk1.8.0_20 sudo ln -s /usr/local/jdk1.8.0_20 jdk sudo update-alternatives --install /usr/bin/java java /usr/local/jdk/bin/java 1 sudo update-alternatives --install /usr/bin/javac javac /usr/local/jdk/bin/javac 1 sudo update-alternatives --install /usr/bin/javaws javaws /usr/local/jdk/bin/javaws 1 java -version javac -version ------------------------------ 还有一些设置: 禁用bluetooth, 设置hdparm, 设置屏幕默认亮度等,可以修改 /etc/rc.local 或 在 /etc/udev/rules.d 下添加相应配置。 此处省略。
1 下一页