如何使得apt-get install从多个repository并行下载

June 6, 2011 by · Comments Off on 如何使得apt-get install从多个repository并行下载
Filed under: linux 

http://www.mattparnell.com/linux/apt-fast/ 下载apt-fast.sh,拷贝到/usr/local/bin目录:
wget http://www.mattparnell.com/linux/apt-fast/apt-fast.sh
chmod +x apt-fast.sh
sudo cp apt-fast.sh /usr/local/bin

推荐使用 apt fat with aria2c 来从多个源下载来提高速度,
wget http://www.beyondlinux.com/blog/wp-content/uploads/2011/06/apt-fast_aria2c.txt -O apt-fast_aria2c.sh
chmod +x apt-fast_aria2c.sh
sudo cp apt-fast_aria2c.sh /usr/local/bin

然后使用 apt-fast_aria2c.sh install xxxx来安装软件包,设置多个mirrors时,速度会比apt-get install快上很多倍。 如:

sudo apt-fast_aria2c.sh install mplayer smplayer cdcd

Digg This
Reddit This
Stumble Now!
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

debian squeeze搭建最简xfce4开发环境(二 常用软件及问题解决)

May 27, 2011 by · Comments Off on debian squeeze搭建最简xfce4开发环境(二 常用软件及问题解决)
Filed under: linux 

1.how to install xfce4 and choose x window manager

sudo apt-get install xfce4
sudo update-alternatives –display x-window-manager
sudo update-alternatives –config x-window-manager

中文支持参考:Debian简明中文支持

2.run 32 bit applications:

sudo apt-get install ia32-libs
sudo apt-get install ia32-libs-gtk

then qq, forti ssl vpn client all works.

3. how to change locale & time

sudo cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

时间的计算就由UTC改为CST了。

u also may use tzselect to change time zone.

4. how to automatically keep an active network always on desktop, && use wireless network

sudo apt-get install network-manager
sudo apt-get install wicd
sudo apt-get install firmware-iwlwifi

方法1:
sudo apt-get install network-manager-gnome

To use network-manager-gnome in Xfce (or Gnome) you need to have the applet running in the sytem tray.
In Gnome this is automatic but in Xfce you need to set it up initially. Fortunately this is very easy:

Alt + F2 to run a command:  nm-applet –sm-disable

network manager is used for keeping an active network always for desktop.
Wireless network is disabled by default, rith click on the desktop network icon, choose “Enable Wireless”, it shall works.
默认无线是关闭的,右键点击桌面工具栏上的网络连接图标,选中”Enable Wireless”,即可使用无线网络.

方法2:

WICD network manager,网络的连接和中断通知默认是关闭的,可以在Preferences里面勾上 Notification.
如果没有在Preferences里面输入wireless interface,WICD默认是找不到无线网络的,通常输入wlan0即可。

Wicd network manager -> Network -> Find a hidden network
即可找到无线网络,点击无线网络的属性,配置好后,点击connect即可。

5. no auto completion in shell ?
default shell is sh, change user’s default shell to bash in /etc/passwd

6. common tools
krusader, firefox, eclipse, gedit, geany
execute query, rdesktop
File manager: gnome-commander, Tux commander, emelFM2  —————–

—- sudo apt-get install tuxcmd tuxcmd-modules
sudo apt-get install gnome-commander

gnome-commander is a two panel file manager with drag & drop support ( tux does not support drag & drop)

xfce4-terminal: a terminal support tab & copy, paste
sudo apt-get install xfce4-terminal

geany is a full functional text editor in xfce.
geany 的快捷键与scim的Ctrl+Space有冲突,切换不了中文输入法,更改快捷键后即可。

sudo apt-get install netwox ssh nmap rdesktop less
sudo apt-get install ftp curl aria2 unrar-free unzip xarchiver
sudo apt-get install subversion git git-svn rapidsvn meld diffuse
sudo apt-get install memcached mongodb redis-server nginx memcachedb mysql-server

sudo apt-get install epdfview evince
sudo apt-get install openoffice.org openoffice.org-l10n-zh-cn openoffice.org-l10n-zh-tw

7.how to install flash player for fixfox?

sudo apt-get install flashplugin-nonfree

or

download flash player from adobe, extract the compressed file, copy libflashplayer.so to /usr/lib/mozilla/plugins
sudo cp libflashplayer.so /usr/lib/mozilla/plugins
then restart firefox

8. change daily updatedb settings in :
vi /etc/cron.daily/locate

