联想Y480 ubuntu安装有线驱动
欢迎来到阿八个人博客网站。本 阿八个人博客 网站提供最新的站长新闻,各种互联网资讯。 喜欢本站的朋友可以收藏本站,或者加QQ:我们大家一起来交流技术! URL链接:https://www.abboke.com/rz/2019/1010/116805.html 电脑可以连无线但不能连有线,推测没有装有线网卡的驱动。上网上找到了方法:
brush: bash;auto-links: false;">sudo apt-get install build-essential linux-headers-generic linux-headers-`uname -r`wget https://www.kernel.org/pub/linux/kernel/projects/backports/2013/03/04/compat-drivers-2013-03-04-u.tar.bz2tar -xj compat-drivers-*./scripts/driver-select alxmakesudo make installsudo modprobe -r alx && sudo modprobe alx
中间在执行make时会提示/home/phithon/compat-drivers-2013-03-04-u/include/linux/compat-3.8.h:49:32: 错误: ‘kref_get_unless_zero’重定义
因为给出了重定义的具体位置,所以我们直接进去看看:
brush: bash;auto-links: false;">nano /home/phithon/compat-drivers-2013-03-04-u/include/linux/compat-3.8.h按ctrl + w查找“kref_get_unless_zero”,发现了一个函数
brush: cpp;auto-links: false;">static inline int __must_check kref_get_unless_zero(struct kref *kref){ return atomic_add_unless(&kref->refcount, 1, 0);}就是这里重定义了,简单地将其注释掉即可。再次make即可通过编译,并最后连上有线网络。