Ubuntu apt-get 命令工具汇集
1、通过deb包安装的情况:
安装.deb包:
反安装.deb包:
2、通过apt-get安装的情况:
安装
反安装
附apt-get, dkpg 常用命令:
卸载软件命令: apt-get remove softname1 softname2 softname3……
卸载并清除配置命令: apt-get remove --purge softname1
更新软件信息数据库命令: apt-get update
进行系统升级命令: apt-get upgrade
搜索软件包命令: apt-cache search softname1 softname2 softname3……
Deb软件包相关安装与卸载安装软件命令: apt-get install softname1 softname2 softname3……
卸载软件命令: apt-get remove softname1 softname2 softname3……
卸载并清除配置命令: apt-get remove --purge softname1
更新软件信息数据库命令: apt-get update
进行系统升级命令: apt-get upgrade
搜索软件包命令: apt-cache search softname1 softname2 softname3……
Deb软件包相关安装与卸载安装deb软件包命令: dpkg -i xxx.deb
删除软件包命令: dpkg -r xxx.deb
连同配置文件一起删除命令: dpkg -r --purge xxx.deb
查看软件包信息命令: dpkg -info xxx.deb
查看文件拷贝详情命令: dpkg -L xxx.deb
查看系统中已安装软件包信息命令: dpkg -l
重新配置软件包命令: dpkg-reconfigure xxx
安装deb软件包命令: dpkg -i xxx.deb
方法二
这种方法要用到/etc/apt/文件夹下的apt.conf文件。如果您希望apt-get(而不是其他应用程序)一直使用http代理,您可以使用这种方式。
注意:某些情况下,系统安装过程中没有建立apt配置文件。下面的操作将视情况修改现有的配置文件或者新建配置文件。
sudo gedit /etc/apt/apt.conf
在您的apt.conf文件中加入下面这行(根据你的实际情况替换yourproxyaddress和proxyport)。
Acquire::http::Proxy "http://yourproxyaddress:proxyport";
保存apt.conf文件。
方法三
这种方法会在您的主目录下的.bashrc文件中添加两行。如果您希望apt-get和其他应用程序如wget等都使用http代理,您可以使用这种方式。
gedit ~/.bashrc
在您的.bashrc文件末尾添加如下内容(根据你的实际情况替换yourproxyaddress和proxyport)。
http_proxy=http://yourproxyaddress:proxyport export http_proxy
保存文件。关闭当前终端,然後打开另一个终端。
使用apt-get update或者任何您想用的网络工具测试代理。我使用firestarter查看活动的网络连接。
如果您为了纠正错误而再次修改了配置文件,记得关闭终端并重新打开,否自新的设置不会生效。