Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can I get portage to reload its list of installed packages?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
daaaaang
n00b
n00b


Joined: 04 Jul 2010
Posts: 48
Location: Ann Arbor, Michigan, US

PostPosted: Wed Feb 10, 2016 9:33 pm    Post subject: Can I get portage to reload its list of installed packages? Reply with quote

The short version is that I have everything split over a couple drives such that /home, /var, and /usr/local (and a few others) are on one drive, and all the main system stuff is on another. Due to some panicked "problem-solving" a while back, I ended up reverting the system drive to an older backup, and now I'm trying to clean up the mess.

A lot of the problem seems to be rooted in portage believing that it's installed packages that no longer exist in /usr and /etc (or believing that it's removed packages that are, in fact, still there). For example:

Code:
# gcc-config -l
 [1] x86_64-pc-linux-gnu-4.9.2
 [2] x86_64-pc-linux-gnu-4.9.3 *
# emerge --info gcc
Portage 2.2.26 (python 3.3.5-final-0, funtoo/1.0/linux-gnu/arch/x86-64bit, gcc-4.9.3, glibc-2.20-r2, 4.0.5-gentoogan x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.0.5-gentoogan-x86_64-Intel-R-_Core-TM-_i7-4930K_CPU_@_3.40GHz-with-gentoo-2.2.0
KiB Mem:    32855600 total,  22673852 free
KiB Swap:   36777380 total,  36777380 free
sh bash 4.3_p42
ld GNU ld (Funtoo 2.25) 2.25.0
app-shells/bash:          4.3_p42::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.22.1::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.3.5-r2::gentoo
dev-util/cmake:           3.4.1::gentoo
sys-apps/baselayout:      2.2.0-r6::gentoo
sys-apps/openrc:          0.18.3-r1::gentoo
sys-apps/sandbox:         2.9::gentoo
sys-devel/autoconf:       2.69-r1::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15-r1::gentoo
sys-devel/binutils:       2.25-r2::gentoo
sys-devel/gcc:            4.9.3-r1::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.0::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: git://github.com/funtoo/ports-2012.git
    priority: -1000

matts-funtoo-overlay
    location: /var/overlay/local
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA Oracle-BCLA-JavaSE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=corei7 -O2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=corei7 -O2"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=corei7 -O2"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed"
MAKEOPTS="-j10"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_TMPDIR="/tmp"
USE="X a52 aac aalib acl acpi alsa amd64 apng bash-completion berkdb bluetooth bluray bzip2 cairo cdda cddb cdio cdr cracklib crypt css cups curl cvs cxx dbus dri dts dvd dvdr dvdread encode examples exif faac faad ffmpeg flac fontconfig fortran gd gdbm gif gimp git glut gpg gpm gsm gstreamer gtk gzip hal ico iconv icu id3 ieee1394 imagemagick imap ios ipod ipv6 javascript jpeg jpeg2k kpathsea lame lastfmradio latex libass libguess libmpeg2 libnotify libyaml lm_sensors mad maildir matroska mercurial midi mjpeg mmx modules mozilla mp3 mp4 mpeg mpi mplayer mtp mudflap multilib musepack musicbrainz mysql ncurses network nforce2 nls nptl nsplugin nvidia offensive ogg opengl openmp pam pcre pdf php png postgres postproc pppd python qt3support quicktime raw readline resolvconf rss ruby sasl savedconfig sdl smtp sndfile sound speex spell sqlite sqlite3 sse sse2 ssl subversion svg taglib tcpd theora threads tiff truetype twolame udev unicode usb v4l v4l2 vim-syntax vorbis vpx wav wavpack webp win32codecs wmf wxwidgets x264 x265 xattr xcb xml xslt xvid zip zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel ice1724 intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias authn_core authz_core socache_shmcb unixd" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python3_3" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby20 ruby21 ruby22" USERLAND="GNU" VIDEO_CARDS="nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS

=================================================================
                        Package Settings
=================================================================

sys-devel/gcc-4.9.3-r1::gentoo was built with the following:
USE="cxx fortran (multilib) nls openmp -ada (-altivec) -doc -go -graphite (-hardened) (-libssp) (-multislot) -objc -objc++ (-sanitize) -vanilla"


So I apparently have gcc 4.9.2, but portage doesn't know that.

I'm currently oneshotting gcc 4.9.2 so that I can immediately prune it away, which works if I'm going one-at-a-time like this, but is there a way for me to tell portage to re-inventory my system and figure out what is actually there?

Thanks!
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Wed Feb 10, 2016 10:06 pm    Post subject: Reply with quote

you should have backuped your worldfile before reverting
Back to top
View user's profile Send private message
dol-sen
Developer
Developer


Joined: 30 Jun 2002
Posts: 2803
Location: Richmond, BC, Canada

PostPosted: Wed Feb 10, 2016 10:17 pm    Post subject: Reply with quote

Unfortunately, NO, /var/db/pkg/* it's it's installed pkg database. It has no way of searching the rest of your system to fix what is incorrect in that db. At least not for your situation.

So your stuck fixing it by hand.
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 3050
Location: Illinois, USA

PostPosted: Thu Feb 11, 2016 12:26 am    Post subject: Reply with quote

IIRC "revdep-rebuild" will, as a side effect, give you a list of files that don't belong to any installed package. You could take that list and try to figure out which package it belongs to, i.e. by executable name.
Back to top
View user's profile Send private message
dol-sen
Developer
Developer


Joined: 30 Jun 2002
Posts: 2803
Location: Richmond, BC, Canada

PostPosted: Thu Feb 11, 2016 6:09 am    Post subject: Reply with quote

Yes, you might also install app-portage/pfl and make use of e-file or use the portagefilelist.de site to help identify which files belong to which packages for any that revdep fails to identify.
_________________
Brian
Porthole, the Portage GUI frontend irc@freenode: #gentoo-guis, #porthole, Blog
layman, gentoolkit, CoreBuilder, esearch...
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43072
Location: 56N 3W

PostPosted: Thu Feb 11, 2016 8:10 pm    Post subject: Reply with quote

Moved from Portage & Programming to Unsupported Software.

Its Funtoo
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
timeraider
n00b
n00b


Joined: 27 Jul 2015
Posts: 41

PostPosted: Thu Feb 18, 2016 1:50 pm    Post subject: Reply with quote

How about using
Code:
emerge -e system && emerge -e world
like suggested in https://forums.gentoo.org/viewtopic-t-573458-start-0.html?
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Fri Feb 19, 2016 7:21 pm    Post subject: Reply with quote

timeraider wrote:
How about using
Code:
emerge -e system && emerge -e world
like suggested in https://forums.gentoo.org/viewtopic-t-573458-start-0.html?


nonsense

as it only pulls in the system dependencies.

...

A big reason why to backup the hole installation, not only the data.
Back to top
View user's profile Send private message
timeraider
n00b
n00b


Joined: 27 Jul 2015
Posts: 41

PostPosted: Sat Feb 20, 2016 1:11 am    Post subject: Reply with quote

sorry, but why should this be nonsense? have you overlooked the second command?

From the emerge man page:
Quote:
--emptytree (-e)
Reinstalls target atoms and their entire deep dependency tree, as though no packages are currently installed. You should run this with --pretend first to make sure the
result is what you expect.
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Sat Feb 20, 2016 2:10 am    Post subject: Reply with quote

timeraider wrote:
sorry, but why should this be nonsense? have you overlooked the second command?

timeraider ... while I wouldn't describe it as nonsense, if you compare the output of 'emerge -epq @system' and 'emerge -epq @world' you'll see that the latter includes the former.

Code:
% emerge -epq @system | awk '/^\[/{print $4}' > system-list
% emerge -epq @world | awk '/^\[/{print $4}' > world-list
% wc -l *-list
  216 system-list
  662 world-list
  878 total
% cat *-list | sort | uniq -d | wc -l
216

best ... khay
Back to top
View user's profile Send private message
schorsch_76
Guru
Guru


Joined: 19 Jun 2012
Posts: 450

PostPosted: Sat Feb 20, 2016 7:58 am    Post subject: Reply with quote

There is your world file at
Code:
cat /var/lib/portage/world

But it is not onyl that. It is your /etc/portage folder with the make.conf too. And your profile matters too.

My suggestion is:

  • copy /var/lib/portage/world
  • copy /etc/portage folder. But there are links in it (aka profile)
  • remember your profile (eselect profile list)
  • copy your /proc/config.gz
  • for safety create a backup (suggestion app-backup/fsarchiver)

Use a new installation stage 3 file and do a basic install

  • recompile your new , old, kernel (config.gz)
  • make it bootable
  • if it runs, copy the world file to /var/lib/portage/world
  • copy the make.conf/portage.* files/folders to /etc/portage . eventually the patches and so on
  • select your new (old) profile
  • emere -auDN --with-bdeps=y @system @world
  • check the output and compile


If your world file is missing, you need your memory to recreate it. But most times, it is good to "wipe the dust away" and get rid of some old stuff. If you dont remeber it, you havent used it. So it is nontheless useless rust.
_________________
// valid again: I forgot about the git access. Now 1.2GB big. Start: 2015-06-25
git daily portage tree
Web: https://portage.schorsch-tech.de
git clone https://portage.schorsch-tech.de/portage.git
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum