ubuntu 怎么更新?ubuntu更新命令及方法

简介:                                          ubuntu 怎么更新?ubuntu更新命令及方法       安装Ubuntu系统后,第一件事就是更新系统源。

 


                

                 ubuntu 怎么更新?ubuntu更新命令及方法

 

 

ubuntu 怎么更新?ubuntu更新命令及方法

      安装Ubuntu系统后,第一件事就是更新系统源。由于系统安装的默认源地址在英国,作为Ubuntu的主源,国内连接速度非常慢,所以我们要将它换成就近的快速源。

      网上有些人说CN99是国内最快的源,但不同的网络状况连接以下源的速度不同, 所以cn99并不一定是最快的源, 建议在添加前手动验证一下源的连接速度(ping下就行),比如说北京网通ADSL用户连接cn99就非常慢,而ftp.sjtu.edu.cn则相对较快,选择最快的源可以节省大批下载时间。

      首先备份源列表,而后用gedit或其他编辑器打开源列表文件:

      sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup

      sudo gedit /etc/apt/sources.list

      从下面列表中选择合适的源,替换掉文件中所有的内容,保存编辑好的文件然后执行源的更新(注意:不同的Ubuntu版本对应的源是不同的,千万不要弄错了):

      sudo apt-get update

      如果更新很慢,可以用上面的方法换一个源,然后再试,直到成功为止。然后,执行真正的系统更新:sudo apt-get upgrade;如下图所示:

    ubuntu 怎么更新?ubuntu更新命令及方法

常用的源列表如下:

ubuntu 8.04的163源为:

deb http://mirrors.163.com/ubuntu/ hardy main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ hardy-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ hardy-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ hardy-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ hardy-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ hardy main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ hardy-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ hardy-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ hardy-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ hardy-backports main restricted universe multiverse

#Mirror.lupaworld.com 源更新服务器(浙江省杭州市双线服务器,网通同电信都可以用,亚洲地区官方更新服务器):
deb http://mirror.lupaworld.com/ubuntu gutsy main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu gutsy-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu gutsy-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu gutsy-backports main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu gutsy main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu gutsy-security main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu gutsy-updates main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu gutsy-backports main restricted universe multiverse

Ubuntu 官方源 推荐北方网通用户添加
deb http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse

台湾的官方源速度也相当不错,有时甚至快于内地的:
deb http://tw.archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
deb http://tw.archive.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
deb http://tw.archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
deb http://tw.archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse
deb http://tw.archive.ubuntu.com/ubuntu gutsy-proposed main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu gutsy main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu gutsy-security main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu gutsy-updates main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu gutsy-backports main restricted universe multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu gutsy-proposed main restricted universe multiverse
 

再加个中国电信源科技大学的源(能用速度还不 错)

deb http://ubuntu.uestc.edu.cn/ubuntu/ intrepid main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-backports main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-proposed main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-security main restricted universe multiverse
deb http://ubuntu.uestc.edu.cn/ubuntu/ hardy-updates main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ intrepid main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-backports main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-proposed main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-security main restricted universe multiverse
deb-src http://ubuntu.uestc.edu.cn/ubuntu/ intrepid-updates main restricted universe multiverse

防止非官方源中软件包不全的问题,请在sources.list文件中尾部添加下面这个官方源。

deb http://archive.ubuntu.org.cn/ubuntu-cn/ feisty main restricted universe multiverse

如果没有这个源,下面安装某些软件的时候会提示找不到,比如w32codecs

台湾源可能会慢一些,耐心等一下,换源后一般下载速度都有几十K,上百K也很正常。

