Knowledge of the Linux package series (attached: Ubuntu16.04 upgrade to 18.04 case)

Source: Internet
Author: User
Tags gtk

Linux Basics: Https://www.cnblogs.com/dunitian/p/4822808.html#linux

Before see friends still apt-get update upgrade, very puzzled, later found that he just know this update command but do not know its meaning, so every time you install a package will be all apt-get common purge + Update command to play again

Later ~ There is this article, calculate to small white popularization: (Behind the actual case)

Package-related commands:

Clear useless package:apt-get clean && apt-get autoclean #一般用apt-get AutoClean is enough.

Update Source:apt-get update    #同步 The index of the/etc/apt/sources.list source to know if there is a current package

Update package:apt-get upgrade   #更新所有已安装的软件 (upgrade is just a simple update package, regardless of these dependencies, it is not added without deleting. )

Update package 2:apt-get Dist-upgrade #包与包之间存在各种依赖关系. Dist-upgrade can be added to the package according to the change of the dependency relationship. ( dependencies can sometimes go wrong, it is recommended to use cautiously )

Add: Be sure to perform an updatebefore executing upgrade or Dist-upgrade to get the latest

Install the software: apt-get install XXX [--reinstall] #--reinstall is a reinstall package, usually with apt-get install xxx

Fix dependency: Apt-get- F Install #修复依赖, similar to win inside the missing dll,-f after he helped you fix some dependencies (install Sogou Pinyin Instance useful to)

Remove Software: Apt-get remove XXX [--purge] #--purge Uninstall when the configuration file is also deleted, completely remove the package can be used this option:apt-get remove XXX--purge  

--------------------------------------------------------------------------------------------------------------- ------------------------------------------

Other commands: (used in special circumstances)

Search software: Apt-get search xxx

Check for damaged dependencies: Apt-get Check (occasionally remembered or the software is not open when using "sometimes cleaned up")

Get package info: Apt-cache Show xxx

What are the dependencies: Apt-cache depends xxx (such as installing a package, repairing dependencies also fails, then see what dependencies you have to install manually)

What packages are dependent on: apt-cache rdepends xxx (e.g., when uninstalling a package, check which packages are dependent on them)

Download the package source code: Apt-get Source XXX

Install the relevant compilation environment: Apt-get BUILD-DEP XXX

Actual cases:

Simply say, first clear the useless package, and then update the index of the next source, and then upgrade. Previously thought Dist-upgrade system after the rolling upgrade, such as the original 16.04.1 later may become 16.04.2.

Reboot restart,update-manager-d Run update management, point down the upgrade, the next step is good ( inverse day is lazy one, the system large version across the command is rarely used, so do not bother to remember, the Appendix has command installation )

