如何在 Ubuntu 14.04 中从外部源安装包?

如何在 Ubuntu 14.04 中从外部源安装包?

我做的时候出现错误apt-get update

You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 perl : Depends: perl-modules (>= 5.18.2-2ubuntu1.1) but 5.18.2-2ubuntu1 is installed
E: Unmet dependencies. Try using -f.

因此我手动perl_5.18.2-2ubuntu1.1.debian.tar.gzhttps://launchpad.net/ubuntu/+source/perl/5.18.2-2ubuntu1.1。当我提取tar.gz文件时,它会给出一个包含一些文件的 debian 文件夹。

现在我该如何消除这个错误?

输出apt-cache policy

Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu/ trusty/main Translation-en
 500 http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu/ trusty/main i386 Packages
     release v=14.04,o=LP-PPA-webupd8team-sublime-text-3,a=trusty,n=trusty,l=Sublime Text 3 Installer,c=main
     origin ppa.launchpad.net
 500 http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu/ trusty/main amd64 Packages
     release v=14.04,o=LP-PPA-webupd8team-sublime-text-3,a=trusty,n=trusty,l=Sublime Text 3 Installer,c=main
     origin ppa.launchpad.net
 500 http://ppa.launchpad.net/webupd8team/java/ubuntu/ trusty/main Translation-en
 500 http://ppa.launchpad.net/webupd8team/java/ubuntu/ trusty/main i386 Packages
     release v=14.04,o=LP-PPA-webupd8team-java,a=trusty,n=trusty,l=Oracle Java (JDK) 7 / 8 / 9 Installer PPA,c=main
     origin ppa.launchpad.net
 500 http://ppa.launchpad.net/webupd8team/java/ubuntu/ trusty/main amd64 Packages
     release v=14.04,o=LP-PPA-webupd8team-java,a=trusty,n=trusty,l=Oracle Java (JDK) 7 / 8 / 9 Installer PPA,c=main
     origin ppa.launchpad.net
 500 http://dl.google.com/linux/chrome/deb/ stable/main amd64 Packages
     release v=1.0,o=Google, Inc.,a=stable,n=stable,l=Google,c=main
     origin dl.google.com
 500 http://extras.ubuntu.com/ubuntu/ trusty/main i386 Packages
     release v=14.04,o=LP-PPA-app-review-board,a=trusty,n=trusty,l=Application Review Board PPA,c=main
     origin extras.ubuntu.com
 500 http://extras.ubuntu.com/ubuntu/ trusty/main amd64 Packages
     release v=14.04,o=LP-PPA-app-review-board,a=trusty,n=trusty,l=Application Review Board PPA,c=main
     origin extras.ubuntu.com
 500 http://security.ubuntu.com/ubuntu/ trusty-security/universe Translation-en
 500 http://security.ubuntu.com/ubuntu/ trusty-security/restricted Translation-en
 500 http://security.ubuntu.com/ubuntu/ trusty-security/multiverse Translation-en
 500 http://security.ubuntu.com/ubuntu/ trusty-security/main Translation-en
 500 http://security.ubuntu.com/ubuntu/ trusty-security/multiverse i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=multiverse
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu/ trusty-security/universe i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=universe
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu/ trusty-security/restricted i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=restricted
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu/ trusty-security/main i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=main
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu/ trusty-security/multiverse amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=multiverse
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu/ trusty-security/universe amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=universe
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu/ trusty-security/restricted amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=restricted
     origin security.ubuntu.com
 500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-security,n=trusty,l=Ubuntu,c=main
     origin security.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu/ trusty-backports/universe Translation-en
 500 http://in.archive.ubuntu.com/ubuntu/ trusty-backports/restricted Translation-en
 500 http://in.archive.ubuntu.com/ubuntu/ trusty-backports/multiverse Translation-en
 500 http://in.archive.ubuntu.com/ubuntu/ trusty-backports/main Translation-en
 100 http://in.archive.ubuntu.com/ubuntu/ trusty-backports/multiverse i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-backports,n=trusty,l=Ubuntu,c=multiverse
     origin in.archive.ubuntu.com
 100 http://in.archive.ubuntu.com/ubuntu/ trusty-backports/universe i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-backports,n=trusty,l=Ubuntu,c=universe
     origin in.archive.ubuntu.com
 100 http://in.archive.ubuntu.com/ubuntu/ trusty-backports/restricted i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-backports,n=trusty,l=Ubuntu,c=restricted
     origin in.archive.ubuntu.com
 100 http://in.archive.ubuntu.com/ubuntu/ trusty-backports/main i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-backports,n=trusty,l=Ubuntu,c=main
     origin in.archive.ubuntu.com
 100 http://in.archive.ubuntu.com/ubuntu/ trusty-backports/multiverse amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-backports,n=trusty,l=Ubuntu,c=multiverse
     origin in.archive.ubuntu.com
 100 http://in.archive.ubuntu.com/ubuntu/ trusty-backports/universe amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-backports,n=trusty,l=Ubuntu,c=universe
     origin in.archive.ubuntu.com
 100 http://in.archive.ubuntu.com/ubuntu/ trusty-backports/restricted amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-backports,n=trusty,l=Ubuntu,c=restricted
     origin in.archive.ubuntu.com
 100 http://in.archive.ubuntu.com/ubuntu/ trusty-backports/main amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-backports,n=trusty,l=Ubuntu,c=main
     origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/universe Translation-en
 500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/restricted Translation-en
 500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/multiverse Translation-en
 500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main Translation-en
 500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/multiverse i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=multiverse
     origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/universe i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=universe
     origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/restricted i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=restricted
     origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main i386 Packages
     release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=main
     origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/multiverse amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=multiverse
     origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=universe
     origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/restricted amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=restricted
     origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty-updates,n=trusty,l=Ubuntu,c=main
     origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu/ trusty/universe Translation-en
 500 http://in.archive.ubuntu.com/ubuntu/ trusty/restricted Translation-en
 500 http://in.archive.ubuntu.com/ubuntu/ trusty/multiverse Translation-en
 500 http://in.archive.ubuntu.com/ubuntu/ trusty/main Translation-en
 500 http://in.archive.ubuntu.com/ubuntu/ trusty/multiverse i386 Packages
     release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=multiverse
     origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu/ trusty/universe i386 Packages
     release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=universe
     origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu/ trusty/restricted i386 Packages
     release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=restricted
     origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu/ trusty/main i386 Packages
     release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=main
     origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu/ trusty/multiverse amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=multiverse
     origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=universe
     origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu/ trusty/restricted amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=restricted
     origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
     release v=14.04,o=Ubuntu,a=trusty,n=trusty,l=Ubuntu,c=main
     origin in.archive.ubuntu.com
Pinned packages:

答案1

对此不太确定,但看起来您已经破坏了依赖关系。从菜单中打开终端并启动以下命令:

sudo aptitude update && sudo aptitude install gtkorphan

如果第一个命令运行成功,则使用 && 运行第二个命令。

继续运行:

sudo aptitude update && sudo aptitude upgrade

这用于仔细检查您是否拥有所有更新。

要清除损坏的包,请使用以下命令:

sudo aptitude -f

它提供了一个漂亮的界面来搜索、导航、安装、更新和管理包。

请注意交替使用 aptitude 和 apt-get 是一种不好的做法,因为它们分别记录用户所做的更改

推荐阅读apt-get 与 aptitude

相关内容