最近使用的Ubuntu系统很不稳定,在关机的时候莫名奇妙的无法关机,只能强制关机。考虑进行更新,执行sudo apt-get update之后,发现有index无法获取,执行sudo apt-get upgrade也不成功,发现包是有问题的,为此,考虑在Update Manager中直接进行更新,发现出现如下问题:
Requires installation of untrusted packages
为此在搜索之后,虽然找到很多解决办法,但是都不能实际解决我的问题。
现列下来目前网上的解决办法:
方法1:
HowTo: Fix Ubuntu “Requires Installation of Untrusted Packages” Update Error
One of the first things I did after I got my Lenovo IdeaPad Y560 was to make it dual boot to Windows 7 and Ubuntu. After I have installed Ubuntu, I immediately run the Update Manager to update the system. Btw, I always update the system (either Windows or Ubuntu) before I install any programs or do any customizations. This makes sure that all components are up-to-date and helps make the system run smoother and lessens the chances of errors or conflicts with other components.
Anyways, when I tried to download and install the available updates for Ubuntu, I got this error message:
Requires installation of untrusted packages – “The action would require the installation of packages from not authenticated sources.”
I’ve installed Ubuntu lots of times before and this was the first time that I encountered this issue/error. I Googled the error message and found the very short and very simple solution from the Ubuntu forums. I’m sharing this in case someone might encounter the same problem and get the “requires installation of untrusted packages” error while updating Ubuntu.
Here’s how to do it:
1. On your Ubuntu panel, click on System > Administration > Update Manager.
2. Look for Settings at the bottom left corner of the Update Manager window, click on it.
3. On the Software Sources window, click on the Ubuntu Software tab.
4. Under Downloadable from the Internet, put a check on Source Code.
5. Close the window and the changes will be applied.
6. On Update Manager, click on Install Updates.
That should do it and you should now be able to download and install the available updates for your system. In my case, the Source Code option was not ticked/checked. After I put a check on it and clicked on Install Updates, the “requires installation of untrusted packages” error went away.
Hope this short and simple tutorial will help you if you encounter the same problem while updating Ubuntu. If you know of a different way to solve this problem when updating Ubuntu, please feel free to share it with us via the comment section. Thank you!
参照上面的办法,现进入Update Manager的设置(Setting)界面,然后在Ubuntu Soft中的Downloading from Intenet中选择:Source Code选项,
然后在点击Close使得该变更生效。重新check后再install就可以了。
经过实测,此种办法对我的系统无效。
方法2:
首先还是在命令行中sudo apt-get update,然后观察下面的警告信息或者提示信息,如果出现GPG Error,NO_PUBKEY的问题,则说明是共用密钥的问题,由于没有提供这个PUBLIC Key,所以导致更新失败,解决办法就是,在更新的时候附带上这个Key。
记录下来命令行下面那个Key的值,然后执行命令:
sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com XXXXXXX(此部分就是记录的那个Key)
执行完后就再update就OK。
经过实测,此种办法对我的系统也无效(因为提示信息中没有Pulic Key的信息,所以不是由于这个而导致更新失败的)
方法3:(自己摸索)
根据提示的消息,知道是有些包不正常而导致的,具体来说就是,之前在我的系统中,加入了ppa源,然后有该公共密钥神马的,而可能这些源目前有包更新了,而无法连接到这个可靠的更新源了,ubuntu的检查机制就会阻止更新选中的哪些不可靠源。
为此经过上面的方法其实,我的做法是:
1.首先进入setting,还是选中source code(方法1中的),毕竟这样源才可靠,齐全。
2.删除不可靠的更新列表。进入setting选项中,然后进入other software标签页,然后在里面取消选择哪些加入的ppa源,比如我之前加入的
http://ppa.launchpad.net/shown-p-huang/ppa/ubuntu等等,删除这些第三方的开发源,然后在Authentication标签页中,找到之前添加的那个ppa源的授权,删除。这样,关于这些不可靠源的更新列表就没有了。点击close,会继续更新索引。
3.最后发现更新完毕之后,在点击install即可正常的下载,下载完成后应用,再重启就OK了。
综述上面三种办法,都是针对不同的问题而有相应的对策的。在实际的学习中,要根据错误提示来灵活的选择解决办法。