[Email protected]:~$sudoapt-get clean [email protected]-pc:~$sudoapt-get AutoClean is reading the package list ... Completing the dependency tree that is analyzing the package is reading state information ... Complete [email protected]-pc:~$sudoapt-get update ignores:1http//Dl.google.com/linux/chrome/deb Stable InreleaseHit:2http//Archive.ubuntukylin.com:10006/ubuntukylin xenial inreleaseHit:3http//Dl.google.com/linux/chrome/deb Stable ReleaseHit:4http//Mirrors.ustc.edu.cn/ubuntu xenial inreleaseHit:6http//Mirrors.ustc.edu.cn/ubuntu xenial-updates inreleaseHit:7http//Mirrors.ustc.edu.cn/ubuntu xenial-security inreleaseHit:8http//Packages.microsoft.com/repos/vscode Stable InreleaseReading Package List ... Complete [email protected]-pc:~$sudoapt-Get Upgrade is reading the package list ... Completing the dependency tree that is analyzing the package is reading state information ... Completing the update being calculated ... The versions of the following packages will remain the same: Cups-filters cups-filters-core-drivers Gir1.2-javascriptcoregtk-4.0Gir1.2-webkit2-4.0Google-chrome-stable libjavascriptcoregtk-4.0- -LIBWEBKIT2GTK-4.0-Panax Notoginsenglibwebkit2gtk-4.0-Panax Notoginseng-GTK2 linux-generic-hwe-16.04Linux-headers-generic-hwe-16.04linux-image-generic-hwe-16.04Linux-signed-generic-hwe-16.04linux-signed-image-generic-hwe-16.04Qpdf upgraded.0A new package, a newly installed0A package to uninstall0Packages that have -packages have not been upgraded. [Email protected]-pc:~$Cat/etc/Issueubuntu16.04.4LTS \ \l[email protected]-pc:~$sudoApt-get dist-Upgrade is reading the package list ... Completing the dependency tree that is analyzing the package is reading state information ... Completing the update being calculated ... Complete the following packages are installed automatically and do not need it now: Libappindicator1 libindicator7 use'sudo apt autoremove'to uninstall it (them). The following "new" packages will be installed: AMD64-microcode intel-microcode iucode-tool libqpdf21 libwebpdemux1 linux-headers-4.13.0- +linux-headers-4.13.0- +-Generic Linux-image-4.13.0- +-generic linux-image-extra-4.13.0- +-generic linux-signed-image-4.13.0- +-generic The following packages will be upgraded: Cups-filters cups-filters-core-drivers Gir1.2-javascriptcoregtk-4.0Gir1.2-webkit2-4.0Google-chrome-stable libjavascriptcoregtk-4.0- -LIBWEBKIT2GTK-4.0-Panax Notoginsenglibwebkit2gtk-4.0-Panax Notoginseng-GTK2 linux-generic-hwe-16.04linux-headers-generic-hwe-16.04linux-image-generic-hwe-16.04Linux-signed-generic-hwe-16.04linux-signed-image-generic-hwe-16.04Qpdf upgraded. -A new package, a newly installedTenA package to uninstall0Packages that have0packages have not been upgraded. Need to download143MB of archives. After decompression, it consumes -MB of extra space. Do you want to continue? [Y/N] y gets:1http//mirrors.ustc.edu.cn/ubuntu xenial-updates/main amd64 libqpdf21 amd64 8.0.2-3~16.04.1 [315 KB]Get:2http//dl.google.com/linux/chrome/deb stable/main amd64 google-chrome-stable amd64 66.0.3359.181-1 [52.3 MB]Get:3http//mirrors.ustc.edu.cn/ubuntu xenial-updates/main amd64 cups-filters-core-drivers amd64 1.8.3-2ubuntu3.4 [KB] Get:4http//mirrors.ustc.edu.cn/ubuntu xenial-updates/main amd64 cups-filters amd64 1.8.3-2ubuntu3.4 [448 KB][email protected]-pc:~$ reboot[email Protected]-pc:~$Cat/etc/Issueubuntu16.04.4LTS \ \l[email protected]-pc:~$sudoUpdate-manager-d[sudo] dnt Password:/usr/bin/update-manager: -: PYGIWARNING:GTK was imported without specifying a version first. Use Gi.require_version ('GTK','3.0') before import to ensure this right version gets loaded. From gi.repository import GTK/usr/lib/python3/dist-packages/updatemanager/unitysupport.py: in: Pygiwarning:dbusmenu was imported without specifying a version first. Use Gi.require_version ('Dbusmenu','0.4') before import to ensure this right version gets loaded. From gi.repository import Dbusmenu, Unity/usr/lib/python3/dist-packages/updatemanager/unitysupport.py: in: Pygiwarning:unity was imported without specifying a version first. Use Gi.require_version ('Unity','7.0') before import to ensure this right version gets loaded. From gi.repository import Dbusmenu, Unity

Appendix: (Original Address)

  1. update Ubuntu 16.04 

    Before you upgrade, you should update the current 16.04. It is recommended that all installed packages be updated/upgraded before upgrading.

    Run the following command:

    sudo apt update && sudo apt dist-upgrade && sudo apt autoremove

  2. install ubuntu Update Manager

    After the system has been updated, run the following command to install Update-manager-core (if you are not installed).

    sudo apt-get isntall update-manager-core

Knowledge of the Linux package family (attached: Ubuntu16.04 upgrade to 18.04 case)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.