目录
GLIBC 不匹配
- 最近遇到了这个问题,原因是程序/动态库是在高版本Ubuntu22编译出来的,然后复制到了低版本的Ubuntu20中希望运行,然后就报了这个错误。
- 了解原因后,解决办法分两种:
- 在低版本重新编译
- 在目标设备(低版本Ubuntu20)上添加高版本Ubuntu22的apt源,更新其libc。这里聊聊第二种。
- 找原因的过程中,还尝试过直接将高版本Ubuntu22上的libc.so替换到低版本的Ubuntu20上,结果ls、mv、rm等命令全都报段错误了,只剩下cd能用,文章后面聊聊这个和当时的救火的办法。
apt更新libc6
- 添加高版本的apt源其实有点玩火,但能救急
- 添加高版本Ubuntu22的apt源:
$ sudo vi /etc/apt/sources.list
- 添加行:
deb http://th.archive.ubuntu.com/ubuntu jammy main
- 保存后apt更新并更新libc:
$ sudo apt update
$ sudo apt install libc6
- 然后就ok了,如果提示找不到libcxx_xxx的某个版本,可以编译安装新版本的gcc解决。
ls/mv等基础命令段错误救火
- 一开始是在Ubuntu22上编译得到了程序和一些动态库,然后把程序和动态库复制到ubuntu20上运行,此时就报错提示找不到libc6和libcxx的一些版本。
- 然后就尝试把 libcxx 复制过来到 /usr/local/lib64 中,此时只剩下 libc6 的报错
- 接着就试试同样的把ubuntu22 上的 libc6 复制到 /usr/local/lib64 上,在 ldconfig 中该路径是动态库的优先搜索路径,此时程序执行时就会优先搜索该路径下的 libc6 和 libcxx
- 也就是这时,ls/mv/rm等基础命令全部段错误!!!只剩下cd/export等小部分命令可用
- 这说明是复制过来的 libc6 不能用出毛病了,此时千万不能断开ssh连接,不然就臭了。
- 然后设置更高优先级的动态库搜索路径变量 LD_LIBARY_PATH 让它优先搜索使用原本的 libc6 所在路径:
$ export LD_LIBARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBARY_PATH
- 接着赶紧把复制过来的 libc6.so 删掉。等测试正常后即可取消掉该环境变量:
$ unset LD_LIBARY_PATH
Wow amazing blog layout How long have you been blogging for you made blogging look easy The overall look of your web site is magnificent as well as the content
nagano tonic reviews : nagano tonic
Usually I do not read article on blogs however I would like to say that this writeup very compelled me to take a look at and do it Your writing style has been amazed me Thank you very nice article
I loved as much as youll receive carried out right here The sketch is attractive your authored material stylish nonetheless you command get bought an nervousness over that you wish be delivering the following unwell unquestionably come more formerly again as exactly the same nearly a lot often inside case you shield this hike
Nice blog here Also your site loads up very fast What host are you using Can I get your affiliate link to your host I wish my site loaded up as quickly as yours lol
I was recommended this website by my cousin I am not sure whether this post is written by him as nobody else know such detailed about my difficulty You are wonderful Thanks
nagano tonic reviews : nagano tonic reviews
nagano tonic reviews : nagano tonic reviews
Tech Learner You’re so awesome! I don’t believe I have read a single thing like that before. So great to find someone with some original thoughts on this topic. Really.. thank you for starting this up. This website is something that is needed on the internet, someone with a little originality!
Thinker Pedia You’re so awesome! I don’t believe I have read a single thing like that before. So great to find someone with some original thoughts on this topic. Really.. thank you for starting this up. This website is something that is needed on the internet, someone with a little originality!
Sugar defender reviews : sugar defender reviews
Somebody essentially lend a hand to make significantly posts I might state That is the very first time I frequented your web page and up to now I surprised with the research you made to create this particular put up amazing Excellent job
Nitric boost ultra reviews : https://nitricboostultrareviews.usaloves.com
sugar defender reviews: https://sugardefenderreviews.pages.dev
Hey there You have done a fantastic job I will certainly digg it and personally recommend to my friends Im confident theyll be benefited from this site
Hi Neat post There is a problem along with your website in internet explorer would test this IE still is the market chief and a good section of other folks will pass over your magnificent writing due to this problem
nagano tonic: nagano tonic
nagano tonic: nagano tonic
Your blog is a constant source of inspiration for me. Your passion for your subject matter shines through in every post, and it’s clear that you genuinely care about making a positive impact on your readers.
sumatra slim belly tonic reviews: sumatra slim belly tonic reviews
sumatra slim belly tonic reviews: sumatra slim belly tonic reviews
What is a good dental health? My website: prodentim reviews
What is a good dental health? My website: prodentim reviews
What is a good dental health? My website: prodentim reviews
Looking for the best strategy for Lucky Jet? Our Lucky Jet review covers tips, features, and what makes this crash game popular among players. Read now for a full guide!
Joint Genesis Reviews, Pricing, and bonuses visit here: joint genesis
Joint Genesis Reviews, Pricing, and bonuses visit here: joint genesis
Kalorifer Sobası odun, kömür, pelet gibi yakıtlarla çalışan ve ısıtma işlevi gören bir soba türüdür.
Hello.
15,000,000 Welcome Free Coins Countless AMAZING themes Try Your Luck and Play It NOW. Register here: https://tinyurl.com/yptttbz5
Hello i think that i saw you visited my weblog so i came to Return the favore Im trying to find things to improve my web siteI suppose its ok to use some of your ideas
I loved as much as youll receive carried out right here The sketch is attractive your authored material stylish nonetheless you command get bought an nervousness over that you wish be delivering the following unwell unquestionably come more formerly again as exactly the same nearly a lot often inside case you shield this hike
you are in reality a good webmaster The website loading velocity is amazing It sort of feels that youre doing any distinctive trick Also The contents are masterwork you have done a fantastic job in this topic
Nice blog here Also your site loads up fast What host are you using Can I get your affiliate link to your host I wish my web site loaded up as quickly as yours lol
Just wish to say your article is as surprising The clearness in your post is just cool and i could assume youre an expert on this subject Fine with your permission allow me to grab your RSS feed to keep updated with forthcoming post Thanks a million and please keep up the enjoyable work
Techarp I’m often to blogging and i really appreciate your content. The article has actually peaks my interest. I’m going to bookmark your web site and maintain checking for brand spanking new information.
allegheny county real estate naturally like your web site however you need to take a look at the spelling on several of your posts. A number of them are rife with spelling problems and I find it very bothersome to tell the truth on the other hand I will surely come again again.
Nutra Gears Pretty! This has been a really wonderful post. Many thanks for providing these details.
Hi Neat post Theres an issue together with your web site in internet explorer may test this IE still is the marketplace chief and a good component of people will pass over your fantastic writing due to this problem
obviously like your website but you need to test the spelling on quite a few of your posts Several of them are rife with spelling problems and I to find it very troublesome to inform the reality on the other hand Ill certainly come back again
What is the best absolutely free blog/web or search engine directory on the web?
ไพเราะและชวนคิด คุณจัดการทำให้หัวข้อที่ซับซ้อนนี้เข้าถึงได้และน่าสนใจ
What i do not realize is in fact how you are no longer actually much more wellfavored than you might be right now Youre very intelligent You recognize thus considerably in relation to this topic made me in my view believe it from numerous numerous angles Its like men and women are not fascinated until it is one thing to do with Lady gaga Your own stuffs excellent All the time handle it up
My brother suggested I might like this blog He was totally right This post actually made my day You can not imagine simply how much time I had spent for this info Thanks
Mygreat learning This is really interesting, You’re a very skilled blogger. I’ve joined your feed and look forward to seeking more of your magnificent post. Also, I’ve shared your site in my social networks!
My admiration for your creations is as substantial as your own sentiment. The visual presentation is tasteful, and the written content is sophisticated. Yet, you seem uneasy about the possibility of presenting something that may cause unease. I’m confident you’ll be able to resolve this issue efficiently.
I was just as enthralled by your work as you were. The visual presentation is refined, and the written content is sophisticated. However, you seem anxious about the possibility of presenting something that could be perceived as questionable. I believe you’ll be able to rectify this matter in a timely manner.
Vitazen Keto Gummies I just like the helpful information you provide in your articles
Meu irmão sugeriu que eu pudesse gostar deste blog Ele estava totalmente certo Este post realmente fez o meu dia Você não pode imaginar quanto tempo gastei com esta informação Obrigado
Vitazen Keto Gummies Very well presented. Every quote was awesome and thanks for sharing the content. Keep sharing and keep motivating others.
I do not even know how I ended up here but I thought this post was great I dont know who you are but definitely youre going to a famous blogger if you arent already Cheers