ubuntu更新命令

       常用的APT命令参数:
  apt-cache search package 搜索包
  apt-cache show package 获取包的相关信息,如说明、大小、版本等
  sudo apt-get install package 安装包
  sudo apt-get install package - - reinstall 重新安装包
  sudo apt-get -f install 修复安装"-f = ——fix-missing"
  sudo apt-get remove package 删除包
  sudo apt-get remove package - - purge 删除包,包括删除配置文件等
  sudo apt-get update 更新源
  sudo apt-get upgrade 更新已安装的包
  sudo apt-get dist-upgrade 升级系统
  sudo apt-get dselect-upgrade 使用 dselect 升级
  apt-cache depends package 了解使用依赖
  apt-cache rdepends package 是查看该包被哪些包依赖
  sudo apt-get build-dep package 安装相关的编译环境
  apt-get source package 下载该包的源代码
  sudo apt-get clean && sudo apt-get autoclean 清理无用的包
  sudo apt-get check 检查是否有损坏的依赖

目录
相关文章
|
2月前
|
Ubuntu
百度搜索:蓝易云【Ubuntu下cut命令的使用】
请注意,cut命令默认从标准输入中读取数据,如果不指定文件名,则需要通过管道或重定向将数据传递给cut命令。
24 5
|
3月前
|
Ubuntu 网络安全
百度搜索:蓝易云【Ubuntu命令速查】
这些是常见的Ubuntu命令的速查表。可以根据需要使用这些命令来快速执行日常管理和开发任务。
96 1
|
3月前
|
Ubuntu 网络安全
百度搜索:蓝易云【Ubuntu命令使用方法大全】
请注意,以上仅是Ubuntu中一小部分常用命令的简要说明。要深入了解和学习Ubuntu命令,请参考Ubuntu官方文档、在线教程和书籍资源。熟练掌握常用的命令对于在Ubuntu系统中进行日常管理和开发任务至关重要。
43 3
|
3月前
|
运维 Ubuntu 安全
Ubuntu 磁盘管理DF命令用法
Linux磁盘空间管理是系统运维中的核心环节,它直接影响到系统的稳定运行、数据的安全性和业务的连续性。 通过实施有效的磁盘空间管理策略,系统管理员可以确保系统的高效运作,满足不断变化的业务需求,并为用户提供可靠的服务。 因此,对Linux磁盘空间管理的重视和精通对于任何企业的IT运营都属于核心业务。
42 0
|
4月前
|
Ubuntu
百度搜索:蓝易云【ubuntu FTP匿名登录及相关命令】
使用这些命令,你可以在Ubuntu上进行FTP匿名登录,并执行相应的FTP操作,希望这个教程能够帮助你进行Ubuntu上的FTP匿名登录。
57 0
|
4月前
|
存储 NoSQL Ubuntu
在Ubuntu上安装Redis并学习使用get、set和keys命令
在Ubuntu上安装Redis并学习使用get、set和keys命令
|
4月前
|
Ubuntu 测试技术 Linux
软件测试/测试开发|Ubuntu系统常用文件管理命令详解
软件测试/测试开发|Ubuntu系统常用文件管理命令详解
27 1
|
6月前
|
监控 Ubuntu 数据可视化
如何使用各种工具和命令来检查 Ubuntu 中的 CPU 使用情况?
如何使用各种工具和命令来检查 Ubuntu 中的 CPU 使用情况?
398 0
如何使用各种工具和命令来检查 Ubuntu 中的 CPU 使用情况?
|
6月前
|
监控 Ubuntu Linux
如何使用不同的方法和命令来检查 Ubuntu 中的 CPU 数量?
如何使用不同的方法和命令来检查 Ubuntu 中的 CPU 数量?
60 0
如何使用不同的方法和命令来检查 Ubuntu 中的 CPU 数量?
|
2月前
|
Ubuntu
百度搜索:蓝易云【ubuntu的apt命令详解】
请注意,apt命令需要在终端中运行,并需要管理员权限(使用sudo)。在使用apt命令前,建议先执行 `sudo apt update`来更新软件包列表,以获取最新的可用软件包信息。同时,要谨慎操作,特别是在使用卸载和清理命令时,以免误删重要的软件包或数据。
22 0