apt-get

初学linux,从网上找了linux入门,都是一大批命令行的输入,一看就无味了,无法只能经过本身摸索,经过须要用查看总结一个命令行大做用积累拉。linux

Linux是多用户系统,为了加强系统的安全性能,避免误操做对系统形成害,通常要求在Linux下的用户进行常规操做时是以普通用户(而不是像 Windows那样通常都使用超级用户)登陆的,系统对普通用户的权限进行了限制。一些Linux发行版默认状况下不容许使用超级用户登陆。

但 是在某些状况下,普通用户须要执行一些只有超级用户才可使用的命令,为了不不少人都拥用超级用户密码(固然对于单用户不存在这个问题),Linux下 有一个SUDO命令,使得普通用户可以行使超级用户的部份权利,而这些可使用的权利是被超级用户或者系统(好比Unbuntu)预设好的。安全

   The apt-get command is a powerful command-line tool used to work with Ubuntu's Advanced Packaging Tool (APT) performing such functions as installation of new software packages, upgrade of existing software packages, updating of the package list index, and even upgrading the entire Ubuntu system. 网络

apt-get是系统下安装软件的一个命令,它的功能很强大,能够经过网络或其它介质进行安装、卸载软件等操做。工具

Some examples of popular uses for the apt-get utility: 性能

  • Install a Package: Installation of packages using the apt-get tool is quite simple. For example, to install the network scanner nmap, type the following:ui

    sudo apt-get install nmap

  • Remove a Package: Removal of a package or packages is also a straightforward and simple process. To remove the nmap package installed in the previous example, type the following:spa

    sudo apt-get remove nmap

    [Tip]

    Multiple Packages: You may specify multiple packages to be installed or removed, separated by spaces. 命令行

    Also, adding the --purge options to apt-get remove will remove the package configuration files as well. This may or may not be the desired effect so use with caution. 日志

  • Update the Package Index: The APT package index is essentially a database of available packages from the repositories defined in the /etc/apt/sources.list file. To update the local package index with the latest changes made in repositories, type the following:code

    sudo apt-get update

  • Upgrade Packages: Over time, updated versions of packages currently installed on your computer may become available from the package repositories (for example security updates). To upgrade your system, first update your package index as outlined above, and then type:

    sudo apt-get upgrade
  • apt-get install **这样的命令会下载文件放在 /var/cache/apt/archives目录下,而后安装。这样这个目录所占空间会愈来愈大,幸运的是apt提供了相应的管理工具apt-get clean删除/var/cache/apt/archives/ 和 /var/cache/apt/archives/partial/目录下全部包(锁定的除外)。

      apt-get autoclean仅删除再也不能被下载的包.  另外aptitude clean也可删除/var/cache/apt/archives/ 和 /var/cache/apt/archives/partial/目录下全部包(锁定的除外)。
  • Linux和Win彻底不同,win习惯把一个软件安装在一个文件夹里面,而Linux是将一个软件分散安装的不一样的文件夹。
    好比软件的配置文件所有安装在etc这个文件夹里面,执行程序可能按照在/usr下面, 日志文件又会在/var/log下面,都不同的!
    你man如下apt看看,有专门的查看命令。其实你根本不用关心安装在那里,删除的时候用apt删就好了
相关文章
相关标签/搜索