9. multiple monitor support
sudo apt-get install grandr

xrandr
grandr

10. how to control services to automatically start
sudo apt-get install rcconf
sudo rcconf

or :

sudo update-rc.d -f {SERVICE-NAME} remove

For example to stop xinetd service at boot time, type the command as follows:
# update-rc.d -f xinetd remove

11. 退出图形界面后,键盘按键没反应,但可以按Alt+Tab切换应用程序,切到其他的应用再切回来就ok了。

这个问题很有历史了。 Debian BTS 见 [1][2] , Ubuntu Launchpad 见 [3] 。                                                        2
这个问题很有历史了。 Debian BTS 见 [1][2] , Ubuntu Launchpad 见 [3] 。
解决办法,一是 patch libX11 ,二是改 scim 配置文件,但后者会影响欧洲字符的输入。

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=434180
[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=437437
[3] https://bugs.launchpad.net/ubuntu/+source/scim/+bug/66104

更改scim配置文件的解决方法:
关闭scim,
sudo vi /etc/scim/config
vi ~/.scim/config
把两个文件中/FrontEnd/X11/Dynamic的值从false更改为true.

logout, 重新登录

12.debian apt-get下载的包存放在哪里?

/var/cache/apt/archives/

13.如何使得apt-get install下载的更快

从http://www.mattparnell.com/linux/apt-fast/ 下载apt-fast.sh,

拷贝到/usr/local/bin目录:

wget http://www.mattparnell.com/linux/apt-fast/apt-fast.sh

chmod +x apt-fast.sh

sudo cp apt-fast.sh /usr/local/bin
推荐使用 apt fat with aria2c 来从多个源下载来提高速度,

wget http://www.mattparnell.com/linux/apt-fast/apt-fast%20modded/apt-fast_aria2c.sh

chmod +x apt-fast_aria2c.sh

sudo cp apt-fast_aria2c.sh /usr/local/bin
然后使用 apt-fast_aria2c.sh install xxxx来安装软件包,设置多个mirrors时,速度会快上很多倍。比如安装mplayer, smplayer以及cd播放器:
sudo apt-fast_aria2c.sh install mplayer smplayer cdcd

14. 没有正确的电源状态显示

Problem: acpi could not detect battery status, and shows unkown battery as:

$acpi

Battery 0: Unknown, 0%

首先从主板提供商或者任何渠道获取信息,确保你的bios对linux的acpi驱动是没有问题。

比如Acer的很多笔记本默认BIOS的ACPI支持不好,我的是Aspire 4745G, 需要刷bios。
Aspire 4745G 可以在这里下载,下载之后在windows下运行程序刷新bios。

http://support.acer.com/us/en/product/default.aspx?modelId=2070

然后,确保内核支持acpi, 并在启动参数中增加acpi=on,debian squeeze安装的默认内核是支持acpi的, 增加acpi=on即可:
vi /boot/grub/grub.cfg:

linux   /boot/vmlinuz-2.6.32-5-amd64 root=/dev/hda9 ro acpi=on quiet

然后安装powertop来查看各个程序的能耗,以及几个有用的软件:

sudo apt-get install powertop cpufrequtils laptop-mode-tools
最后重启你的系统。

 

 

Digg This
Reddit This
Stumble Now!
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

debian squeeze搭建最简xfce4开发环境(一 Debian简明中文支持)

May 27, 2011 by · 2 Comments
Filed under: linux 

1.1 for chinese locale support:
dpkg-reconfigure locales

select all locales like zh_CN.***, zh_TW.***

1.2 how to install chinese fonts

apt-get install ttf-bitstream-vera msttcorefonts  (seems no use)
apt-get install xfonts-wqy ttf-wqy-zenhei

for MS windows fonts, copy Chinese font to /usr/local/share/fonts
sudo cp /data/debian/fonts/* /usr/local/share/fonts
sudo fc-cache

for free fonts:
sudo apt-get install ttf-arphic-*

中文字体美化:

wget http://www.beyondlinux.com/blog/wp-content/uploads/2011/05/fonts.conf_.txt

wget http://www.beyondlinux.com/blog/wp-content/uploads/2011/05/local.conf_.txt

cp fonts.conf_.txt  ~/.fonts.conf
cp local.conf_.txt  /etc/fonts/local.conf

set firefox Chinese minimal font to 14-15, Western font to 18.

1.3 input method:
apt-get install scim scim-pinyin scim-tables-zh

vi /etc/X11/Xsession.d/95xinput
to create a new file 95xinput with the following content:
/usr/bin/scim -d
XMODIFIERS=”@im=SCIM”
export XMODIFIERS
export GTK_IM_MODULE=xim

the last line is meant to be able to use scim input method in firefox

1.4 support chinese in jdk gui.
Here is the way (two steps):
1). make a directory fallback under JavaHome/lib/fonts/
2). add a Chinese TrueType or Type 1 font under fallback

An example:
mkdir /usr/lib/j2sdk1.5-sun/jre/lib/fonts/fallback
ln -s /usr/share/fonts/truetype/arphic/gbsn00lp.ttf .
ln -s /usr/local/share/fonts/simhei.ttf .

 

Digg This
Reddit This
Stumble Now!
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

debian 6.0(Squeeze)硬盘安装

April 11, 2011 by · Comments Off on debian 6.0(Squeeze)硬盘安装
Filed under: linux 

在linode上搭起来了服务器,根据淘宝朋友的推荐,选了debian操作系统。考虑到软件的多样性,os对网络的依赖度,在笔记本上选择装上debian发行版,下载了debian的8张DVD,这样就不用基于网络安装软件了, 直接挂载iso。 原本debian的网络安装很方便,谁让我们在TG。

由于光驱不太好用,就试着从硬盘安装squeeze, squeeze比原先的woody,etch好装了不少, 从windows安装还是不如ubuntu,自动的iso挂载也只能挂载fat32分区的, 由于fat32分区存不了4G的dvd iso,只能放安装的CD ISO,debian里面的第1张CD里面没有gnome/kde,我安装时选了X window,装X Window是从网络安装的,花了1个多小时,还是宽带是5M的,不然不可想象要花多长时间。 如果能用光驱,建议用刻盘来安装。 总结一下安装步骤:

1. 准备好grub。由于我的操作系统是windows 7, grub用起来不如XP方便,就先装了Maxdos 8,然后把grub4dos解压后放到fat32分区。

如果是Windows NT/2000/XP直接修改C:\boot.ini,增加这样一行:
C:\GRLDR=”Start GRUB”
把grub的引导菜单加入到启动项中很方便。

2. 准备一个fat32分区,把安装的iso cd拷贝到某个fat32分区的根目录。 iso cd可以从任一一个镜像下载,如:
http://ftp.nl.debian.org/debian-cd/6.0.1a/amd64/iso-cd/
http://mirrors.sohu.com/debian-cd/6.0.1a/amd64/iso-cd/ (中国访问这个比较快)
http://mirrors.163.com/debian-cd/6.0.1a/amd64/iso-cd/ (中国访问这个比较快)

由于硬盘上都是ntfs分区,我就拿usb的分区(fat32)来访iso cd。
同时下载 debian硬盘安装需要的3个引导文件(这步很重要)vmlinuz, initrd.gz, boot.img.gz,拷贝到c:\盘根目录
我用的是amd64,从这里取:
http://ftp.nl.debian.org/debian/dists/squeeze/main/installer-amd64/current/images/hd-media/
也可以从debian的mirror站点中取到这几个文件,比如:
http://mirrors.sohu.com/debian/dists/squeeze/main/installer-amd64/current/images/hd-media/

如果你的cpu是32位的,取这里的:
http://ftp.nl.debian.org/debian/dists/squeeze/main/installer-i386/current/images/hd-media/

http://mirrors.sohu.com/debian/dists/squeeze/main/installer-i386/current/images/hd-media/

3.编辑前面解压的grub2dos中的menu.lst, 加入如下内容
###########
title hd – Install Debian
root (hd0,0)
kernel /vmlinuz
initrd /initrd.gz
###########

这一步骤可省略, 若省略,后面启动grub后,手工进入grub的command交互控制台,输入对应的root, kernel, initrd几个命令,再输入boot回车来启动debian安装界面。

4. 引导进入grub:启动机器,进入maxdos,再选择进入纯dos。 然后cd 到grub所在目录,运行grub.exe进入grub引导界面。

5.在grub引导界面选择”Install Debian”启动debian安装过程。若第3步没有编辑menu.lst,则可以手工输入grub命令来引导。

6.安装的过程中,会自动从fat32分区查找iso文件。 找到后根据提示执行安装即可。 如果网络状况不好,用iso cd装就不要选择X Window图形界面了, 装好了基本系统启动后再通过命令安装X Window,因为第1张iso cd里面没有X Window。

Digg This
Reddit This
Stumble Now!
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)